HDMI standards define a recommended set of values to be used for Audio Clock Regeneration. Nevertheless, each HDMI driver dealing with audio implements its own way to determine those values. Implement a common helper and use it for MSM HDMI (tested), VC4 and DW-HDMI (compile-tested only) drivers.
Note, this helper simply implements the database for these values (HDMI Section 7.2). The question of selecting supported formats and rates should be handled by sound/soc/codecs/hdmi-codec.c (pretty much like it is handled by sound/pci/hda/patch_hdmi.c). Signed-off-by: Dmitry Baryshkov <dmitry.barysh...@oss.qualcomm.com> --- Changes in v2: - Added missing EXPORT_SYMBOL(drm_hdmi_acr_get_n_cts) (LKP) - Extended documentation to explicitly mention L-PCM (Maxime) - Dropped VC4 and rockchip patchets as I'm not able to test them. - Link to v1: https://lore.kernel.org/r/20250309-drm-hdmi-acr-v1-0-bb9c242f4...@linaro.org --- Dmitry Baryshkov (3): drm/display: hdmi: provide central data authority for ACR params drm/msm/hdmi: move msm_hdmi_audio_update() out of msm_hdmi_set_timings() drm/msm/hdmi: use new helper for ACR tables drivers/gpu/drm/display/drm_hdmi_helper.c | 168 ++++++++++++++++++++++++++++++ drivers/gpu/drm/msm/hdmi/hdmi_audio.c | 107 ++----------------- drivers/gpu/drm/msm/hdmi/hdmi_bridge.c | 8 +- include/drm/display/drm_hdmi_helper.h | 6 ++ 4 files changed, 186 insertions(+), 103 deletions(-) --- base-commit: 2bdde620f7f2bff2ff1cb7dc166859eaa0c78a7c change-id: 20250308-drm-hdmi-acr-7ad1f0d012df Best regards, -- Dmitry Baryshkov <dmitry.barysh...@oss.qualcomm.com>