All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: "Harsha, Priya" <priya.harsha@intel.com>
Cc: "Koul, Vinod" <vinod.koul@intel.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"lrg@slimlogic.co.uk" <lrg@slimlogic.co.uk>
Subject: Re: [PATCH 3/3] ASoC: sn95031 codec - adding jack detection/reporting
Date: Fri, 4 Feb 2011 14:10:03 +0000	[thread overview]
Message-ID: <20110204141003.GB5393@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <98769532B4BB14429434178695419EAE08C107FDA5@bgsmsx501.gar.corp.intel.com>

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).

  reply	other threads:[~2011-02-04 14:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-03 11:26 [PATCH 3/3] ASoC: sn95031 codec - adding jack detection/reporting Harsha Priya
2011-02-03 16:06 ` Mark Brown
2011-02-03 23:03   ` Mark Brown
2011-02-04  3:50     ` Harsha, Priya
2011-02-04 14:05       ` Mark Brown
2011-02-04  5:49   ` Harsha, Priya
2011-02-04 14:10     ` Mark Brown [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-01-28 17:11 Harsha Priya

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110204141003.GB5393@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=lrg@slimlogic.co.uk \
    --cc=priya.harsha@intel.com \
    --cc=vinod.koul@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.