4 Feb
2011
4 Feb
'11
3:10 p.m.
On Fri, Feb 04, 2011 at 11:19:24AM +0530, Harsha, Priya wrote:
- pr_debug("interrupt id read in sram = 0x%x\n", jack_msg->intr_id);
- if (jack_msg->intr_id & 0x1) {
pr_debug("short_push detected\n");
mask = status = SND_JACK_BTN_0;
- } else if (jack_msg->intr_id & 0x2) {
pr_debug("long_push detected\n");
mask = status = SND_JACK_BTN_1;
Shouldn't this be using a mask of BTN_0 and BTN_1 for both buttons, they can't be detected simultaneously?
No. They can't be detected simultaneously. It's the same button giving Interrupts for long press and short press based on the duration of the press
In which case the driver shouldn't be using the same value for mask and status, the two buttons are exclusive (and having the multiple assignments in one statement isn't ideal for legibility anyway).