All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH/RFC 0/7] Remove the omapdrm device from platform code
@ 2016-12-13 23:38 Laurent Pinchart
  2016-12-13 23:38 ` [PATCH/RFC 1/7] drm: omapdrm: Add OMAP revision to omapdss platform data Laurent Pinchart
                   ` (8 more replies)
  0 siblings, 9 replies; 20+ messages in thread
From: Laurent Pinchart @ 2016-12-13 23:38 UTC (permalink / raw)
  To: dri-devel; +Cc: Tomi Valkeinen, linux-omap

Hello,

The omapdss/omapdrm initialization code is quite a mess. The physical devices
are instantiated from DT, but two virtual devices named omapdrm and omapdss
are instanciated from platform code to pass various pieces of platform data to
the drivers.

The omapdrm and omapdss platform devices should eventually be removed. That
will require non-trivial work to implement the features provided by platform
data in a pure DT architecture without platform code.

This patch series starts by focussing on the omapdrm device. It moves all its
platform data to the omapdss device, to finally remove the omapdrm device
completely from platform code.

Doing so involves registering the omapdrm platform device from within the
omapdss driver. This is a hack, but isn't worse than the current situation.
Quite the contrary, given that the omapdrm device exists for the sole purpose
of supporting the omapdrm/omapdss driver architecture, moving it out of
platform code can be considered as (slightly) cleaner. In any case, it will be
easier to refactor the code as everything is now isolated on the driver side.

The series will be annoying to merge given how interleaved the ARM and driver
patches are. The easiest solution would be to merge everything through the ARM
tree (as the risk of conflict on the DRM side is low), in which case some 
patches could be squashed together if desired (especially the last two that
wouldn't require renaming the driver internally anymore).

Laurent Pinchart (7):
  drm: omapdrm: Add OMAP revision to omapdss platform data
  ARM: OMAP2+: Populate the omapdss platform data OMAP revision
  drm: omapdrm: Retrieve OMAP revision from omapdss
  ARM: OMAP2+: Remove omapdrm platform data
  drm: omapdrm: Remove omapdrm platform data
  drm: omapdrm: Register omapdrm platform device in omapdss driver
  ARM: OMAP2+: Remove unused omapdrm platform device

 arch/arm/mach-omap2/Makefile           |  2 +-
 arch/arm/mach-omap2/display.c          |  8 +----
 arch/arm/mach-omap2/display.h          |  1 -
 arch/arm/mach-omap2/drm.c              | 53 ----------------------------------
 drivers/gpu/drm/omapdrm/dss/core.c     | 25 ++++++++++++++++
 drivers/gpu/drm/omapdrm/dss/omapdss.h  |  1 +
 drivers/gpu/drm/omapdrm/omap_drv.c     |  5 ++--
 drivers/gpu/drm/omapdrm/omap_drv.h     |  1 -
 include/linux/platform_data/omap_drm.h | 53 ----------------------------------
 include/linux/platform_data/omapdss.h  |  1 +
 10 files changed, 31 insertions(+), 119 deletions(-)
 delete mode 100644 arch/arm/mach-omap2/drm.c
 delete mode 100644 include/linux/platform_data/omap_drm.h

-- 
Regards,

Laurent Pinchart

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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH/RFC 1/7] drm: omapdrm: Add OMAP revision to omapdss platform data
  2016-12-13 23:38 [PATCH/RFC 0/7] Remove the omapdrm device from platform code Laurent Pinchart
@ 2016-12-13 23:38 ` Laurent Pinchart
  2016-12-13 23:38 ` [PATCH/RFC 2/7] ARM: OMAP2+: Populate the omapdss platform data OMAP revision Laurent Pinchart
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 20+ messages in thread
From: Laurent Pinchart @ 2016-12-13 23:38 UTC (permalink / raw)
  To: dri-devel; +Cc: Tomi Valkeinen, linux-omap

The revision is passed from platform code to the omapdrm driver through
the omapdrm platform device's platform data. This is the last reason to
create a virtual omapdrm platform device that we have otherwise no need
for. By passing the revision through the omapdss platform data we will
be able to remote the omapdrm device.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 include/linux/platform_data/omapdss.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/linux/platform_data/omapdss.h b/include/linux/platform_data/omapdss.h
index 679177929045..e71bb1d1b7ba 100644
--- a/include/linux/platform_data/omapdss.h
+++ b/include/linux/platform_data/omapdss.h
@@ -32,6 +32,7 @@ struct omap_dss_board_info {
 	void (*dsi_disable_pads)(int dsi_id, unsigned int lane_mask);
 	int (*set_min_bus_tput)(struct device *dev, unsigned long r);
 	enum omapdss_version version;
+	u32 omaprev;
 };
 
 #endif /* __OMAPDSS_PDATA_H */
-- 
Regards,

