All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: dri-devel@lists.freedesktop.org
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Subject: [PATCH v3 05/11] drm: omapdrm: hdmi: Configure the PHY from the HDMI core version
Date: Fri, 11 Aug 2017 16:49:06 +0300	[thread overview]
Message-ID: <20170811134912.6429-6-laurent.pinchart@ideasonboard.com> (raw)
In-Reply-To: <20170811134912.6429-1-laurent.pinchart@ideasonboard.com>

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>
---
 drivers/gpu/drm/omapdrm/dss/hdmi.h     |  3 ++-
 drivers/gpu/drm/omapdrm/dss/hdmi4.c    |  2 +-
 drivers/gpu/drm/omapdrm/dss/hdmi5.c    |  2 +-
 drivers/gpu/drm/omapdrm/dss/hdmi_phy.c | 23 +++++++----------------
 4 files changed, 11 insertions(+), 19 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi.h b/drivers/gpu/drm/omapdrm/dss/hdmi.h
index eef717120b33..a820b394af09 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi.h
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi.h
@@ -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 */
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4.c b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
index 4c131d710282..f169348da377 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi4.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
@@ -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;
 
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi5.c b/drivers/gpu/drm/omapdrm/dss/hdmi5.c
index a6adddeee5bb..b3221ca5bcd8 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi5.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi5.c
@@ -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;
 
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi_phy.c b/drivers/gpu/drm/omapdrm/dss/hdmi_phy.c
index bff1ea11ed2f..95770c3203a1 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi_phy.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi_phy.c
@@ -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;
 
-- 
Regards,

Laurent Pinchart

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2017-08-11 13:49 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-11 13:49 [PATCH v3 00/11] omapdrm: Remove the omapdrm and omapdss devices from platform code Laurent Pinchart
2017-08-11 13:49 ` [PATCH v3 01/11] drm: omapdrm: hdmi: Rename functions and structures to use hdmi_ prefix Laurent Pinchart
2017-08-11 13:49 ` [PATCH v3 02/11] drm: omapdrm: hdmi: Replace OMAP SoC model check with HDMI xmit version Laurent Pinchart
2017-08-11 13:49 ` [PATCH v3 03/11] drm: omapdrm: hdmi: Pass HDMI core version as integer to HDMI audio Laurent Pinchart
2017-08-11 14:38   ` Bartlomiej Zolnierkiewicz
2017-08-11 13:49 ` [PATCH v3 04/11] drm: omapdrm: hdmi: Configure the PLL from the HDMI core version Laurent Pinchart
2017-08-11 13:49 ` Laurent Pinchart [this message]
2017-08-11 13:49 ` [PATCH v3 06/11] drm: omapdrm: hdmi: Don't allocate PHY features dynamically Laurent Pinchart
2017-08-11 13:49 ` [PATCH v3 07/11] drm: omapdrm: Register omapdrm platform device in omapdss driver Laurent Pinchart
2017-08-15 12:13   ` Tomi Valkeinen
2017-08-16  9:49   ` [PATCHv2] " Tomi Valkeinen
2017-08-16 12:31     ` Laurent Pinchart
2017-09-28  8:03   ` [PATCH v3 07/11] " Tomi Valkeinen
2017-09-28  8:56     ` Laurent Pinchart
2017-09-28  9:25       ` Tomi Valkeinen
2017-08-11 13:49 ` [PATCH v3 08/11] drm: omapdrm: Remove the " Laurent Pinchart
2017-08-11 13:49 ` [PATCH v3 09/11] ARM: OMAP2+: Remove unused omapdrm platform device Laurent Pinchart
2017-08-11 13:49 ` [PATCH v3 10/11] ARM: OMAP2+: Don't register omapdss device for omapdrm Laurent Pinchart
2017-08-11 13:49 ` [PATCH v3 11/11] drm: omapdrm: Remove omapdrm platform data Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170811134912.6429-6-laurent.pinchart@ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=tomi.valkeinen@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.