]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/rockchip: inno_hdmi: Switch to infoframe type
authorMaxime Ripard <mripard@kernel.org>
Fri, 22 Dec 2023 17:42:06 +0000 (18:42 +0100)
committerHeiko Stuebner <heiko@sntech.de>
Fri, 29 Dec 2023 23:38:24 +0000 (00:38 +0100)
The inno_hdmi driver relies on its own internal infoframe type matching
the hardware.

This works fine, but in order to make further reworks easier, let's
switch to the HDMI spec definition of those types.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
Tested-by: Alex Bee <knaerzche@gmail.com>
Signed-off-by: Alex Bee <knaerzche@gmail.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20231222174220.55249-16-knaerzche@gmail.com
drivers/gpu/drm/rockchip/inno_hdmi.c

index 90a163029773c676e1efddca72ab39172d2c80a5..bec91a14965bac7524a14ab678f938f4543d13c5 100644 (file)
@@ -204,33 +204,34 @@ static void inno_hdmi_reset(struct inno_hdmi *hdmi)
        inno_hdmi_set_pwr_mode(hdmi, NORMAL);
 }
 
-static void inno_hdmi_disable_frame(struct inno_hdmi *hdmi, u32 frame_index)
+static void inno_hdmi_disable_frame(struct inno_hdmi *hdmi,
+                                   enum hdmi_infoframe_type type)
 {
        struct drm_connector *connector = &hdmi->connector;
 
-       if (frame_index != INFOFRAME_AVI) {
+       if (type != HDMI_INFOFRAME_TYPE_AVI) {
                drm_err(connector->dev,
-                       "Unsupported infoframe type: %u\n", frame_index);
+                       "Unsupported infoframe type: %u\n", type);
                return;
        }
 
-       hdmi_writeb(hdmi, HDMI_CONTROL_PACKET_BUF_INDEX, frame_index);
+       hdmi_writeb(hdmi, HDMI_CONTROL_PACKET_BUF_INDEX, INFOFRAME_AVI);
 }
 
 static int inno_hdmi_upload_frame(struct inno_hdmi *hdmi,
-                                 union hdmi_infoframe *frame, u32 frame_index)
+                                 union hdmi_infoframe *frame, enum hdmi_infoframe_type type)
 {
        struct drm_connector *connector = &hdmi->connector;
        u8 packed_frame[HDMI_MAXIMUM_INFO_FRAME_SIZE];
        ssize_t rc, i;
 
-       if (frame_index != INFOFRAME_AVI) {
+       if (type != HDMI_INFOFRAME_TYPE_AVI) {
                drm_err(connector->dev,
-                       "Unsupported infoframe type: %u\n", frame_index);
+                       "Unsupported infoframe type: %u\n", type);
                return 0;
        }
 
-       inno_hdmi_disable_frame(hdmi, frame_index);
+       inno_hdmi_disable_frame(hdmi, type);
 
        rc = hdmi_infoframe_pack(frame, packed_frame,
                                 sizeof(packed_frame));
@@ -254,7 +255,7 @@ static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi,
                                                      &hdmi->connector,
                                                      mode);
        if (rc) {
-               inno_hdmi_disable_frame(hdmi, INFOFRAME_AVI);
+               inno_hdmi_disable_frame(hdmi, HDMI_INFOFRAME_TYPE_AVI);
                return rc;
        }
 
@@ -265,7 +266,7 @@ static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi,
        else
                frame.avi.colorspace = HDMI_COLORSPACE_RGB;
 
-       return inno_hdmi_upload_frame(hdmi, &frame, INFOFRAME_AVI);
+       return inno_hdmi_upload_frame(hdmi, &frame, HDMI_INFOFRAME_TYPE_AVI);
 }
 
 static int inno_hdmi_config_video_csc(struct inno_hdmi *hdmi)