Laurent Pinchart

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

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH/RFC 2/7] ARM: OMAP2+: Populate the omapdss platform data OMAP revision
  2016-12-13 23:38 [PATCH/RFC 0/7] Remove the omapdrm device from platform code Laurent Pinchart
  2016-12-13 23:38 ` [PATCH/RFC 1/7] drm: omapdrm: Add OMAP revision to omapdss platform data Laurent Pinchart
@ 2016-12-13 23:38 ` Laurent Pinchart
  2016-12-13 23:38 ` [PATCH/RFC 3/7] drm: omapdrm: Retrieve OMAP revision from omapdss Laurent Pinchart
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 20+ messages in thread
From: Laurent Pinchart @ 2016-12-13 23:38 UTC (permalink / raw)
  To: dri-devel; +Cc: Tomi Valkeinen, linux-omap

The omapdss platform data OMAP revision field will be used by the
omapdss driver, populate it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 arch/arm/mach-omap2/display.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index 8fa01c0ecdb2..686cd22a4373 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -375,6 +375,7 @@ int __init omapdss_init_of(void)
 	}
 
 	board_data.version = ver;
+	board_data.omaprev = GET_OMAP_TYPE;
 
 	omap_display_device.dev.platform_data = &board_data;
 
-- 
Regards,

Laurent Pinchart

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

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH/RFC 3/7] drm: omapdrm: Retrieve OMAP revision from omapdss
  2016-12-13 23:38 [PATCH/RFC 0/7] Remove the omapdrm device from platform code Laurent Pinchart
  2016-12-13 23:38 ` [PATCH/RFC 1/7] drm: omapdrm: Add OMAP revision to omapdss platform data Laurent Pinchart
  2016-12-13 23:38 ` [PATCH/RFC 2/7] ARM: OMAP2+: Populate the omapdss platform data OMAP revision Laurent Pinchart
@ 2016-12-13 23:38 ` Laurent Pinchart
  2016-12-13 23:38 ` [PATCH/RFC 4/7] ARM: OMAP2+: Remove omapdrm platform data Laurent Pinchart
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 20+ messages in thread
From: Laurent Pinchart @ 2016-12-13 23:38 UTC (permalink / raw)
  To: dri-devel; +Cc: Tomi Valkeinen, linux-omap

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 --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>
 
-- 
Regards,

Laurent Pinchart

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

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH/RFC 4/7] ARM: OMAP2+: Remove omapdrm platform data
  2016-12-13 23:38 [PATCH/RFC 0/7] Remove the omapdrm device from platform code Laurent Pinchart
                   ` (2 preceding siblings ...)
  2016-12-13 23:38 ` [PATCH/RFC 3/7] drm: omapdrm: Retrieve OMAP revision from omapdss Laurent Pinchart
@ 2016-12-13 23:38 ` Laurent Pinchart
  2016-12-13 23:38 ` [PATCH/RFC 5/7] drm: omapdrm: " Laurent Pinchart
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 20+ messages in thread
From: Laurent Pinchart @ 2016-12-13 23:38 UTC (permalink / raw)
  To: dri-devel; +Cc: Tomi Valkeinen, linux-omap

The omapdrm platform data isn't used anymore, remove it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 arch/arm/mach-omap2/drm.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/arch/arm/mach-omap2/drm.c b/arch/arm/mach-omap2/drm.c
index 44fef961bb70..06fd40c92b96 100644
--- a/arch/arm/mach-omap2/drm.c
+++ b/arch/arm/mach-omap2/drm.c
@@ -23,19 +23,15 @@
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/dma-mapping.h>
-#include <linux/platform_data/omap_drm.h>
 
 #include "soc.h"
 #include "display.h"
 
 #if IS_ENABLED(CONFIG_DRM_OMAP)
 
-static struct omap_drm_platform_data platform_data;
-
 static struct platform_device omap_drm_device = {
 	.dev = {
 		.coherent_dma_mask = DMA_BIT_MASK(32),
-		.platform_data = &platform_data,
 	},
 	.name = "omapdrm",
 	.id = 0,
@@ -43,10 +39,7 @@ static struct platform_device omap_drm_device = {
 
 int __init omap_init_drm(void)
 {
-	platform_data.omaprev = GET_OMAP_TYPE;
-
 	return platform_device_register(&omap_drm_device);
-
 }
 #else
 int __init omap_init_drm(void) { return 0; }
-- 
Regards,

Laurent Pinchart

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

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH/RFC 5/7] drm: omapdrm: Remove omapdrm platform data
  2016-12-13 23:38 [PATCH/RFC 0/7] Remove the omapdrm device from platform code Laurent Pinchart
                   ` (3 preceding siblings ...)
  2016-12-13 23:38 ` [PATCH/RFC 4/7] ARM: OMAP2+: Remove omapdrm platform data Laurent Pinchart
@ 2016-12-13 23:38 ` Laurent Pinchart
  2016-12-13 23:38 ` [PATCH/RFC 6/7] drm: omapdrm: Register omapdrm platform device in omapdss driver Laurent Pinchart
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 20+ messages in thread
From: Laurent Pinchart @ 2016-12-13 23:38 UTC (permalink / raw)
  To: dri-devel; +Cc: Tomi Valkeinen, linux-omap

The omapdrm platform data are not used anymore, remove them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 include/linux/platform_data/omap_drm.h | 53 ----------------------------------
 1 file changed, 53 deletions(-)
 delete mode 100644 include/linux/platform_data/omap_drm.h

diff --git a/include/linux/platform_data/omap_drm.h b/include/linux/platform_data/omap_drm.h
deleted file mode 100644
index f4e4a237ebd2..000000000000
--- a/include/linux/platform_data/omap_drm.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * DRM/KMS platform data for TI OMAP platforms
- *
- * Copyright (C) 2012 Texas Instruments
- * Author: Rob Clark <rob.clark@linaro.org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published by
- * the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef __PLATFORM_DATA_OMAP_DRM_H__
-#define __PLATFORM_DATA_OMAP_DRM_H__
-
-/*
- * Optional platform data to configure the default configuration of which
- * pipes/overlays/CRTCs are used.. if this is not provided, then instead the
- * first CONFIG_DRM_OMAP_NUM_CRTCS are used, and they are each connected to
- * one manager, with priority given to managers that are connected to
- * detected devices.  Remaining overlays are used as video planes.  This
- * should be a good default behavior for most cases, but yet there still
- * might be times when you wish to do something different.
- */
-struct omap_kms_platform_data {
-	/* overlays to use as CRTCs: */
-	int ovl_cnt;
-	const int *ovl_ids;
-
-	/* overlays to use as video planes: */
-	int pln_cnt;
-	const int *pln_ids;
-
-	int mgr_cnt;
-	const int *mgr_ids;
-
-	int dev_cnt;
-	const char **dev_names;
-};
-
-struct omap_drm_platform_data {
-	uint32_t omaprev;
-	struct omap_kms_platform_data *kms_pdata;
-};
-
-#endif /* __PLATFORM_DATA_OMAP_DRM_H__ */
-- 
Regards,

Laurent Pinchart

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

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH/RFC 6/7] drm: omapdrm: Register omapdrm platform device in omapdss driver
  2016-12-13 23:38 [PATCH/RFC 0/7] Remove the omapdrm device from platform code Laurent Pinchart
                   ` (4 preceding siblings ...)
  2016-12-13 23:38 ` [PATCH/RFC 5/7] drm: omapdrm: " Laurent Pinchart
@ 2016-12-13 23:38 ` Laurent Pinchart
  2016-12-14  8:20   ` Tomi Valkeinen
  2016-12-13 23:38 ` [PATCH/RFC 7/7] ARM: OMAP2+: Remove unused omapdrm platform device Laurent Pinchart
                   ` (2 subsequent siblings)
  8 siblings, 1 reply; 20+ messages in thread
From: Laurent Pinchart @ 2016-12-13 23:38 UTC (permalink / raw)
  To: dri-devel; +Cc: Tomi Valkeinen, linux-omap

The omapdrm platform device is a virtual device created for the sole
purpose of handling the omapdss/omapdrm driver split. It should
eventually be removed. As a first step to ease refactoring move its
registration from platform code to driver code.

The omapdrm driver name must be changed internally to avoid probing both
the device registered in platform code and the device registered in the
omapdss driver, as that would otherwise break bisection.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/gpu/drm/omapdrm/dss/core.c | 17 +++++++++++++++++
 drivers/gpu/drm/omapdrm/omap_drv.c |  2 +-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/core.c b/drivers/gpu/drm/omapdrm/dss/core.c
index 1bf978b5c5bc..b7c44b85b7c3 100644
--- a/drivers/gpu/drm/omapdrm/dss/core.c
+++ b/drivers/gpu/drm/omapdrm/dss/core.c
@@ -22,6 +22,7 @@
 
 #define DSS_SUBSYS_NAME "CORE"
 
+#include <linux/dma-mapping.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/clk.h>
@@ -285,6 +286,16 @@ static void (*dss_output_drv_unreg_funcs[])(void) = {
 	dss_uninit_platform_driver,
 };
 
+#if IS_ENABLED(CONFIG_DRM_OMAP)
+static struct platform_device omap_drm_device = {
+	.dev = {
+		.coherent_dma_mask = DMA_BIT_MASK(32),
+	},
+	.name = "omapdrm_",
+	.id = 0,
+};
+#endif
+
 static int __init omap_dss_init(void)
 {
 	int r;
@@ -300,6 +311,12 @@ static int __init omap_dss_init(void)
 			goto err_reg;
 	}
 
+#if IS_ENABLED(CONFIG_DRM_OMAP)
+	r = platform_device_register(&omap_drm_device);
+	if (r)
+		goto err_reg;
+#endif
+
 	return 0;
 
 err_reg:
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index 0e54e3c9c291..581bb12bdd30 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -937,7 +937,7 @@ static SIMPLE_DEV_PM_OPS(omapdrm_pm_ops, omap_drm_suspend, omap_drm_resume);
 
 static struct platform_driver pdev = {
 	.driver = {
-		.name = DRIVER_NAME,
+		.name = "omapdrm_",
 		.pm = &omapdrm_pm_ops,
 	},
 	.probe = pdev_probe,
-- 
Regards,

Laurent Pinchart

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

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH/RFC 7/7] ARM: OMAP2+: Remove unused omapdrm platform device
  2016-12-13 23:38 [PATCH/RFC 0/7] Remove the omapdrm device from platform code Laurent Pinchart
                   ` (5 preceding siblings ...)
  2016-12-13 23:38 ` [PATCH/RFC 6/7] drm: omapdrm: Register omapdrm platform device in omapdss driver Laurent Pinchart
@ 2016-12-13 23:38 ` Laurent Pinchart
  2016-12-14  1:58 ` [PATCH/RFC 8/7] drm: omapdrm: Handle DSI pin muxing internally Laurent Pinchart
  2016-12-14 15:05 ` [PATCH/RFC 0/7] Remove the omapdrm device from platform code Tony Lindgren
  8 siblings, 0 replies; 20+ messages in thread
