All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: hdmi-codec: Fix return value in hdmi_codec_set_jack()
@ 2021-01-07 16:26 Stephan Gerhold
  2021-01-07 16:36 ` Mark Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Stephan Gerhold @ 2021-01-07 16:26 UTC (permalink / raw)
  To: Mark Brown
  Cc: alsa-devel, Srinivas Kandagatla, Liam Girdwood, Stephan Gerhold,
	Cheng-Yi Chiang

Sound is broken on the DragonBoard 410c (apq8016_sbc) since 5.10:

  hdmi-audio-codec hdmi-audio-codec.1.auto: ASoC: error at snd_soc_component_set_jack on hdmi-audio-codec.1.auto: -95
  qcom-apq8016-sbc 7702000.sound: Failed to set jack: -95
  ADV7533: ASoC: error at snd_soc_link_init on ADV7533: -95
  hdmi-audio-codec hdmi-audio-codec.1.auto: ASoC: error at snd_soc_component_set_jack on hdmi-audio-codec.1.auto: -95
  qcom-apq8016-sbc: probe of 7702000.sound failed with error -95

This happens because apq8016_sbc calls snd_soc_component_set_jack() on
all codec DAIs and attempts to ignore failures with return code -ENOTSUPP.
-ENOTSUPP is also excluded from error logging in soc_component_ret().

However, hdmi_codec_set_jack() returns -E*OP*NOTSUPP if jack detection
is not supported, which is not handled in apq8016_sbc and soc_component_ret().
Make it return -ENOTSUPP instead to fix sound and silence the errors.

Cc: Cheng-Yi Chiang <cychiang@chromium.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Fixes: 55c5cc63ab32 ("ASoC: hdmi-codec: Use set_jack ops to set jack")
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
 sound/soc/codecs/hdmi-codec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c
index d5fcc4db8284..0f3ac22f2cf8 100644
--- a/sound/soc/codecs/hdmi-codec.c
+++ b/sound/soc/codecs/hdmi-codec.c
@@ -717,7 +717,7 @@ static int hdmi_codec_set_jack(struct snd_soc_component *component,
 			       void *data)
 {
 	struct hdmi_codec_priv *hcp = snd_soc_component_get_drvdata(component);
-	int ret = -EOPNOTSUPP;
+	int ret = -ENOTSUPP;
 
 	if (hcp->hcd.ops->hook_plugged_cb) {
 		hcp->jack = jack;
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: hdmi-codec: Fix return value in hdmi_codec_set_jack()
  2021-01-07 16:26 [PATCH] ASoC: hdmi-codec: Fix return value in hdmi_codec_set_jack() Stephan Gerhold
@ 2021-01-07 16:36 ` Mark Brown
  2021-01-07 16:47   ` Stephan Gerhold
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2021-01-07 16:36 UTC (permalink / raw)
  To: Stephan Gerhold
  Cc: alsa-devel, Srinivas Kandagatla, Liam Girdwood, Cheng-Yi Chiang

[-- Attachment #1: Type: text/plain, Size: 468 bytes --]

On Thu, Jan 07, 2021 at 05:26:40PM +0100, Stephan Gerhold wrote:

> However, hdmi_codec_set_jack() returns -E*OP*NOTSUPP if jack detection
> is not supported, which is not handled in apq8016_sbc and soc_component_ret().
> Make it return -ENOTSUPP instead to fix sound and silence the errors.

You will also need to update imx-hdmi, it is explicitly checking for
-EOPNOTSUPP so this will break it.  Having two error codes with such
similar names is rather unfortunate.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: hdmi-codec: Fix return value in hdmi_codec_set_jack()
  2021-01-07 16:36 ` Mark Brown
@ 2021-01-07 16:47   ` Stephan Gerhold
  0 siblings, 0 replies; 3+ messages in thread
From: Stephan Gerhold @ 2021-01-07 16:47 UTC (permalink / raw)
  To: Mark Brown
  Cc: alsa-devel, Srinivas Kandagatla, Liam Girdwood, Cheng-Yi Chiang

On Thu, Jan 07, 2021 at 04:36:00PM +0000, Mark Brown wrote:
> On Thu, Jan 07, 2021 at 05:26:40PM +0100, Stephan Gerhold wrote:
> 
> > However, hdmi_codec_set_jack() returns -E*OP*NOTSUPP if jack detection
> > is not supported, which is not handled in apq8016_sbc and soc_component_ret().
> > Make it return -ENOTSUPP instead to fix sound and silence the errors.
> 
> You will also need to update imx-hdmi, it is explicitly checking for
> -EOPNOTSUPP so this will break it.  Having two error codes with such
> similar names is rather unfortunate.

Right, thanks for mentioning this! Apparently I only checked 5.10 for
other uses of -EOPNOTSUPP... Will send a v2 shortly!

Thanks,
Stephan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-07 16:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-07 16:26 [PATCH] ASoC: hdmi-codec: Fix return value in hdmi_codec_set_jack() Stephan Gerhold
2021-01-07 16:36 ` Mark Brown
2021-01-07 16:47   ` Stephan Gerhold

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.