4 Feb
2011
4 Feb
'11
12:03 a.m.
On Thu, Feb 03, 2011 at 04:06:40PM +0000, Mark Brown wrote:
On Thu, Feb 03, 2011 at 04:56:22PM +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?
By the way, this logic for reporting the buttons separately to the detection of the headset/headphone status is something that should be pulled out into generic code as the same mechanism is going to be needed by anything using voltage based detection.