From: Laurent Pinchart @ 2016-12-13 23:38 UTC (permalink / raw)
  To: dri-devel; +Cc: Tomi Valkeinen, linux-omap

The omapdrm platform device is unused, as a replacement is now
registered in the omapdss driver. Remove it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 arch/arm/mach-omap2/Makefile  |  2 +-
 arch/arm/mach-omap2/display.c |  7 -------
 arch/arm/mach-omap2/display.h |  1 -
 arch/arm/mach-omap2/drm.c     | 46 -------------------------------------------
 4 files changed, 1 insertion(+), 55 deletions(-)
 delete mode 100644 arch/arm/mach-omap2/drm.c

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 76e8ba70d952..92c8c5acbb87 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -8,7 +8,7 @@ ccflags-y := -I$(srctree)/$(src)/include \
 # Common support
 obj-y := id.o io.o control.o mux.o devices.o fb.o serial.o timer.o pm.o \
 	 common.o gpio.o dma.o wd_timer.o display.o i2c.o hdq1w.o omap_hwmod.o \
-	 omap_device.o omap-headsmp.o sram.o drm.o
+	 omap_device.o omap-headsmp.o sram.o
 
 hwmod-common				= omap_hwmod.o omap_hwmod_reset.o \
 					  omap_hwmod_common_data.o
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index 686cd22a4373..b81b39aa47fe 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -385,13 +385,6 @@ int __init omapdss_init_of(void)
 		return r;
 	}
 
-	/* create DRM device */
-	r = omap_init_drm();
-	if (r < 0) {
-		pr_err("Unable to register omapdrm device\n");
-		return r;
-	}
-
 	/* create vrfb device */
 	r = omap_init_vrfb();
 	if (r < 0) {
diff --git a/arch/arm/mach-omap2/display.h b/arch/arm/mach-omap2/display.h
index 9a39646d4316..42ec2e99a2f4 100644
--- a/arch/arm/mach-omap2/display.h
+++ b/arch/arm/mach-omap2/display.h
@@ -26,7 +26,6 @@ struct omap_dss_dispc_dev_attr {
 	bool	has_framedonetv_irq;
 };
 
-int omap_init_drm(void);
 int omap_init_vrfb(void);
 int omap_init_fb(void);
 int omap_init_vout(void);
diff --git a/arch/arm/mach-omap2/drm.c b/arch/arm/mach-omap2/drm.c
deleted file mode 100644
index 06fd40c92b96..000000000000
--- a/arch/arm/mach-omap2/drm.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * DRM/KMS device registration for TI OMAP platforms
- *
- * Copyright (C) 2012 Texas Instruments
- * Author: Rob Clark <rob.clark@linaro.org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published by
- * the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/mm.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/dma-mapping.h>
-
-#include "soc.h"
-#include "display.h"
-
-#if IS_ENABLED(CONFIG_DRM_OMAP)
-
-static struct platform_device omap_drm_device = {
-	.dev = {
-		.coherent_dma_mask = DMA_BIT_MASK(32),
-	},
-	.name = "omapdrm",
-	.id = 0,
-};
-
-int __init omap_init_drm(void)
-{
-	return platform_device_register(&omap_drm_device);
-}
-#else
-int __init omap_init_drm(void) { return 0; }
-#endif
-- 
Regards,

Laurent Pinchart

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

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH/RFC 8/7] drm: omapdrm: Handle DSI pin muxing internally
  2016-12-13 23:38 [PATCH/RFC 0/7] Remove the omapdrm device from platform code Laurent Pinchart
                   ` (6 preceding siblings ...)
  2016-12-13 23:38 ` [PATCH/RFC 7/7] ARM: OMAP2+: Remove unused omapdrm platform device Laurent Pinchart
@ 2016-12-14  1:58 ` Laurent Pinchart
  2016-12-14  1:58   ` [PATCH/RFC 9/7] drm: omapdrm: Don't forward set_min_bus_tput() to no-op platform code Laurent Pinchart
                     ` (3 more replies)
  2016-12-14 15:05 ` [PATCH/RFC 0/7] Remove the omapdrm device from platform code Tony Lindgren
  8 siblings, 4 replies; 20+ messages in thread
From: Laurent Pinchart @ 2016-12-14  1:58 UTC (permalink / raw)
  To: dri-devel; +Cc: Tomi Valkeinen, linux-omap

Don't rely on callback functions provided by the platform, but access
the syscon internally to mux the DSI pins.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/gpu/drm/omapdrm/dss/core.c | 20 ----------
 drivers/gpu/drm/omapdrm/dss/dsi.c  | 82 ++++++++++++++++++++++++++++++++++++--
 drivers/gpu/drm/omapdrm/dss/dss.h  |  2 -
 3 files changed, 79 insertions(+), 25 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/core.c b/drivers/gpu/drm/omapdrm/dss/core.c
index b7c44b85b7c3..b173f2889819 100644
--- a/drivers/gpu/drm/omapdrm/dss/core.c
+++ b/drivers/gpu/drm/omapdrm/dss/core.c
@@ -76,26 +76,6 @@ struct platform_device *dss_get_core_pdev(void)
 	return core.pdev;
 }
 
