devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolin Chen <b42378@freescale.com>
To: Mark Brown <broonie@kernel.org>
Cc: lgirdwood@gmail.com, alsa-devel@alsa-project.org, tiwai@suse.de,
	perex@perex.cz, linux-kernel@vger.kernel.org,
	linux-doc@vger.kernel.org, devicetree@vger.kernel.org,
	rob@landley.net, ijc+devicetree@hellion.org.uk,
	swarren@wwwdotorg.org, mark.rutland@arm.com, pawel.moll@arm.com,
	rob.herring@calxeda.com
Subject: Re: [PATCH 3/3] ASoC: fsl: imx-wm8962: Add headphone and microphone jack plugin/out detection
Date: Fri, 6 Dec 2013 22:38:17 +0800	[thread overview]
Message-ID: <20131206143817.GB29975@MrMyself> (raw)
In-Reply-To: <20131206144256.GI29268@sirena.org.uk>

On Fri, Dec 06, 2013 at 02:42:56PM +0000, Mark Brown wrote:
> On Fri, Dec 06, 2013 at 05:48:23PM +0800, Nicolin Chen wrote:
> 
> > Therefore, this patch mainly adds jack event detection feature and switchs I/O
> > routes accordingly. Meanwhile, for those monaural input cases, we also turn on
> > the ADC monomix features of WM8962 if needed.
> 
> No, the kernel shouldn't be doing any route switching or other
> configuration - that should be done by userspace.  This is a policy
> decision, there are situations where for example audio should go to both
> headphones and speaker when headphones are connected in order to make
> sure notifications are audible even if headpones have been removed.

I see...It seems my solution is too specific. I will re-think about it.

> > +	if (hp_status != priv->hp_active_low) {
> > +		snprintf(buf, 32, "STATE=%d", 2);
> > +		snd_soc_dapm_disable_pin(&priv->codec->dapm, "Ext Spk");
> > +		ret = imx_hp_jack_gpio.report;
> > +	} else {
> > +		snprintf(buf, 32, "STATE=%d", 0);
> > +		snd_soc_dapm_enable_pin(&priv->codec->dapm, "Ext Spk");
> > +		ret = 0;
> > +	}
> > +
> > +	envp[0] = "NAME=headphone";
> > +	envp[1] = buf;
> > +	envp[2] = NULL;
> > +	kobject_uevent_env(&pdev->dev.kobj, KOBJ_CHANGE, envp);
> 
> What's this uevent trying to do and why is it open coded in the driver?

That's a requirement from Android team of Freescale. By checking this
event they can determine whether current output is speaker or headphone
so as to place an icon on the notification area.

Sir, if you think this patch is not common enough or non-community style,
I can try to cut it down to an common one or entirely drop it.

Looking forward to your reply,
Nicolin Chen




  reply	other threads:[~2013-12-06 14:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1386322845.git.b42378@freescale.com>
     [not found] ` <cover.1386322845.git.b42378-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2013-12-06  9:48   ` [PATCH 3/3] ASoC: fsl: imx-wm8962: Add headphone and microphone jack plugin/out detection Nicolin Chen
2013-12-06 14:42     ` Mark Brown
2013-12-06 14:38       ` Nicolin Chen [this message]
2013-12-06 15:03         ` Mark Brown
2013-12-06 14:52           ` Nicolin Chen

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=20131206143817.GB29975@MrMyself \
    --to=b42378@freescale.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=lgirdwood@gmail.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=perex@perex.cz \
    --cc=rob.herring@calxeda.com \
    --cc=rob@landley.net \
    --cc=swarren@wwwdotorg.org \
    --cc=tiwai@suse.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).