lkml.org 
[lkml]   [2013]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/3] ASoC: fsl: imx-wm8962: Add headphone and microphone jack plugin/out detection
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?
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2013-12-06 16:01    [W:0.070 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site