-int dss_dsi_enable_pads(int dsi_id, unsigned lane_mask)
-{
-	struct omap_dss_board_info *board_data = core.pdev->dev.platform_data;
-
-	if (!board_data->dsi_enable_pads)
-		return -ENOENT;
-
-	return board_data->dsi_enable_pads(dsi_id, lane_mask);
-}
-
-void dss_dsi_disable_pads(int dsi_id, unsigned lane_mask)
-{
-	struct omap_dss_board_info *board_data = core.pdev->dev.platform_data;
-
-	if (!board_data->dsi_disable_pads)
-		return;
-
-	return board_data->dsi_disable_pads(dsi_id, lane_mask);
-}
-
 int dss_set_min_bus_tput(struct device *dev, unsigned long tput)
 {
 	struct omap_dss_board_info *pdata = core.pdev->dev.platform_data;
diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c
index f060bda31235..febb7b73847b 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -20,6 +20,8 @@
 #define DSS_SUBSYS_NAME "DSI"
 
 #include <linux/kernel.h>
+#include <linux/mfd/syscon.h>
+#include <linux/regmap.h>
 #include <linux/io.h>
 #include <linux/clk.h>
 #include <linux/device.h>
@@ -311,6 +313,7 @@ struct dsi_data {
 	bool is_enabled;
 
 	struct clk *dss_clk;
+	struct regmap *syscon;
 
 	struct dispc_clock_info user_dispc_cinfo;
 	struct dss_pll_clock_info user_dsi_cinfo;
@@ -2060,6 +2063,64 @@ static unsigned dsi_get_lane_mask(struct platform_device *dsidev)
 	return mask;
 }
 
+/* OMAP4 CONTROL_DSIPHY */
+#define OMAP4_DSIPHY_SYSCON_OFFSET			0x78
+
+#define OMAP4_DSI2_LANEENABLE_SHIFT			29
+#define OMAP4_DSI2_LANEENABLE_MASK			(0x7 << 29)
+#define OMAP4_DSI1_LANEENABLE_SHIFT			24
+#define OMAP4_DSI1_LANEENABLE_MASK			(0x1f << 24)
+#define OMAP4_DSI1_PIPD_SHIFT				19
+#define OMAP4_DSI1_PIPD_MASK				(0x1f << 19)
+#define OMAP4_DSI2_PIPD_SHIFT				14
+#define OMAP4_DSI2_PIPD_MASK				(0x1f << 14)
+
+static int dsi_omap4_mux_pads(struct dsi_data *dsi, unsigned int lanes)
+{
+	u32 enable_mask, enable_shift;
+	u32 pipd_mask, pipd_shift;
+	u32 reg;
+
+	if (!dsi->syscon)
+		return 0;
+
+	if (dsi->module_id == 0) {
+		enable_mask = OMAP4_DSI1_LANEENABLE_MASK;
+		enable_shift = OMAP4_DSI1_LANEENABLE_SHIFT;
+		pipd_mask = OMAP4_DSI1_PIPD_MASK;
+		pipd_shift = OMAP4_DSI1_PIPD_SHIFT;
+	} else if (dsi->module_id == 1) {
+		enable_mask = OMAP4_DSI2_LANEENABLE_MASK;
+		enable_shift = OMAP4_DSI2_LANEENABLE_SHIFT;
+		pipd_mask = OMAP4_DSI2_PIPD_MASK;
+		pipd_shift = OMAP4_DSI2_PIPD_SHIFT;
+	} else {
+		return -ENODEV;
+	}
+
+	regmap_read(dsi->syscon, OMAP4_DSIPHY_SYSCON_OFFSET, &reg);
+
+	reg &= ~enable_mask;
+	reg &= ~pipd_mask;
+
+	reg |= (lanes << enable_shift) & enable_mask;
+	reg |= (lanes << pipd_shift) & pipd_mask;
+
+	regmap_write(dsi->syscon, OMAP4_DSIPHY_SYSCON_OFFSET, reg);
+
+	return 0;
+}
+
+static int dsi_enable_pads(struct dsi_data *dsi, unsigned int lane_mask)
+{
+	return dsi_omap4_mux_pads(dsi, lane_mask);
+}
+
+static void dsi_disable_pads(struct dsi_data *dsi)
+{
+	dsi_omap4_mux_pads(dsi, 0);
+}
+
 static int dsi_cio_init(struct platform_device *dsidev)
 {
 	struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
@@ -2068,7 +2129,7 @@ static int dsi_cio_init(struct platform_device *dsidev)
 
 	DSSDBG("DSI CIO init starts");
 
-	r = dss_dsi_enable_pads(dsi->module_id, dsi_get_lane_mask(dsidev));
+	r = dsi_enable_pads(dsi, dsi_get_lane_mask(dsidev));
 	if (r)
 		return r;
 
@@ -2178,7 +2239,7 @@ static int dsi_cio_init(struct platform_device *dsidev)
 		dsi_cio_disable_lane_override(dsidev);
 err_scp_clk_dom:
 	dsi_disable_scp_clk(dsidev);
-	dss_dsi_disable_pads(dsi->module_id, dsi_get_lane_mask(dsidev));
+	dsi_disable_pads(dsi);
 	return r;
 }
 
@@ -2191,7 +2252,7 @@ static void dsi_cio_uninit(struct platform_device *dsidev)
 
 	dsi_cio_power(dsidev, DSI_COMPLEXIO_POWER_OFF);
 	dsi_disable_scp_clk(dsidev);
-	dss_dsi_disable_pads(dsi->module_id, dsi_get_lane_mask(dsidev));
+	dsi_disable_pads(dsi);
 }
 
 static void dsi_config_tx_fifo(struct platform_device *dsidev,
@@ -5411,6 +5472,21 @@ static int dsi_bind(struct device *dev, struct device *master, void *data)
 		dsi->module_id = dsidev->id;
 	}
 
+	if (of_device_is_compatible(dsidev->dev.of_node, "ti,omap4-isp")) {
+		struct device_node *np;
+
+		/*
+		 * The OMAP4 display DT bindings don't reference the padconf
+		 * syscon. Our only option to retrieve it is to find it by name.
+		 */
+		np = of_find_node_by_name(NULL, "omap4_padconf_global");
+		if (!np)
+			return -ENODEV;
+
+		dsi->syscon = syscon_node_to_regmap(np);
+		of_node_put(np);
+	}
+
 	/* DSI VCs initialization */
 	for (i = 0; i < ARRAY_SIZE(dsi->vc); i++) {
 		dsi->vc[i].source = DSI_VC_SOURCE_L4;
diff --git a/drivers/gpu/drm/omapdrm/dss/dss.h b/drivers/gpu/drm/omapdrm/dss/dss.h
index 56493b290731..32b1586719f9 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss.h
+++ b/drivers/gpu/drm/omapdrm/dss/dss.h
@@ -223,8 +223,6 @@ struct platform_device;
 
 /* core */
 struct platform_device *dss_get_core_pdev(void);
-int dss_dsi_enable_pads(int dsi_id, unsigned lane_mask);
-void dss_dsi_disable_pads(int dsi_id, unsigned lane_mask);
 int dss_set_min_bus_tput(struct device *dev, unsigned long tput);
 int dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *));
 
-- 
Regards,

