alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] ASoC: hdmi-codec: Get ELD in before reporting plugged event
@ 2020-11-18  4:38 Cheng-Yi Chiang
  2020-11-23 20:38 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Cheng-Yi Chiang @ 2020-11-18  4:38 UTC (permalink / raw)
  To: linux-kernel
  Cc: alsa-devel, dianders, Srinivasa Rao, Heiko Stuebner,
	Takashi Iwai, Rob Herring, Liam Girdwood, linux-rockchip,
	Mark Brown, Rohit kumar, tzungbi, Matthias Brugger,
	linux-mediatek, dgreid, judyhsiao, linux-arm-kernel,
	Cheng-Yi Chiang

In plugged callback, ELD should be updated from display driver so that
user space can query information from ELD immediately after receiving jack
plugged event.

When jack is unplugged, clear ELD buffer so that user space does not get
obsolete information of unplugged HDMI.

Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
---
Change from v1 to v2:
 - Report jack unplug event then clear ELD. This makes sure user will not get a
   cleared ELD during their usage of jack.

 sound/soc/codecs/hdmi-codec.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c
index 403d4c6a49a8..e8410b2433de 100644
--- a/sound/soc/codecs/hdmi-codec.c
+++ b/sound/soc/codecs/hdmi-codec.c
@@ -692,10 +692,16 @@ static void plugged_cb(struct device *dev, bool plugged)
 {
 	struct hdmi_codec_priv *hcp = dev_get_drvdata(dev);
 
-	if (plugged)
+	if (plugged) {
+		if (hcp->hcd.ops->get_eld) {
+			hcp->hcd.ops->get_eld(dev->parent, hcp->hcd.data,
+					    hcp->eld, sizeof(hcp->eld));
+		}
 		hdmi_codec_jack_report(hcp, SND_JACK_LINEOUT);
-	else
+	} else {
 		hdmi_codec_jack_report(hcp, 0);
+		memset(hcp->eld, 0, sizeof(hcp->eld));
+	}
 }
 
 static int hdmi_codec_set_jack(struct snd_soc_component *component,
-- 
2.29.2.299.gdc1121823c-goog


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

* Re: [PATCH v2] ASoC: hdmi-codec: Get ELD in before reporting plugged event
  2020-11-18  4:38 [PATCH v2] ASoC: hdmi-codec: Get ELD in before reporting plugged event Cheng-Yi Chiang
@ 2020-11-23 20:38 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2020-11-23 20:38 UTC (permalink / raw)
  To: linux-kernel, Cheng-Yi Chiang
  Cc: alsa-devel, dianders, Srinivasa Rao, Heiko Stuebner,
	Takashi Iwai, tzungbi, Liam Girdwood, linux-rockchip,
	Rob Herring, Rohit kumar, Matthias Brugger, linux-mediatek,
	dgreid, judyhsiao, linux-arm-kernel

On Wed, 18 Nov 2020 12:38:52 +0800, Cheng-Yi Chiang wrote:
> In plugged callback, ELD should be updated from display driver so that
> user space can query information from ELD immediately after receiving jack
> plugged event.
> 
> When jack is unplugged, clear ELD buffer so that user space does not get
> obsolete information of unplugged HDMI.

Applied to

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

Thanks!

[1/1] ASoC: hdmi-codec: Get ELD in before reporting plugged event
      commit: 25ce4f2b3593fa6bba70ddabbd2ee297b262784f

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] 2+ messages in thread

end of thread, other threads:[~2020-11-23 20:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-18  4:38 [PATCH v2] ASoC: hdmi-codec: Get ELD in before reporting plugged event Cheng-Yi Chiang
2020-11-23 20:38 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).