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]
Message-ID: <Z-6bTj097a1LVn3X@hovoldconsulting.com>
Date: Thu, 3 Apr 2025 16:29:34 +0200
From: Johan Hovold <johan@...nel.org>
To: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Cc: peda@...ntia.se, broonie@...nel.org, andersson@...nel.org,
	krzk+dt@...nel.org, ivprusov@...utedevices.com,
	luca.ceresoli@...tlin.com, zhoubinbin@...ngson.cn,
	paulha@...nsource.cirrus.com, lgirdwood@...il.com, robh@...nel.org,
	conor+dt@...nel.org, konradybcio@...nel.org, perex@...ex.cz,
	tiwai@...e.com, dmitry.baryshkov@....qualcomm.com,
	linux-sound@...r.kernel.org, linux-arm-msm@...r.kernel.org,
	devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
	johan+linaro@...nel.org,
	Christopher Obbard <christopher.obbard@...aro.org>
Subject: Re: [PATCH v6 5/6] ASoC: codecs: wcd938x: add mux control support
 for hp audio mux

On Thu, Apr 03, 2025 at 01:19:57PM +0100, Srinivas Kandagatla wrote:
> On 02/04/2025 10:12, Johan Hovold wrote:
> > On Thu, Mar 27, 2025 at 10:06:32AM +0000, Srinivas Kandagatla wrote:
> >> From: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
> >>
> >> On some platforms to minimise pop and click during switching between
> >> CTIA and OMTP headset an additional HiFi mux is used. Most common
> >> case is that this switch is switched on by default, but on some
> >> platforms this needs a regulator enable.
> >>
> >> move to using mux control to enable both regulator and handle gpios,
> >> deprecate the usage of gpio.
> >>
> >> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
> >> Tested-by: Christopher Obbard <christopher.obbard@...aro.org>
> > 
> >> @@ -3261,11 +3276,26 @@ static int wcd938x_populate_dt_data(struct wcd938x_priv *wcd938x, struct device
> >>   		return dev_err_probe(dev, wcd938x->reset_gpio,
> >>   				     "Failed to get reset gpio\n");
> >>   
> >> -	wcd938x->us_euro_gpio = devm_gpiod_get_optional(dev, "us-euro",
> >> -						GPIOD_OUT_LOW);
> >> -	if (IS_ERR(wcd938x->us_euro_gpio))
> >> -		return dev_err_probe(dev, PTR_ERR(wcd938x->us_euro_gpio),
> >> -				     "us-euro swap Control GPIO not found\n");
> >> +	wcd938x->us_euro_mux = devm_mux_control_get(dev, NULL);

> > Running with this patch on the CRD I noticed that this now prints an
> > error as there is no optional mux (or gpio) defined:
> > 
> > 	wcd938x_codec audio-codec: /audio-codec: failed to get mux-control (0)
> 
> This is not from codec driver, mux control is throwing up this.

Yeah, the error is printed by the mux code, but it's this codec change
that starts triggering it.

> > You need to suppress that error in mux_get() to allow for optional muxes
> > to be looked up like this.

> I have a plan for this,
> 
> I proposed some changes to mux api for exclusive apis at 
> https://lkml.org/lkml/2025/3/26/955
> 
> This should also allow us to easily add an optional api, which I plan to 
> do once i get some feedback on this patch.

It may just be as simple as demoting that dev_err() in mux_get() to
dev_dbg() and possibly make sure any callers log errors themselves.

A quick grep shows there are only 12 users or so and most of them
already seem to be logging mux lookup errors.

Johan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