Laurent Pinchart

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

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH/RFC 9/7] drm: omapdrm: Don't forward set_min_bus_tput() to no-op platform code
  2016-12-14  1:58 ` [PATCH/RFC 8/7] drm: omapdrm: Handle DSI pin muxing internally Laurent Pinchart
@ 2016-12-14  1:58   ` Laurent Pinchart
  2016-12-14  1:58   ` [PATCH/RFC 10/7] ARM: OMAP2+: Remove DSI pin muxing Laurent Pinchart
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 20+ messages in thread
From: Laurent Pinchart @ 2016-12-14  1:58 UTC (permalink / raw)
  To: dri-devel; +Cc: Tomi Valkeinen, linux-omap

The OMAP implementation of the set_min_bus_tput() API is a no-op.
There's no point in forwarding the driver calls to the platform code.
Remove the use of the related platform data callback, but keep the
internal function as a reminder that the feature will need to be
implemented when the OMAP platform will provide support.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/gpu/drm/omapdrm/dss/core.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/core.c b/drivers/gpu/drm/omapdrm/dss/core.c
index b173f2889819..5dfb79c02ab3 100644
--- a/drivers/gpu/drm/omapdrm/dss/core.c
+++ b/drivers/gpu/drm/omapdrm/dss/core.c
@@ -78,12 +78,8 @@ struct platform_device *dss_get_core_pdev(void)
 
 int dss_set_min_bus_tput(struct device *dev, unsigned long tput)
 {
-	struct omap_dss_board_info *pdata = core.pdev->dev.platform_data;
-
-	if (pdata->set_min_bus_tput)
-		return pdata->set_min_bus_tput(dev, tput);
-	else
-		return 0;
+	/* To be implemented when the OMAP platform provides this feature. */
+	return 0;
 }
 
 #if defined(CONFIG_OMAP2_DSS_DEBUGFS)
-- 
Regards,

Laurent Pinchart

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

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH/RFC 10/7] ARM: OMAP2+: Remove DSI pin muxing
  2016-12-14  1:58 ` [PATCH/RFC 8/7] drm: omapdrm: Handle DSI pin muxing internally Laurent Pinchart
  2016-12-14  1:58   ` [PATCH/RFC 9/7] drm: omapdrm: Don't forward set_min_bus_tput() to no-op platform code Laurent Pinchart
@ 2016-12-14  1:58   ` Laurent Pinchart
  2016-12-14  1:58   ` [PATCH/RFC 11/7] ARM: OMAP2+: Remove omapdss set_min_bus_tput platform data callback Laurent Pinchart
  2016-12-14  1:58   ` [PATCH/RFC 12/7] drm: omapdrm: Remove unused omapdss platform data fields Laurent Pinchart
  3 siblings, 0 replies; 20+ messages in thread
From: Laurent Pinchart @ 2016-12-14  1:58 UTC (permalink / raw)
  To: dri-devel; +Cc: Tomi Valkeinen, linux-omap

The DSI pin muxing platform callbacks are unused, remove them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 arch/arm/mach-omap2/display.c | 60 -------------------------------------------
 1 file changed, 60 deletions(-)

diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index b81b39aa47fe..5bb5f848a25a 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -26,8 +26,6 @@
 #include <linux/of.h>
 #include <linux/of_platform.h>
 #include <linux/slab.h>
-#include <linux/mfd/syscon.h>
-#include <linux/regmap.h>
 
 #include <linux/platform_data/omapdss.h>
 #include "omap_hwmod.h"
@@ -74,57 +72,6 @@ static struct platform_device omap_display_device = {
 	},
 };
 
-#define OMAP4_DSIPHY_SYSCON_OFFSET		0x78
-
-static struct regmap *omap4_dsi_mux_syscon;
-
-static int omap4_dsi_mux_pads(int dsi_id, unsigned lanes)
-{
-	u32 enable_mask, enable_shift;
-	u32 pipd_mask, pipd_shift;
-	u32 reg;
-
-	if (dsi_id == 0) {
-		enable_mask = OMAP4_DSI1_LANEENABLE_MASK;
-		enable_shift = OMAP4_DSI1_LANEENABLE_SHIFT;
-		pipd_mask = OMAP4_DSI1_PIPD_MASK;
-		pipd_shift = OMAP4_DSI1_PIPD_SHIFT;
-	} else if (dsi_id == 1) {
-		enable_mask = OMAP4_DSI2_LANEENABLE_MASK;
-		enable_shift = OMAP4_DSI2_LANEENABLE_SHIFT;
-		pipd_mask = OMAP4_DSI2_PIPD_MASK;
-		pipd_shift = OMAP4_DSI2_PIPD_SHIFT;
-	} else {
-		return -ENODEV;
-	}
-
-	regmap_read(omap4_dsi_mux_syscon, OMAP4_DSIPHY_SYSCON_OFFSET, &reg);
-
-	reg &= ~enable_mask;
-	reg &= ~pipd_mask;
-
-	reg |= (lanes << enable_shift) & enable_mask;
-	reg |= (lanes << pipd_shift) & pipd_mask;
-
-	regmap_write(omap4_dsi_mux_syscon, OMAP4_DSIPHY_SYSCON_OFFSET, reg);
-
-	return 0;
-}
-
-static int omap_dsi_enable_pads(int dsi_id, unsigned lane_mask)
-{
-	if (cpu_is_omap44xx())
-		return omap4_dsi_mux_pads(dsi_id, lane_mask);
-
-	return 0;
-}
-
-static void omap_dsi_disable_pads(int dsi_id, unsigned lane_mask)
-{
-	if (cpu_is_omap44xx())
-		omap4_dsi_mux_pads(dsi_id, 0);
-}
-
 static int omap_dss_set_min_bus_tput(struct device *dev, unsigned long tput)
 {
 	return omap_pm_set_min_bus_tput(dev, OCP_INITIATOR_AGENT, tput);
@@ -340,8 +287,6 @@ int __init omapdss_init_of(void)
 	struct platform_device *pdev;
 
 	static struct omap_dss_board_info board_data = {
-		.dsi_enable_pads = omap_dsi_enable_pads,
-		.dsi_disable_pads = omap_dsi_disable_pads,
 		.set_min_bus_tput = omap_dss_set_min_bus_tput,
 	};
 
@@ -406,10 +351,5 @@ int __init omapdss_init_of(void)
 		return r;
 	}
 
-	/* add DSI info for omap4 */
-	node = of_find_node_by_name(NULL, "omap4_padconf_global");
-	if (node)
-		omap4_dsi_mux_syscon = syscon_node_to_regmap(node);
-
 	return 0;
 }
-- 
Regards,

