ASoC: hdmi-codec: Fix return value in hdmi_codec_set_jack()
PATCH 1/1 ASoC: hdmi-codec: Fix return value in hdmi_codec_set_jack()
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.
--- sound/soc/codecs/hdmi-codec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/hdmi-codec.c +1 -1
@@ -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;
Signature · 1 line
2.30.0
Mark Brown
maintainerQuoted 3 lines · Stephan Gerhold
However,
hdmi_codec_set_jack()returns -E*OP*NOTSUPP if jack detection is not supported, which is not handled inapq8016_sbcandsoc_component_ret(). Make it return-ENOTSUPPinstead 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.
Quoted 9 lines · Mark Brown
Quoted 3 lines · Stephan Gerhold
However,
hdmi_codec_set_jack()returns -E*OP*NOTSUPP if jack detection is not supported, which is not handled inapq8016_sbcandsoc_component_ret(). Make it return-ENOTSUPPinstead to fix sound and silence the errors.You will also need to update imx-hdmi, it is explicitly checking for
-EOPNOTSUPPso 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