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


[-- Attachment #1.1: Type: text/plain, Size: 1139 bytes --]

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.

> +	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?

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  reply	other threads:[~2013-12-06 14:42 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 [this message]
2013-12-06 14:38       ` Nicolin Chen
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=20131206144256.GI29268@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=b42378@freescale.com \
    --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=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).