Laurent Pinchart

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

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH/RFC 11/7] ARM: OMAP2+: Remove omapdss set_min_bus_tput platform data callback
  2016-12-14  1:58 ` [PATCH/RFC 8/7] drm: omapdrm: Handle DSI pin muxing internally Laurent Pinchart
  2016-12-14  1:58   ` [PATCH/RFC 9/7] drm: omapdrm: Don't forward set_min_bus_tput() to no-op platform code Laurent Pinchart
  2016-12-14  1:58   ` [PATCH/RFC 10/7] ARM: OMAP2+: Remove DSI pin muxing Laurent Pinchart
@ 2016-12-14  1:58   ` Laurent Pinchart
  2016-12-14  1:58   ` [PATCH/RFC 12/7] drm: omapdrm: Remove unused omapdss platform data fields Laurent Pinchart
  3 siblings, 0 replies; 20+ messages in thread
From: Laurent Pinchart @ 2016-12-14  1:58 UTC (permalink / raw)
  To: dri-devel; +Cc: Tomi Valkeinen, linux-omap

The omapdss set_min_bus_tput platform data callback is unused. Remove
it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 arch/arm/mach-omap2/display.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index 5bb5f848a25a..570e48c11568 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -30,7 +30,6 @@
 #include <linux/platform_data/omapdss.h>
 #include "omap_hwmod.h"
 #include "omap_device.h"
-#include "omap-pm.h"
 #include "common.h"
 
 #include "soc.h"
@@ -72,11 +71,6 @@ static struct platform_device omap_display_device = {
 	},
 };
 
-static int omap_dss_set_min_bus_tput(struct device *dev, unsigned long tput)
-{
-	return omap_pm_set_min_bus_tput(dev, OCP_INITIATOR_AGENT, tput);
-}
-
 static enum omapdss_version __init omap_display_get_version(void)
 {
 	if (cpu_is_omap24xx())
@@ -286,9 +280,7 @@ int __init omapdss_init_of(void)
 	struct device_node *node;
 	struct platform_device *pdev;
 
-	static struct omap_dss_board_info board_data = {
-		.set_min_bus_tput = omap_dss_set_min_bus_tput,
-	};
+	static struct omap_dss_board_info board_data = { 0 };
 
 	/* only create dss helper devices if dss is enabled in the .dts */
 
-- 
Regards,

Laurent Pinchart

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

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH/RFC 12/7] drm: omapdrm: Remove unused omapdss platform data fields
  2016-12-14  1:58 ` [PATCH/RFC 8/7] drm: omapdrm: Handle DSI pin muxing internally Laurent Pinchart
                     ` (2 preceding siblings ...)
  2016-12-14  1:58   ` [PATCH/RFC 11/7] ARM: OMAP2+: Remove omapdss set_min_bus_tput platform data callback Laurent Pinchart
@ 2016-12-14  1:58   ` Laurent Pinchart
  2016-12-18  0:54     ` [PATCH/RFC v1.1 12/7] drm: omapdrm: Remove unused omapdss platform data field Laurent Pinchart
  3 siblings, 1 reply; 20+ messages in thread
From: Laurent Pinchart @ 2016-12-14  1:58 UTC (permalink / raw)
  To: dri-devel; +Cc: Tomi Valkeinen, linux-omap

The omapdss platform data callbacks and the default display name fields
are unused. Remove them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/gpu/drm/omapdrm/dss/core.c    | 2 --
 include/linux/platform_data/omapdss.h | 4 ----
 2 files changed, 6 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/core.c b/drivers/gpu/drm/omapdrm/dss/core.c
index 5dfb79c02ab3..a2c04e327700 100644
--- a/drivers/gpu/drm/omapdrm/dss/core.c
+++ b/drivers/gpu/drm/omapdrm/dss/core.c
@@ -178,8 +178,6 @@ static int __init omap_dss_probe(struct platform_device *pdev)
 
 	if (def_disp_name)
 		core.default_display_name = def_disp_name;
-	else if (pdata->default_display_name)
-		core.default_display_name = pdata->default_display_name;
 
 	return 0;
 
