diff mbox

[PATCH/RFC,3/7] drm: omapdrm: Retrieve OMAP revision from omapdss

Message ID 1481672306-22564-4-git-send-email-laurent.pinchart@ideasonboard.com (mailing list archive)
State New, archived
Headers show

Commit Message

Laurent Pinchart Dec. 13, 2016, 11:38 p.m. UTC
The OMAP revision is currently passed through omapdrm platform data. To
prepare for removal of omapdrm platform data, get it from the omapdss.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/gpu/drm/omapdrm/dss/core.c    | 8 ++++++++
 drivers/gpu/drm/omapdrm/dss/omapdss.h | 1 +
 drivers/gpu/drm/omapdrm/omap_drv.c    | 3 +--
 drivers/gpu/drm/omapdrm/omap_drv.h    | 1 -
 4 files changed, 10 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/drivers/gpu/drm/omapdrm/dss/core.c b/drivers/gpu/drm/omapdrm/dss/core.c
index 6a3ebfcd7223..1bf978b5c5bc 100644
--- a/drivers/gpu/drm/omapdrm/dss/core.c
+++ b/drivers/gpu/drm/omapdrm/dss/core.c
@@ -62,6 +62,14 @@  enum omapdss_version omapdss_get_version(void)
 }
 EXPORT_SYMBOL(omapdss_get_version);
 
+u32 omapdss_get_omaprev(void)
+{
+	struct omap_dss_board_info *pdata = core.pdev->dev.platform_data;
+
+	return pdata->omaprev;
+}
+EXPORT_SYMBOL(omapdss_get_omaprev);
+
 struct platform_device *dss_get_core_pdev(void)
 {
 	return core.pdev;
diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h
index b420dde8c0fb..6c2553b56971 100644
--- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
+++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
@@ -767,6 +767,7 @@  struct omap_dss_driver {
 };
 
 enum omapdss_version omapdss_get_version(void);
+u32 omapdss_get_omaprev(void);
 bool omapdss_is_initialized(void);
 
 int omap_dss_register_driver(struct omap_dss_driver *);
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index a3b37823b271..0e54e3c9c291 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -743,7 +743,6 @@  static struct drm_driver omap_drm_driver = {
 
 static int pdev_probe(struct platform_device *pdev)
 {
-	struct omap_drm_platform_data *pdata = pdev->dev.platform_data;
 	struct omap_drm_private *priv;
 	struct drm_device *ddev;
 	unsigned int i;
@@ -769,7 +768,7 @@  static int pdev_probe(struct platform_device *pdev)
 		goto err_disconnect_dssdevs;
 	}
 
-	priv->omaprev = pdata->omaprev;
+	priv->omaprev = omapdss_get_omaprev();
 	priv->wq = alloc_ordered_workqueue("omapdrm", 0);
 
 	init_waitqueue_head(&priv->commit.wait);
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.h b/drivers/gpu/drm/omapdrm/omap_drv.h
index b20377efd01b..2c9ddcec1449 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.h
+++ b/drivers/gpu/drm/omapdrm/omap_drv.h
@@ -21,7 +21,6 @@ 
 #define __OMAP_DRV_H__
 
 #include <linux/module.h>
-#include <linux/platform_data/omap_drm.h>
 #include <linux/types.h>
 #include <linux/wait.h>