drm: omapdrm: hdmi: Configure the PHY from the HDMI core version
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Fri, 11 Aug 2017 13:49:06 +0000 (16:49 +0300)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Wed, 16 Aug 2017 09:52:42 +0000 (12:52 +0300)
The OMAP4 and OMAP5 HDMI PHYs have different properties that require
specific handling in the HDMI PHY driver. This needs knowledge of the
PHY version, which is currently inferred from the DSS version. As part
of the effort to remove usage of the DSS version, use the HDMI
controller version instead.

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_phy.c

index eef717120b331a38fc92b1c24418d3e912f30e96..a820b394af0914719a2983b76868bdd6b6b59ea9 100644 (file)
@@ -327,7 +327,8 @@ void hdmi_pll_uninit(struct hdmi_pll_data *hpll);
 int hdmi_phy_configure(struct hdmi_phy_data *phy, unsigned long hfbitclk,
        unsigned long lfbitclk);
 void hdmi_phy_dump(struct hdmi_phy_data *phy, struct seq_file *s);
-int hdmi_phy_init(struct platform_device *pdev, struct hdmi_phy_data *phy);
+int hdmi_phy_init(struct platform_device *pdev, struct hdmi_phy_data *phy,
+                 unsigned int version);
 int hdmi_phy_parse_lanes(struct hdmi_phy_data *phy, const u32 *lanes);
 
 /* HDMI common funcs */
index 4c131d7102829dc8e76e8c70e33f0807a17b3d8a..f169348da377ed2798cd604c443ad37f79921470 100644 (file)
@@ -707,7 +707,7 @@ static int hdmi4_bind(struct device *dev, struct device *master, void *data)
        if (r)
                return r;
 
-       r = hdmi_phy_init(pdev, &hdmi.phy);
+       r = hdmi_phy_init(pdev, &hdmi.phy, 4);
        if (r)
                goto err;
 
index a6adddeee5bbc360033fc58ae597e61b4e297799..b3221ca5bcd8413852ea1f0df3570adcb6d14337 100644 (file)
@@ -739,7 +739,7 @@ static int hdmi5_bind(struct device *dev, struct device *master, void *data)
        if (r)
                return r;
 
-       r = hdmi_phy_init(pdev, &hdmi.phy);
+       r = hdmi_phy_init(pdev, &hdmi.phy, 5);
        if (r)
                goto err;
 
index bff1ea11ed2f6a88d163cacb4c9e0f7dc61b6b72..95770c3203a1e42f8a1916c9e0cd03941640d9d8 100644 (file)
@@ -183,7 +183,8 @@ static const struct hdmi_phy_features omap54xx_phy_feats = {
 };
 
 static int hdmi_phy_init_features(struct platform_device *pdev,
-                                 struct hdmi_phy_data *phy)
+                                 struct hdmi_phy_data *phy,
+                                 unsigned int version)
 {
        struct hdmi_phy_features *dst;
        const struct hdmi_phy_features *src;
@@ -194,21 +195,10 @@ static int hdmi_phy_init_features(struct platform_device *pdev,
                return -ENOMEM;
        }
 
-       switch (omapdss_get_version()) {
-       case OMAPDSS_VER_OMAP4430_ES1:
-       case OMAPDSS_VER_OMAP4430_ES2:
-       case OMAPDSS_VER_OMAP4:
+       if (version == 4)
                src = &omap44xx_phy_feats;
-               break;
-
-       case OMAPDSS_VER_OMAP5:
-       case OMAPDSS_VER_DRA7xx:
+       else
                src = &omap54xx_phy_feats;
-               break;
-
-       default:
-               return -ENODEV;
-       }
 
        memcpy(dst, src, sizeof(*dst));
        phy->features = dst;
@@ -216,12 +206,13 @@ static int hdmi_phy_init_features(struct platform_device *pdev,
        return 0;
 }
 
-int hdmi_phy_init(struct platform_device *pdev, struct hdmi_phy_data *phy)
+int hdmi_phy_init(struct platform_device *pdev, struct hdmi_phy_data *phy,
+                 unsigned int version)
 {
        int r;
        struct resource *res;
 
-       r = hdmi_phy_init_features(pdev, phy);
+       r = hdmi_phy_init_features(pdev, phy, version);
        if (r)
                return r;