All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/bridge: synopsys/dw-hdmi: set cec clock rate
@ 2022-01-26 20:24 ` Peter Geis
  0 siblings, 0 replies; 27+ messages in thread
From: Peter Geis @ 2022-01-26 20:24 UTC (permalink / raw)
  To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, David Airlie, Daniel Vetter,
	Pierre-Hugues Husson, Archit Taneja
  Cc: Peter Geis, Sascha Hauer, Robin Murphy, linux-rockchip,
	Heiko Stübner, dri-devel, linux-kernel

The hdmi-cec clock must be 32khz in order for cec to work correctly.
Ensure after enabling the clock we set it in order for the hardware to
work as expected.
Warn on failure, in case this is a static clock that is slighty off.
Fixes hdmi-cec support on Rockchip devices.

Fixes: ebe32c3e282a ("drm/bridge: synopsys/dw-hdmi: Enable cec clock")

Signed-off-by: Peter Geis <pgwipeout@gmail.com>
---
 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index 54d8fdad395f..1a96da60e357 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -48,6 +48,9 @@
 
 #define HDMI14_MAX_TMDSCLK	340000000
 
+/* HDMI CEC needs a clock rate of 32khz */
+#define HDMI_CEC_CLK_RATE	32768
+
 enum hdmi_datamap {
 	RGB444_8B = 0x01,
 	RGB444_10B = 0x03,
@@ -3347,6 +3350,10 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev,
 				ret);
 			goto err_iahb;
 		}
+
+		ret = clk_set_rate(hdmi->cec_clk, HDMI_CEC_CLK_RATE);
+		if (ret)
+			dev_warn(hdmi->dev, "Cannot set HDMI cec clock rate: %d\n", ret);
 	}
 
 	/* Product and revision IDs */
-- 
2.25.1


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

end of thread, other threads:[~2022-03-14 16:37 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-26 20:24 [PATCH] drm/bridge: synopsys/dw-hdmi: set cec clock rate Peter Geis
2022-01-26 20:24 ` Peter Geis
2022-01-26 20:24 ` Peter Geis
2022-01-26 20:32 ` Fabio Estevam
2022-01-26 20:32   ` Fabio Estevam
2022-01-26 20:32   ` Fabio Estevam
2022-01-27  9:33 ` Sascha Hauer
2022-01-27  9:33   ` Sascha Hauer
2022-01-27  9:33   ` Sascha Hauer
2022-01-28 19:03   ` Peter Geis
2022-01-28 19:03     ` Peter Geis
2022-01-28 19:03     ` Peter Geis
2022-03-13 10:12 ` Piotr Oniszczuk
2022-03-13 10:12   ` Piotr Oniszczuk
2022-03-13 10:12   ` Piotr Oniszczuk
2022-03-13 12:56   ` Peter Geis
2022-03-13 12:56     ` Peter Geis
2022-03-13 12:56     ` Peter Geis
2022-03-13 16:14     ` Piotr Oniszczuk
2022-03-13 16:14       ` Piotr Oniszczuk
2022-03-13 16:14       ` Piotr Oniszczuk
2022-03-14 11:31     ` Robin Murphy
2022-03-14 11:31       ` Robin Murphy
2022-03-14 11:31       ` Robin Murphy
2022-03-14 16:34       ` Robin Murphy
2022-03-14 16:34         ` Robin Murphy
2022-03-14 16:34         ` Robin Murphy

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.