]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
drm: omapdrm: hdmi: Replace OMAP SoC model check with HDMI xmit version
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Fri, 11 Aug 2017 13:49:03 +0000 (16:49 +0300)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Wed, 16 Aug 2017 09:52:41 +0000 (12:52 +0300)
The HDMI wrapper code only needs to differentiate between major OMAP
revisions, which can be obtained from the HDMI transmitter compatible
string. Replace the OMAP SoC model checks to prepare for removal of the
OMAP SoC version platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/gpu/drm/omapdrm/dss/hdmi.h
drivers/gpu/drm/omapdrm/dss/hdmi4.c
drivers/gpu/drm/omapdrm/dss/hdmi5.c
drivers/gpu/drm/omapdrm/dss/hdmi_wp.c

index 3738a5b397d9e779447cd9087aeab7cf51db23a8..eef717120b331a38fc92b1c24418d3e912f30e96 100644 (file)
@@ -234,6 +234,7 @@ struct hdmi_core_audio_config {
 struct hdmi_wp_data {
        void __iomem *base;
        phys_addr_t phys_base;
+       unsigned int version;
 };
 
 struct hdmi_pll_data {
@@ -312,7 +313,8 @@ void hdmi_wp_video_config_timing(struct hdmi_wp_data *wp,
                struct videomode *vm);
 void hdmi_wp_init_vid_fmt_timings(struct hdmi_video_format *video_fmt,
                struct videomode *vm, struct hdmi_config *param);
-int hdmi_wp_init(struct platform_device *pdev, struct hdmi_wp_data *wp);
+int hdmi_wp_init(struct platform_device *pdev, struct hdmi_wp_data *wp,
+                unsigned int version);
 phys_addr_t hdmi_wp_get_audio_dma_addr(struct hdmi_wp_data *wp);
 
 /* HDMI PLL funcs */
index 2a99b11c8b5e5afab1ff5daab3f55247fea82465..438f47d8ab69e66158a7b7fcf5dfa8432ec95e48 100644 (file)
@@ -699,7 +699,7 @@ static int hdmi4_bind(struct device *dev, struct device *master, void *data)
        if (r)
                return r;
 
-       r = hdmi_wp_init(pdev, &hdmi.wp);
+       r = hdmi_wp_init(pdev, &hdmi.wp, 4);
        if (r)
                return r;
 
index 5f5b0a06800d0b049b5f11b15983f7512b4696a6..8ab76b50662aa37ee13994c6892f5266a21e55fa 100644 (file)
@@ -731,7 +731,7 @@ static int hdmi5_bind(struct device *dev, struct device *master, void *data)
        if (r)
                return r;
 
-       r = hdmi_wp_init(pdev, &hdmi.wp);
+       r = hdmi_wp_init(pdev, &hdmi.wp, 5);
        if (r)
                return r;
 
index ab129df2e310568c744ca34acd5c7cb2886183da..88034fbe0e9f05402804af57382feee52ed373ad 100644 (file)
@@ -178,9 +178,7 @@ void hdmi_wp_video_config_timing(struct hdmi_wp_data *wp,
         * However, we don't support OMAP5 ES1 at all, so we can just check for
         * OMAP4 here.
         */
-       if (omapdss_get_version() == OMAPDSS_VER_OMAP4430_ES1 ||
-           omapdss_get_version() == OMAPDSS_VER_OMAP4430_ES2 ||
-           omapdss_get_version() == OMAPDSS_VER_OMAP4)
+       if (wp->version == 4)
                hsync_len_offset = 0;
 
        timing_h |= FLD_VAL(vm->hback_porch, 31, 20);
@@ -235,9 +233,7 @@ void hdmi_wp_audio_config_format(struct hdmi_wp_data *wp,
        DSSDBG("Enter hdmi_wp_audio_config_format\n");
 
        r = hdmi_read_reg(wp->base, HDMI_WP_AUDIO_CFG);
-       if (omapdss_get_version() == OMAPDSS_VER_OMAP4430_ES1 ||
-           omapdss_get_version() == OMAPDSS_VER_OMAP4430_ES2 ||
-           omapdss_get_version() == OMAPDSS_VER_OMAP4) {
+       if (wp->version == 4) {
                r = FLD_MOD(r, aud_fmt->stereo_channels, 26, 24);
                r = FLD_MOD(r, aud_fmt->active_chnnls_msk, 23, 16);
        }
@@ -282,7 +278,8 @@ int hdmi_wp_audio_core_req_enable(struct hdmi_wp_data *wp, bool enable)
        return 0;
 }
 
-int hdmi_wp_init(struct platform_device *pdev, struct hdmi_wp_data *wp)
+int hdmi_wp_init(struct platform_device *pdev, struct hdmi_wp_data *wp,
+                unsigned int version)
 {
        struct resource *res;
 
@@ -292,6 +289,7 @@ int hdmi_wp_init(struct platform_device *pdev, struct hdmi_wp_data *wp)
                return PTR_ERR(wp->base);
 
        wp->phys_base = res->start;
+       wp->version = version;
 
        return 0;
 }