diff --git a/include/linux/platform_data/omapdss.h b/include/linux/platform_data/omapdss.h
index e71bb1d1b7ba..94605c079b80 100644
--- a/include/linux/platform_data/omapdss.h
+++ b/include/linux/platform_data/omapdss.h
@@ -27,10 +27,6 @@ enum omapdss_version {
 
 /* Board specific data */
 struct omap_dss_board_info {
-	const char *default_display_name;
-	int (*dsi_enable_pads)(int dsi_id, unsigned int lane_mask);
-	void (*dsi_disable_pads)(int dsi_id, unsigned int lane_mask);
-	int (*set_min_bus_tput)(struct device *dev, unsigned long r);
 	enum omapdss_version version;
 	u32 omaprev;
 };
-- 
Regards,

Laurent Pinchart

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

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [PATCH/RFC 6/7] drm: omapdrm: Register omapdrm platform device in omapdss driver
  2016-12-13 23:38 ` [PATCH/RFC 6/7] drm: omapdrm: Register omapdrm platform device in omapdss driver Laurent Pinchart
@ 2016-12-14  8:20   ` Tomi Valkeinen
  2016-12-14 11:54     ` Laurent Pinchart
  0 siblings, 1 reply; 20+ messages in thread
From: Tomi Valkeinen @ 2016-12-14  8:20 UTC (permalink / raw)
  To: Laurent Pinchart, dri-devel; +Cc: linux-omap


[-- Attachment #1.1.1: Type: text/plain, Size: 1921 bytes --]

On 14/12/16 01:38, Laurent Pinchart wrote:
> The omapdrm platform device is a virtual device created for the sole
> purpose of handling the omapdss/omapdrm driver split. It should
> eventually be removed. As a first step to ease refactoring move its
> registration from platform code to driver code.
> 
> The omapdrm driver name must be changed internally to avoid probing both
> the device registered in platform code and the device registered in the
> omapdss driver, as that would otherwise break bisection.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  drivers/gpu/drm/omapdrm/dss/core.c | 17 +++++++++++++++++
>  drivers/gpu/drm/omapdrm/omap_drv.c |  2 +-
>  2 files changed, 18 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/core.c b/drivers/gpu/drm/omapdrm/dss/core.c
> index 1bf978b5c5bc..b7c44b85b7c3 100644
> --- a/drivers/gpu/drm/omapdrm/dss/core.c
> +++ b/drivers/gpu/drm/omapdrm/dss/core.c
> @@ -22,6 +22,7 @@
>  
>  #define DSS_SUBSYS_NAME "CORE"
>  
> +#include <linux/dma-mapping.h>
>  #include <linux/kernel.h>
>  #include <linux/module.h>
>  #include <linux/clk.h>
> @@ -285,6 +286,16 @@ static void (*dss_output_drv_unreg_funcs[])(void) = {
>  	dss_uninit_platform_driver,
>  };
>  
> +#if IS_ENABLED(CONFIG_DRM_OMAP)

The #ifs are not needed, don't compile this file if there's no DRM_OMAP.

> +static struct platform_device omap_drm_device = {
> +	.dev = {
> +		.coherent_dma_mask = DMA_BIT_MASK(32),
> +	},
> +	.name = "omapdrm_",
> +	.id = 0,
> +};
> +#endif
> +
>  static int __init omap_dss_init(void)
>  {
>  	int r;
> @@ -300,6 +311,12 @@ static int __init omap_dss_init(void)
>  			goto err_reg;
>  	}
>  
> +#if IS_ENABLED(CONFIG_DRM_OMAP)
> +	r = platform_device_register(&omap_drm_device);
> +	if (r)
> +		goto err_reg;
> +#endif

Where is the unregister?

 Tomi


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH/RFC 6/7] drm: omapdrm: Register omapdrm platform device in omapdss driver
  2016-12-14  8:20   ` Tomi Valkeinen
@ 2016-12-14 11:54     ` Laurent Pinchart
  0 siblings, 0 replies; 20+ messages in thread
From: Laurent Pinchart @ 2016-12-14 11:54 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: linux-omap, dri-devel

Hi Tomi,

On Wednesday 14 Dec 2016 10:20:39 Tomi Valkeinen wrote:
> On 14/12/16 01:38, Laurent Pinchart wrote:
> > The omapdrm platform device is a virtual device created for the sole
> > purpose of handling the omapdss/omapdrm driver split. It should
> > eventually be removed. As a first step to ease refactoring move its
> > registration from platform code to driver code.
> > 
> > The omapdrm driver name must be changed internally to avoid probing both
> > the device registered in platform code and the device registered in the
> > omapdss driver, as that would otherwise break bisection.
> > 
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > ---
> >  drivers/gpu/drm/omapdrm/dss/core.c | 17 +++++++++++++++++
> >  drivers/gpu/drm/omapdrm/omap_drv.c |  2 +-
> >  2 files changed, 18 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/omapdrm/dss/core.c
> > b/drivers/gpu/drm/omapdrm/dss/core.c index 1bf978b5c5bc..b7c44b85b7c3
> > 100644
> > --- a/drivers/gpu/drm/omapdrm/dss/core.c
> > +++ b/drivers/gpu/drm/omapdrm/dss/core.c

[snip]

> > @@ -285,6 +286,16 @@ static void (*dss_output_drv_unreg_funcs[])(void) = {
> > 
> >  	dss_uninit_platform_driver,
> >  
> >  };
> > 
> > +#if IS_ENABLED(CONFIG_DRM_OMAP)
> 
> The #ifs are not needed, don't compile this file if there's no DRM_OMAP.

Right, for a moment I forgot that the dss core isn't shared anymore between 
DRM and FBDEV. I'll fix this.

> > +static struct platform_device omap_drm_device = {
> > +	.dev = {
> > +		.coherent_dma_mask = DMA_BIT_MASK(32),
> > +	},
> > +	.name = "omapdrm_",
> > +	.id = 0,
> > +};
> > +#endif
> > +
> >  static int __init omap_dss_init(void)
> >  {
> >  	int r;
> > @@ -300,6 +311,12 @@ static int __init omap_dss_init(void)
> >  			goto err_reg;
> >  	}
> > 
> > +#if IS_ENABLED(CONFIG_DRM_OMAP)
> > +	r = platform_device_register(&omap_drm_device);
> > +	if (r)
> > +		goto err_reg;
> > +#endif
> 
> Where is the unregister?

Oops. Will fix too.

-- 
Regards,

Laurent Pinchart

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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH/RFC 0/7] Remove the omapdrm device from platform code
  2016-12-13 23:38 [PATCH/RFC 0/7] Remove the omapdrm device from platform code Laurent Pinchart
                   ` (7 preceding siblings ...)
  2016-12-14  1:58 ` [PATCH/RFC 8/7] drm: omapdrm: Handle DSI pin muxing internally Laurent Pinchart
@ 2016-12-14 15:05 ` Tony Lindgren
  2016-12-15  8:08   ` Tomi Valkeinen
  8 siblings, 1 reply; 20+ messages in thread
From: Tony Lindgren @ 2016-12-14 15:05 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: Tomi Valkeinen, linux-omap, dri-devel

* Laurent Pinchart <laurent.pinchart@ideasonboard.com> [161213 15:38]:
> The series will be annoying to merge given how interleaved the ARM and driver
> patches are. The easiest solution would be to merge everything through the ARM
> tree (as the risk of conflict on the DRM side is low), in which case some 
> patches could be squashed together if desired (especially the last two that
> wouldn't require renaming the driver internally anymore).

Maybe Tomi can set up an immutable branch once the patches have been reviewed?
That way also I can merge it in too as needed.

Regards,

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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH/RFC 0/7] Remove the omapdrm device from platform code
  2016-12-14 15:05 ` [PATCH/RFC 0/7] Remove the omapdrm device from platform code Tony Lindgren
@ 2016-12-15  8:08   ` Tomi Valkeinen
  2016-12-15 10:07     ` Laurent Pinchart
  0 siblings, 1 reply; 20+ messages in thread
From: Tomi Valkeinen @ 2016-12-15  8:08 UTC (permalink / raw)
  To: Tony Lindgren, Laurent Pinchart; +Cc: linux-omap, dri-devel


[-- Attachment #1.1.1: Type: text/plain, Size: 1760 bytes --]

On 14/12/16 17:05, Tony Lindgren wrote:
> * Laurent Pinchart <laurent.pinchart@ideasonboard.com> [161213 15:38]:
>> The series will be annoying to merge given how interleaved the ARM and driver
>> patches are. The easiest solution would be to merge everything through the ARM
>> tree (as the risk of conflict on the DRM side is low), in which case some 
>> patches could be squashed together if desired (especially the last two that
>> wouldn't require renaming the driver internally anymore).
> 
> Maybe Tomi can set up an immutable branch once the patches have been reviewed?
> That way also I can merge it in too as needed.

Yes, I think that's a good option. Then the series doesn't have to be so
artificially split into linux-omap and drm parts.

I don't think there are much chances with conflicts on the linux-omap
side, as the only files touched are display.c and drm.c (well, and a
small change in Makefile).

I like the series in general, but I still need to go through it in detail.

And speaking of removing of platform data...

Tony, the only big reason we still have the omapdss platform data
(include/linux/platform_data/omapdss.h) is the omapdss_version, which is
based on the OMAP SoC version.

We need that in the driver, as the DSS IP revision hasn't been updated
in a couple of cases, or the issue comes from outside DSS. But there are
only a few of these cases, mostly we would do just fine with the DSS IP
revision.

What do you think of a scheme, where we'd drop the platform data, but at
early platform init code we would inject a DT property or two into DSS's
DT data in those problematic cases?

Or do you have any other ideas how to pass flags to the driver based on
the SoC revision?

 Tomi


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH/RFC 0/7] Remove the omapdrm device from platform code
  2016-12-15  8:08   ` Tomi Valkeinen
@ 2016-12-15 10:07     ` Laurent Pinchart
  2016-12-15 11:04       ` Tomi Valkeinen
  0 siblings, 1 reply; 20+ messages in thread
From: Laurent Pinchart @ 2016-12-15 10:07 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: Tony Lindgren, linux-omap, dri-devel

Hi Tomi,

On Thursday 15 Dec 2016 10:08:47 Tomi Valkeinen wrote:
> On 14/12/16 17:05, Tony Lindgren wrote:
> > * Laurent Pinchart <laurent.pinchart@ideasonboard.com> [161213 15:38]:
> >> The series will be annoying to merge given how interleaved the ARM and
> >> driver patches are. The easiest solution would be to merge everything
> >> through the ARM tree (as the risk of conflict on the DRM side is low),
> >> in which case some patches could be squashed together if desired
> >> (especially the last two that wouldn't require renaming the driver
> >> internally anymore).
> > 
> > Maybe Tomi can set up an immutable branch once the patches have been
> > reviewed? That way also I can merge it in too as needed.
> 
> Yes, I think that's a good option. Then the series doesn't have to be so
> artificially split into linux-omap and drm parts.
> 
> I don't think there are much chances with conflicts on the linux-omap
> side, as the only files touched are display.c and drm.c (well, and a
> small change in Makefile).
> 
> I like the series in general, but I still need to go through it in detail.
> 
> And speaking of removing of platform data...
> 
> Tony, the only big reason we still have the omapdss platform data
> (include/linux/platform_data/omapdss.h) is the omapdss_version, which is
> based on the OMAP SoC version.
> 
> We need that in the driver, as the DSS IP revision hasn't been updated
> in a couple of cases, or the issue comes from outside DSS. But there are
> only a few of these cases, mostly we would do just fine with the DSS IP
> revision.
> 
> What do you think of a scheme, where we'd drop the platform data, but at
> early platform init code we would inject a DT property or two into DSS's
> DT data in those problematic cases?
> 
> Or do you have any other ideas how to pass flags to the driver based on
> the SoC revision?

Or retrieve the SoC revision in the driver. I know this is a bad thing to do 
in general, but when handling errata that are specific to certain ES versions, 
it's hard to avoid. https://patchwork.kernel.org/patch/9141381/ has been 
developed for that (or at least a very similar) purpose.

-- 
Regards,

Laurent Pinchart

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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH/RFC 0/7] Remove the omapdrm device from platform code
  2016-12-15 10:07     ` Laurent Pinchart
@ 2016-12-15 11:04       ` Tomi Valkeinen
  0 siblings, 0 replies; 20+ messages in thread
From: Tomi Valkeinen @ 2016-12-15 11:04 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: Tony Lindgren, linux-omap, dri-devel


[-- Attachment #1.1.1: Type: text/plain, Size: 485 bytes --]

On 15/12/16 12:07, Laurent Pinchart wrote:

>> Or do you have any other ideas how to pass flags to the driver based on
>> the SoC revision?
> 
> Or retrieve the SoC revision in the driver. I know this is a bad thing to do 
> in general, but when handling errata that are specific to certain ES versions, 
> it's hard to avoid. https://patchwork.kernel.org/patch/9141381/ has been 
> developed for that (or at least a very similar) purpose.

Ah, that should work.

 Tomi


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH/RFC v1.1 12/7] drm: omapdrm: Remove unused omapdss platform data field
  2016-12-14  1:58   ` [PATCH/RFC 12/7] drm: omapdrm: Remove unused omapdss platform data fields Laurent Pinchart
@ 2016-12-18  0:54     ` Laurent Pinchart
  0 siblings, 0 replies; 20+ messages in thread
From: Laurent Pinchart @ 2016-12-18  0:54 UTC (permalink / raw)
  To: dri-devel; +Cc: linux-omap, Tomi Valkeinen

The omapdss platform data default_display_name field is unused.
Remove it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
Changes since v1:

- Don't remove the platform callbacks as they're still used by the
  omapfb driver.
---
 drivers/gpu/drm/omapdrm/dss/core.c          | 2 --
 drivers/video/fbdev/omap2/omapfb/dss/core.c | 2 --
 include/linux/platform_data/omapdss.h       | 1 -
 3 files changed, 5 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/core.c b/drivers/gpu/drm/omapdrm/dss/core.c
index 3d36174667ec..49c412a6a8a9 100644
--- a/drivers/gpu/drm/omapdrm/dss/core.c
+++ b/drivers/gpu/drm/omapdrm/dss/core.c
@@ -178,8 +178,6 @@ static int __init omap_dss_probe(struct platform_device *pdev)
 
 	if (def_disp_name)
 		core.default_display_name = def_disp_name;
-	else if (pdata->default_display_name)
-		core.default_display_name = pdata->default_display_name;
 
 	return 0;
 
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/core.c b/drivers/video/fbdev/omap2/omapfb/dss/core.c
index 29de4827589d..eecf695c16f4 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/core.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/core.c
@@ -206,8 +206,6 @@ static int __init omap_dss_probe(struct platform_device *pdev)
 
 	if (def_disp_name)
 		core.default_display_name = def_disp_name;
-	else if (pdata->default_display_name)
-		core.default_display_name = pdata->default_display_name;
 
 	register_pm_notifier(&omap_dss_pm_notif_block);
 
diff --git a/include/linux/platform_data/omapdss.h b/include/linux/platform_data/omapdss.h
index e71bb1d1b7ba..5d87bfa8df69 100644
--- a/include/linux/platform_data/omapdss.h
+++ b/include/linux/platform_data/omapdss.h
@@ -27,7 +27,6 @@ enum omapdss_version {
 
 /* Board specific data */
 struct omap_dss_board_info {
-	const char *default_display_name;
 	int (*dsi_enable_pads)(int dsi_id, unsigned int lane_mask);
 	void (*dsi_disable_pads)(int dsi_id, unsigned int lane_mask);
 	int (*set_min_bus_tput)(struct device *dev, unsigned long r);
-- 
Regards,

Laurent Pinchart

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

^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2016-12-18  0:54 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-13 23:38 [PATCH/RFC 0/7] Remove the omapdrm device from platform code Laurent Pinchart
2016-12-13 23:38 ` [PATCH/RFC 1/7] drm: omapdrm: Add OMAP revision to omapdss platform data Laurent Pinchart
2016-12-13 23:38 ` [PATCH/RFC 2/7] ARM: OMAP2+: Populate the omapdss platform data OMAP revision Laurent Pinchart
2016-12-13 23:38 ` [PATCH/RFC 3/7] drm: omapdrm: Retrieve OMAP revision from omapdss Laurent Pinchart
2016-12-13 23:38 ` [PATCH/RFC 4/7] ARM: OMAP2+: Remove omapdrm platform data Laurent Pinchart
2016-12-13 23:38 ` [PATCH/RFC 5/7] drm: omapdrm: " Laurent Pinchart
2016-12-13 23:38 ` [PATCH/RFC 6/7] drm: omapdrm: Register omapdrm platform device in omapdss driver Laurent Pinchart
2016-12-14  8:20   ` Tomi Valkeinen
2016-12-14 11:54     ` Laurent Pinchart
2016-12-13 23:38 ` [PATCH/RFC 7/7] ARM: OMAP2+: Remove unused omapdrm platform device Laurent Pinchart
2016-12-14  1:58 ` [PATCH/RFC 8/7] drm: omapdrm: Handle DSI pin muxing internally Laurent Pinchart
2016-12-14  1:58   ` [PATCH/RFC 9/7] drm: omapdrm: Don't forward set_min_bus_tput() to no-op platform code Laurent Pinchart
2016-12-14  1:58   ` [PATCH/RFC 10/7] ARM: OMAP2+: Remove DSI pin muxing Laurent Pinchart
2016-12-14  1:58   ` [PATCH/RFC 11/7] ARM: OMAP2+: Remove omapdss set_min_bus_tput platform data callback Laurent Pinchart
2016-12-14  1:58   ` [PATCH/RFC 12/7] drm: omapdrm: Remove unused omapdss platform data fields Laurent Pinchart
2016-12-18  0:54     ` [PATCH/RFC v1.1 12/7] drm: omapdrm: Remove unused omapdss platform data field Laurent Pinchart
2016-12-14 15:05 ` [PATCH/RFC 0/7] Remove the omapdrm device from platform code Tony Lindgren
2016-12-15  8:08   ` Tomi Valkeinen
2016-12-15 10:07     ` Laurent Pinchart
2016-12-15 11:04       ` Tomi Valkeinen

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.