lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 6 Dec 2013 22:38:17 +0800
From:	Nicolin Chen <b42378@...escale.com>
To:	Mark Brown <broonie@...nel.org>
CC:	<lgirdwood@...il.com>, <alsa-devel@...a-project.org>,
	<tiwai@...e.de>, <perex@...ex.cz>, <linux-kernel@...r.kernel.org>,
	<linux-doc@...r.kernel.org>, <devicetree@...r.kernel.org>,
	<rob@...dley.net>, <ijc+devicetree@...lion.org.uk>,
	<swarren@...dotorg.org>, <mark.rutland@....com>,
	<pawel.moll@....com>, <rob.herring@...xeda.com>
Subject: Re: [PATCH 3/3] ASoC: fsl: imx-wm8962: Add headphone and microphone
 jack plugin/out detection

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



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