Skip to content

Commit 264d8c9

Browse files
jbrun3tgregkh
authored andcommitted
ASoC: hdmi-codec: fix missing report for jack initial status
[ Upstream commit 025222a ] 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: 15be353 ("ASoC: hdmi-codec: register hpd callback on component probe") Reported-by: Zhengqiao Xia <xiazhengqiao@huaqin.corp-partner.google.com> Closes: https://lore.kernel.org/alsa-devel/CADYyEwTNyY+fR9SgfDa-g6iiDwkU3MUdPVCYexs2_3wbcM8_vg@mail.gmail.com/ Cc: Hsin-Yi Wang <hsinyi@google.com> Tested-by: Zhengqiao Xia <xiazhengqiao@huaqin.corp-partner.google.com> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> Link: https://msgid.link/r/20231218145655.134929-1-jbrunet@baylibre.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 9b4c95a commit 264d8c9

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

sound/soc/codecs/hdmi-codec.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -834,8 +834,9 @@ static int hdmi_dai_probe(struct snd_soc_dai *dai)
834834
static void hdmi_codec_jack_report(struct hdmi_codec_priv *hcp,
835835
unsigned int jack_status)
836836
{
837-
if (hcp->jack && jack_status != hcp->jack_status) {
838-
snd_soc_jack_report(hcp->jack, jack_status, SND_JACK_LINEOUT);
837+
if (jack_status != hcp->jack_status) {
838+
if (hcp->jack)
839+
snd_soc_jack_report(hcp->jack, jack_status, SND_JACK_LINEOUT);
839840
hcp->jack_status = jack_status;
840841
}
841842
}
@@ -864,6 +865,13 @@ static int hdmi_codec_set_jack(struct snd_soc_component *component,
864865

865866
if (hcp->hcd.ops->hook_plugged_cb) {
866867
hcp->jack = jack;
868+
869+
/*
870+
* Report the initial jack status which may have been provided
871+
* by the parent hdmi driver while the hpd hook was registered.
872+
*/
873+
snd_soc_jack_report(jack, hcp->jack_status, SND_JACK_LINEOUT);
874+
867875
return 0;
868876
}
869877

0 commit comments

Comments
 (0)