This code can be reused for HDMI, so extract it into a reusable function. Signed-off-by: Thierry Reding <treding@nvidia.com>