ASoC: hdmi-codec: fix missing report for jack initial status
PATCH 1/1 ASoC: hdmi-codec: fix missing report for jack initial status
This fixes a problem introduced while fixing ELD reporting with no jack set.
Most driver using the hdmi-codec will call the 'plugged_cb' callback directly when registered to report the initial state of the HDMI connector.
With the commit mentionned, this occurs before jack is ready and the initial report is lost for platforms actually providing a jack for HDMI.
Fix this by storing the hdmi connector status regardless of jack being set or not and report the last status when jack gets set.
With this, the initial state is reported correctly even if it is disconnected. This was not done initially and is also a fix.
--- sound/soc/codecs/hdmi-codec.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
sound/soc/codecs/hdmi-codec.c +10 -2
@@ -850,8 +850,9 @@ static int hdmi_dai_probe(struct snd_soc_dai *dai)static void hdmi_codec_jack_report (struct hdmi_codec_priv *hcp,unsigned int jack_status) { -if (hcp->jack && jack_status != hcp->jack_status) { -snd_soc_jack_report (hcp->jack, jack_status,SND_JACK_LINEOUT ); +if (jack_status != hcp->jack_status) { +if (hcp->jack) +snd_soc_jack_report (hcp->jack, jack_status,SND_JACK_LINEOUT ); hcp->jack_status = jack_status; } }
@@ -880,6 +881,13 @@ static int hdmi_codec_set_jack(struct snd_soc_component *component,if (hcp->hcd.ops->hook_plugged_cb) { hcp->jack = jack; + +/* +* Report the initial jack status which may have been provided +* by the parent hdmi driver while the hpd hook was registered. +*/ +snd_soc_jack_report (jack, hcp->jack_status,SND_JACK_LINEOUT ); +return 0 ; }
Signature · 1 line
2.42.0
Mark Brown
maintainerQuoted 10 lines · Jerome Brunet
This fixes a problem introduced while fixing ELD reporting with no jack set.
Most driver using the hdmi-codec will call the '
plugged_cb' callback directly when registered to report the initial state of the HDMI connector.With the commit mentionned, this occurs before jack is ready and the initial report is lost for platforms actually providing a jack for HDMI.
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: hdmi-codec: fix missing report for jack initial status
commit: 025222a9d6d25eee2ad9a1bb5a8b29b34b5ba576
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
Quoted 66 lines · Jerome Brunet
This fixes a problem introduced while fixing ELD reporting with no jack set.
Most driver using the hdmi-codec will call the '
plugged_cb' callback directly when registered to report the initial state of the HDMI connector.With the commit mentionned, this occurs before jack is ready and the initial report is lost for platforms actually providing a jack for HDMI.
Fix this by storing the hdmi connector status regardless of jack being set or not and report the last status when jack gets set.
With this, the initial state is reported correctly even if it is disconnected. This was not done initially and is also a fix.
Fixes 15be353d55f9 ("ASoC: hdmi-codec: register hpd callback on componentprobe")
Reported-by Zhengqiao Xia <[email protected]>Cc Hsin-Yi Wang <[email protected]>Signed-off-by Jerome Brunet <[email protected]>--- sound/soc/codecs/hdmi-codec.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)sound/soc/codecs/hdmi-codec.c +3
-2@@ -850,8 +850,9 @@ static int hdmi_dai_probe(struct snd_soc_dai *dai)static void hdmi_codec_jack_report (struct hdmi_codec_priv *hcp,unsigned int jack_status) { -if (hcp->jack && jack_status != hcp->jack_status) { -snd_soc_jack_report (hcp->jack, jack_status, SND_JACK_LINEOUT); +if (jack_status != hcp->jack_status) { +if (hcp->jack) +snd_soc_jack_report (hcp->jack, jack_status,SND_JACK_LINEOUT ); hcp->jack_status = jack_status;}}
sound/soc/codecs/hdmi-codec.c +3
-0@@ -880,6 +881,13 @@ static int hdmi_codec_set_jack(struct snd_soc_component *component, if (hcp->hcd.ops->hook_plugged_cb) { hcp->jack = jack; + +/* +* Report the initial jack status which may have been provided
+ * by the parent hdmi driver while the hpd hook was
registered.sound/soc/codecs/hdmi-codec.c +2
-0+*/ + snd_soc_jack_report(jack, hcp->jack_status,
SND_JACK_LINEOUT);
+return 0; }--
2.42.0