drm/vc4: hdmi: Compute the CEC clock divider from the clock rate
authorMaxime Ripard <maxime@cerno.tech>
Mon, 11 Jan 2021 14:23:00 +0000 (15:23 +0100)
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Tue, 9 Feb 2021 16:14:10 +0000 (17:14 +0100)
commit163a3ef681e5e9d5df558e855d86ccd4708d6200
tree6c75fc9f599947fd143cc897a0bb711df45ba7ab
parent4d8602b8ec16f5721a4d1339c610a81f95df1856
drm/vc4: hdmi: Compute the CEC clock divider from the clock rate

The CEC clock divider needs to output a frequency of 40kHz from the HSM
rate on the BCM2835. The driver used to have a fixed frequency for it,
but that changed for the BCM2711 and we now need to compute it
dynamically to maintain the proper rate.

Fixes: cd4cb49dc5bb ("drm/vc4: hdmi: Adjust HSM clock rate depending on pixel rate")
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Tested-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Link: https://patchwork.freedesktop.org/patch/msgid/20210111142309.193441-7-maxime@cerno.tech
(cherry picked from commit f1ceb9d10043683b89e5e5e5848fb4e855295762)
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
drivers/gpu/drm/vc4/vc4_hdmi.c