[alsa-devel] [PATCH 3/3] ASoC: sn95031 codec - adding jack detection/reporting
Mark Brown
broonie at opensource.wolfsonmicro.com
Fri Feb 4 15:10:03 CET 2011
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).
More information about the Alsa-devel
mailing list