All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] ASoC: hdmi-codec: Fix return value in hdmi_codec_set_jack()
@ 2021-01-07 16:51 Stephan Gerhold
  2021-01-07 20:42 ` Nicolin Chen
  2021-01-08 16:29 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Stephan Gerhold @ 2021-01-07 16:51 UTC (permalink / raw)
  To: Mark Brown
  Cc: alsa-devel, Stephan Gerhold, Timur Tabi, Xiubo Li, Shengjiu Wang,
	Liam Girdwood, Nicolin Chen, Srinivas Kandagatla, Fabio Estevam,
	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>
---
Changes in v2:
  - Replace -EOPNOTSUPP check with -ENOTSUPP in imx-hdmi.c
---
 sound/soc/codecs/hdmi-codec.c | 2 +-
 sound/soc/fsl/imx-hdmi.c      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

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;
diff --git a/sound/soc/fsl/imx-hdmi.c b/sound/soc/fsl/imx-hdmi.c
index ede4a9ad1054..dbbb7618351c 100644
--- a/sound/soc/fsl/imx-hdmi.c
+++ b/sound/soc/fsl/imx-hdmi.c
@@ -90,7 +90,7 @@ static int imx_hdmi_init(struct snd_soc_pcm_runtime *rtd)
 	}
 
 	ret = snd_soc_component_set_jack(component, &data->hdmi_jack, NULL);
-	if (ret && ret != -EOPNOTSUPP) {
+	if (ret && ret != -ENOTSUPP) {
 		dev_err(card->dev, "Can't set HDMI Jack %d\n", ret);
 		return ret;
 	}
-- 
2.30.0


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

* Re: [PATCH v2] ASoC: hdmi-codec: Fix return value in hdmi_codec_set_jack()
  2021-01-07 16:51 [PATCH v2] ASoC: hdmi-codec: Fix return value in hdmi_codec_set_jack() Stephan Gerhold
@ 2021-01-07 20:42 ` Nicolin Chen
  2021-01-08 16:29 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Nicolin Chen @ 2021-01-07 20:42 UTC (permalink / raw)
  To: Stephan Gerhold
  Cc: alsa-devel, Timur Tabi, Xiubo Li, Shengjiu Wang, Liam Girdwood,
	Mark Brown, Srinivas Kandagatla, Fabio Estevam, Cheng-Yi Chiang

On Thu, Jan 07, 2021 at 05:51:31PM +0100, Stephan Gerhold wrote:
> 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>

For imx-hdmi:
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>

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

* Re: [PATCH v2] ASoC: hdmi-codec: Fix return value in hdmi_codec_set_jack()
  2021-01-07 16:51 [PATCH v2] ASoC: hdmi-codec: Fix return value in hdmi_codec_set_jack() Stephan Gerhold
  2021-01-07 20:42 ` Nicolin Chen
@ 2021-01-08 16:29 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2021-01-08 16:29 UTC (permalink / raw)
  To: Stephan Gerhold
  Cc: alsa-devel, Timur Tabi, Xiubo Li, Shengjiu Wang, Liam Girdwood,
	Nicolin Chen, Srinivas Kandagatla, Fabio Estevam,
	Cheng-Yi Chiang

On Thu, 7 Jan 2021 17:51:31 +0100, Stephan Gerhold wrote:
> 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
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: hdmi-codec: Fix return value in hdmi_codec_set_jack()
      commit: 2a0435df963f996ca870a2ef1cbf1773dc0ea25a

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

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

end of thread, other threads:[~2021-01-08 16:32 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:51 [PATCH v2] ASoC: hdmi-codec: Fix return value in hdmi_codec_set_jack() Stephan Gerhold
2021-01-07 20:42 ` Nicolin Chen
2021-01-08 16:29 ` Mark Brown

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.