linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] OMAP: DSS2: introduce generic panel display driver (try #3)
@ 2010-11-05 19:43 Bryan Wu
  2010-11-05 19:43 ` [PATCH 1/3] OMAP: use generic panel data in board files Bryan Wu
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Bryan Wu @ 2010-11-05 19:43 UTC (permalink / raw)
  To: linux-arm-kernel

There are 4 duplicated DPI panel drivers in DSS2 display driver. They are
similar and a generic DPI panel driver can support all them with specific
panel configuration. And new DPI panel driver can be easily supported
by adding panel configurations into generic panel DPI driver.

This patchset introduces a generic panel DPI driver, remove 3 panel drivers and enable
generic panel DPI driver in board files. And it is based on 2.6.37-rc1.

This patch use unified the panel_data struct for nokia_dsi_panel_data with DPI
panel data. So panel-taal.c is updated as well.

Building with omap2plus_defconfig is successful.

Keep sharp_ls_panel, since it contains blacklight control code which will be
moved out later.

Bryan Wu (3):
  OMAP: use generic panel data in board files
  OMAP: DSS2: Add generic panel display driver
  OMAP: DSS2: remove generic DPI panel driver duplicated panel drivers

 arch/arm/mach-omap2/board-3430sdp.c                |   10 +-
 arch/arm/mach-omap2/board-am3517evm.c              |   19 +-
 arch/arm/mach-omap2/board-cm-t35.c                 |   19 +-
 arch/arm/mach-omap2/board-devkit8000.c             |   22 +-
 arch/arm/mach-omap2/board-igep0020.c               |   10 +-
 arch/arm/mach-omap2/board-omap3beagle.c            |   10 +-
 arch/arm/mach-omap2/board-omap3evm.c               |   10 +-
 arch/arm/mach-omap2/board-omap3stalker.c           |   19 +-
 arch/arm/plat-omap/include/plat/nokia-dsi-panel.h  |   31 --
 arch/arm/plat-omap/include/plat/panel.h            |   57 ++++
 drivers/video/omap2/displays/Kconfig               |   22 +-
 drivers/video/omap2/displays/Makefile              |    4 +-
 drivers/video/omap2/displays/panel-dpi.c           |  306 ++++++++++++++++++++
 drivers/video/omap2/displays/panel-generic.c       |  174 -----------
 .../video/omap2/displays/panel-sharp-lq043t1dg01.c |  165 -----------
 drivers/video/omap2/displays/panel-taal.c          |   26 +-
 .../video/omap2/displays/panel-toppoly-tdo35s.c    |  164 -----------
 17 files changed, 461 insertions(+), 607 deletions(-)
 delete mode 100644 arch/arm/plat-omap/include/plat/nokia-dsi-panel.h
 create mode 100644 arch/arm/plat-omap/include/plat/panel.h
 create mode 100644 drivers/video/omap2/displays/panel-dpi.c
 delete mode 100644 drivers/video/omap2/displays/panel-generic.c
 delete mode 100644 drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c
 delete mode 100644 drivers/video/omap2/displays/panel-toppoly-tdo35s.c

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

* [PATCH 1/3] OMAP: use generic panel data in board files
  2010-11-05 19:43 [PATCH 0/3] OMAP: DSS2: introduce generic panel display driver (try #3) Bryan Wu
@ 2010-11-05 19:43 ` Bryan Wu
  2010-11-05 21:17   ` Taneja, Archit
  2010-11-08 12:26   ` Tomi Valkeinen
  2010-11-05 19:43 ` [PATCH 2/3] OMAP: DSS2: Add generic panel display driver Bryan Wu
  2010-11-05 19:43 ` [PATCH 3/3] OMAP: DSS2: remove generic DPI panel driver duplicated panel drivers Bryan Wu
  2 siblings, 2 replies; 16+ messages in thread
From: Bryan Wu @ 2010-11-05 19:43 UTC (permalink / raw)
  To: linux-arm-kernel

Introduce struct panel config data in panel.h, which will be used to match
the right panel configurations in generic DPI panel driver and other future
dsi panel drivers.

Still keep sharp_ls_panel, since the sharp_ls_panel driver contains blacklight
control driver code which will be moved out later. Then we can use generic DPI
driver for sharp_ls_panel.

Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
---
 arch/arm/mach-omap2/board-3430sdp.c               |   10 +++-
 arch/arm/mach-omap2/board-am3517evm.c             |   19 +++++--
 arch/arm/mach-omap2/board-cm-t35.c                |   19 +++++--
 arch/arm/mach-omap2/board-devkit8000.c            |   22 +++++---
 arch/arm/mach-omap2/board-igep0020.c              |   10 +++-
 arch/arm/mach-omap2/board-omap3beagle.c           |   10 +++-
 arch/arm/mach-omap2/board-omap3evm.c              |   10 +++-
 arch/arm/mach-omap2/board-omap3stalker.c          |   19 +++++--
 arch/arm/plat-omap/include/plat/nokia-dsi-panel.h |   31 -----------
 arch/arm/plat-omap/include/plat/panel.h           |   57 +++++++++++++++++++++
 drivers/video/omap2/displays/panel-taal.c         |   26 ++++------
 11 files changed, 148 insertions(+), 85 deletions(-)
 delete mode 100644 arch/arm/plat-omap/include/plat/nokia-dsi-panel.h
 create mode 100644 arch/arm/plat-omap/include/plat/panel.h

diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index 4e3742c..859b4e5 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -38,6 +38,7 @@
 #include <plat/dma.h>
 #include <plat/gpmc.h>
 #include <plat/display.h>
+#include <plat/panel.h>
 
 #include <plat/gpmc-smc91x.h>
 
@@ -270,11 +271,14 @@ static struct omap_dss_device sdp3430_lcd_device = {
 	.platform_disable	= sdp3430_panel_disable_lcd,
 };
 
+static struct panel_data dvi_panel = {
+	.name		= "generic",
+};
+
 static struct omap_dss_device sdp3430_dvi_device = {
 	.name			= "dvi",
-	.driver_name		= "generic_panel",
-	.type			= OMAP_DISPLAY_TYPE_DPI,
-	.phy.dpi.data_lines	= 24,
+	.driver_name		= "dpi_panel",
+	.data			= &dvi_panel,
 	.platform_enable	= sdp3430_panel_enable_dvi,
 	.platform_disable	= sdp3430_panel_disable_dvi,
 };
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index 0739950..9b2b6ff 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -35,6 +35,7 @@
 #include <plat/common.h>
 #include <plat/usb.h>
 #include <plat/display.h>
+#include <plat/panel.h>
 
 #include "mux.h"
 #include "control.h"
@@ -303,11 +304,14 @@ static void am3517_evm_panel_disable_lcd(struct omap_dss_device *dssdev)
 	lcd_enabled = 0;
 }
 
+static struct panel_data lcd_panel = {
+	.name		= "sharp_lq",
+};
+
 static struct omap_dss_device am3517_evm_lcd_device = {
-	.type			= OMAP_DISPLAY_TYPE_DPI,
 	.name			= "lcd",
-	.driver_name		= "sharp_lq_panel",
-	.phy.dpi.data_lines 	= 16,
+	.driver_name		= "dpi_panel",
+	.data			= &lcd_panel,
 	.platform_enable	= am3517_evm_panel_enable_lcd,
 	.platform_disable	= am3517_evm_panel_disable_lcd,
 };
@@ -346,11 +350,14 @@ static void am3517_evm_panel_disable_dvi(struct omap_dss_device *dssdev)
 	dvi_enabled = 0;
 }
 
+static struct panel_data dvi_panel = {
+	.name		= "generic",
+};
+
 static struct omap_dss_device am3517_evm_dvi_device = {
-	.type			= OMAP_DISPLAY_TYPE_DPI,
 	.name			= "dvi",
-	.driver_name		= "generic_panel",
-	.phy.dpi.data_lines	= 24,
+	.driver_name		= "dpi_panel",
+	.data			= &dvi_panel,
 	.platform_enable	= am3517_evm_panel_enable_dvi,
 	.platform_disable	= am3517_evm_panel_disable_dvi,
 };
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
index 63f764e..326aa15 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -46,6 +46,7 @@
 #include <plat/gpmc.h>
 #include <plat/usb.h>
 #include <plat/display.h>
+#include <plat/panel.h>
 #include <plat/mcspi.h>
 
 #include <mach/hardware.h>
@@ -351,20 +352,26 @@ static void cm_t35_panel_disable_tv(struct omap_dss_device *dssdev)
 {
 }
 
+static struct panel_data lcd_panel = {
+	.name		= "toppoly_tdo35s",
+};
+
 static struct omap_dss_device cm_t35_lcd_device = {
 	.name			= "lcd",
-	.driver_name		= "toppoly_tdo35s_panel",
-	.type			= OMAP_DISPLAY_TYPE_DPI,
-	.phy.dpi.data_lines	= 18,
+	.driver_name		= "dpi_panel",
+	.data			= &lcd_panel,
 	.platform_enable	= cm_t35_panel_enable_lcd,
 	.platform_disable	= cm_t35_panel_disable_lcd,
 };
 
+static struct panel_data dvi_panel = {
+	.name		= "generic",
+};
+
 static struct omap_dss_device cm_t35_dvi_device = {
 	.name			= "dvi",
-	.driver_name		= "generic_panel",
-	.type			= OMAP_DISPLAY_TYPE_DPI,
-	.phy.dpi.data_lines	= 24,
+	.driver_name		= "dpi_panel",
+	.data			= &dvi_panel,
 	.platform_enable	= cm_t35_panel_enable_dvi,
 	.platform_disable	= cm_t35_panel_disable_dvi,
 };
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index 067f437..c38ece3 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -46,6 +46,7 @@
 #include <plat/nand.h>
 #include <plat/usb.h>
 #include <plat/display.h>
+#include <plat/panel.h>
 
 #include <plat/mcspi.h>
 #include <linux/input/matrix_keypad.h>
@@ -149,21 +150,26 @@ static struct regulator_consumer_supply devkit8000_vmmc1_supply =
 static struct regulator_consumer_supply devkit8000_vio_supply =
 	REGULATOR_SUPPLY("vcc", "spi2.0");
 
+static struct panel_data lcd_panel = {
+	.name		= "generic",
+};
+
 static struct omap_dss_device devkit8000_lcd_device = {
 	.name                   = "lcd",
-	.driver_name            = "generic_panel",
-	.type                   = OMAP_DISPLAY_TYPE_DPI,
-	.phy.dpi.data_lines     = 24,
-	.reset_gpio             = -EINVAL, /* will be replaced */
+	.driver_name            = "dpi_panel",
+	.data			= &lcd_panel,
 	.platform_enable        = devkit8000_panel_enable_lcd,
 	.platform_disable       = devkit8000_panel_disable_lcd,
 };
+
+static struct panel_data dvi_panel = {
+	.name		= "generic",
+};
+
 static struct omap_dss_device devkit8000_dvi_device = {
 	.name                   = "dvi",
-	.driver_name            = "generic_panel",
-	.type                   = OMAP_DISPLAY_TYPE_DPI,
-	.phy.dpi.data_lines     = 24,
-	.reset_gpio             = -EINVAL, /* will be replaced */
+	.driver_name            = "dpi_panel",
+	.data			= &dvi_panel,
 	.platform_enable        = devkit8000_panel_enable_dvi,
 	.platform_disable       = devkit8000_panel_disable_dvi,
 };
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 5e035a5..c2475bb 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -30,6 +30,7 @@
 #include <plat/gpmc.h>
 #include <plat/usb.h>
 #include <plat/display.h>
+#include <plat/panel.h>
 #include <plat/onenand.h>
 
 #include "mux.h"
@@ -433,11 +434,14 @@ static void igep2_disable_dvi(struct omap_dss_device *dssdev)
 	gpio_direction_output(IGEP2_GPIO_DVI_PUP, 0);
 }
 
+static struct panel_data dvi_panel = {
+	.name		= "generic",
+};
+
 static struct omap_dss_device igep2_dvi_device = {
-	.type			= OMAP_DISPLAY_TYPE_DPI,
 	.name			= "dvi",
-	.driver_name		= "generic_panel",
-	.phy.dpi.data_lines	= 24,
+	.driver_name		= "dpi_panel",
+	.data			= &dvi_panel,
 	.platform_enable	= igep2_enable_dvi,
 	.platform_disable	= igep2_disable_dvi,
 };
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 14f4224..1d2a634 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -41,6 +41,7 @@
 #include <plat/board.h>
 #include <plat/common.h>
 #include <plat/display.h>
+#include <plat/panel.h>
 #include <plat/gpmc.h>
 #include <plat/nand.h>
 #include <plat/usb.h>
@@ -194,11 +195,14 @@ static void beagle_disable_dvi(struct omap_dss_device *dssdev)
 		gpio_set_value(dssdev->reset_gpio, 0);
 }
 
+static struct panel_data dvi_panel = {
+	.name = "generic",
+};
+
 static struct omap_dss_device beagle_dvi_device = {
-	.type = OMAP_DISPLAY_TYPE_DPI,
 	.name = "dvi",
-	.driver_name = "generic_panel",
-	.phy.dpi.data_lines = 24,
+	.driver_name = "dpi_panel",
+	.data = &dvi_panel,
 	.reset_gpio = 170,
 	.platform_enable = beagle_enable_dvi,
 	.platform_disable = beagle_disable_dvi,
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index b04365c..981de08 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -43,6 +43,7 @@
 #include <plat/common.h>
 #include <plat/mcspi.h>
 #include <plat/display.h>
+#include <plat/panel.h>
 
 #include "mux.h"
 #include "sdram-micron-mt46h32m32lf-6.h"
@@ -301,11 +302,14 @@ static void omap3_evm_disable_dvi(struct omap_dss_device *dssdev)
 	dvi_enabled = 0;
 }
 
+static struct panel_data dvi_panel = {
+	.name =		"generic",
+};
+
 static struct omap_dss_device omap3_evm_dvi_device = {
 	.name			= "dvi",
-	.driver_name		= "generic_panel",
-	.type			= OMAP_DISPLAY_TYPE_DPI,
-	.phy.dpi.data_lines	= 24,
+	.driver_name		= "dpi_panel",
+	.data			= &dvi_panel,
 	.platform_enable	= omap3_evm_enable_dvi,
 	.platform_disable	= omap3_evm_disable_dvi,
 };
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c
index f252721..85bcfd6 100644
--- a/arch/arm/mach-omap2/board-omap3stalker.c
+++ b/arch/arm/mach-omap2/board-omap3stalker.c
@@ -40,6 +40,7 @@
 #include <plat/nand.h>
 #include <plat/usb.h>
 #include <plat/display.h>
+#include <plat/panel.h>
 
 #include <plat/mcspi.h>
 #include <linux/input/matrix_keypad.h>
@@ -160,11 +161,14 @@ static void omap3_stalker_disable_lcd(struct omap_dss_device *dssdev)
 	lcd_enabled = 0;
 }
 
+static struct panel_data lcd_panel = {
+	.name		= "generic",
+};
+
 static struct omap_dss_device omap3_stalker_lcd_device = {
 	.name			= "lcd",
-	.driver_name		= "generic_panel",
-	.phy.dpi.data_lines	= 24,
-	.type			= OMAP_DISPLAY_TYPE_DPI,
+	.driver_name		= "dpi_panel",
+	.data			= &lcd_panel,
 	.platform_enable	= omap3_stalker_enable_lcd,
 	.platform_disable	= omap3_stalker_disable_lcd,
 };
@@ -208,11 +212,14 @@ static void omap3_stalker_disable_dvi(struct omap_dss_device *dssdev)
 	dvi_enabled = 0;
 }
 
+static struct panel_data dvi_panel = {
+	.name		= "generic",
+};
+
 static struct omap_dss_device omap3_stalker_dvi_device = {
 	.name			= "dvi",
-	.driver_name		= "generic_panel",
-	.type			= OMAP_DISPLAY_TYPE_DPI,
-	.phy.dpi.data_lines	= 24,
+	.driver_name		= "dpi_panel",
+	.data			= &dvi_panel,
 	.platform_enable	= omap3_stalker_enable_dvi,
 	.platform_disable	= omap3_stalker_disable_dvi,
 };
diff --git a/arch/arm/plat-omap/include/plat/nokia-dsi-panel.h b/arch/arm/plat-omap/include/plat/nokia-dsi-panel.h
deleted file mode 100644
index 01ab657..0000000
--- a/arch/arm/plat-omap/include/plat/nokia-dsi-panel.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifndef __ARCH_ARM_PLAT_OMAP_NOKIA_DSI_PANEL_H
-#define __ARCH_ARM_PLAT_OMAP_NOKIA_DSI_PANEL_H
-
-#include "display.h"
-
-/**
- * struct nokia_dsi_panel_data - Nokia DSI panel driver configuration
- * @name: panel name
- * @use_ext_te: use external TE
- * @ext_te_gpio: external TE GPIO
- * @use_esd_check: perform ESD checks
- * @max_backlight_level: maximum backlight level
- * @set_backlight: pointer to backlight set function
- * @get_backlight: pointer to backlight get function
- */
-struct nokia_dsi_panel_data {
-	const char *name;
-
-	int reset_gpio;
-
-	bool use_ext_te;
-	int ext_te_gpio;
-
-	bool use_esd_check;
-
-	int max_backlight_level;
-	int (*set_backlight)(struct omap_dss_device *dssdev, int level);
-	int (*get_backlight)(struct omap_dss_device *dssdev);
-};
-
-#endif /* __ARCH_ARM_PLAT_OMAP_NOKIA_DSI_PANEL_H */
diff --git a/arch/arm/plat-omap/include/plat/panel.h b/arch/arm/plat-omap/include/plat/panel.h
new file mode 100644
index 0000000..84c6ffd
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/panel.h
@@ -0,0 +1,57 @@
+/*
+ * Header for panel driver
+ *
+ * Copyright (C) 2010 Canonical Ltd.
+ * Author: Bryan Wu <bryan.wu@canonical.com>
+ *
+ * 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 __ARCH_ARM_PLAT_OMAP_PANEL_H
+#define __ARCH_ARM_PLAT_OMAP_PANEL_H
+
+#include "display.h"
+
+/**
+ * struct panel_data - panel driver configuration
+ * @name: panel name
+ * @use_ext_te: use external TE
+ * @ext_te_gpio: external TE GPIO
+ * @use_esd_check: perform ESD checks
+ * @max_backlight_level: maximum backlight level
+ * @set_backlight: pointer to backlight set function
+ * @get_backlight: pointer to backlight get function
+ */
+struct panel_data {
+	const char *name;
+
+	int reset_gpio;
+
+	bool use_ext_te;
+	int ext_te_gpio;
+
+	bool use_esd_check;
+
+	int max_backlight_level;
+	int (*set_backlight)(struct omap_dss_device *dssdev, int level);
+	int (*get_backlight)(struct omap_dss_device *dssdev);
+};
+
+static inline struct panel_data
+*get_panel_data(const struct omap_dss_device *dssdev)
+{
+	return (struct panel_data *) dssdev->data;
+}
+
+
+#endif /* __ARCH_ARM_PLAT_OMAP_PANEL_H */
diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c
index e1c765d..170ef63 100644
--- a/drivers/video/omap2/displays/panel-taal.c
+++ b/drivers/video/omap2/displays/panel-taal.c
@@ -34,7 +34,7 @@
 #include <linux/mutex.h>
 
 #include <plat/display.h>
-#include <plat/nokia-dsi-panel.h>
+#include <plat/panel.h>
 
 /* DSI Virtual channel. Hardcoded for now. */
 #define TCH 0
@@ -233,12 +233,6 @@ struct taal_data {
 	struct panel_config *panel_config;
 };
 
-static inline struct nokia_dsi_panel_data
-*get_panel_data(const struct omap_dss_device *dssdev)
-{
-	return (struct nokia_dsi_panel_data *) dssdev->data;
-}
-
 static void taal_esd_work(struct work_struct *work);
 
 static void hw_guard_start(struct taal_data *td, int guard_msec)
@@ -422,7 +416,7 @@ static int taal_bl_update_status(struct backlight_device *dev)
 {
 	struct omap_dss_device *dssdev = dev_get_drvdata(&dev->dev);
 	struct taal_data *td = dev_get_drvdata(&dssdev->dev);
-	struct nokia_dsi_panel_data *panel_data = get_panel_data(dssdev);
+	struct panel_data *panel_data = get_panel_data(dssdev);
 	int r;
 	int level;
 
@@ -639,7 +633,7 @@ static struct attribute_group taal_attr_group = {
 static void taal_hw_reset(struct omap_dss_device *dssdev)
 {
 	struct taal_data *td = dev_get_drvdata(&dssdev->dev);
-	struct nokia_dsi_panel_data *panel_data = get_panel_data(dssdev);
+	struct panel_data *panel_data = get_panel_data(dssdev);
 
 	if (panel_data->reset_gpio == -1)
 		return;
@@ -663,7 +657,7 @@ static int taal_probe(struct omap_dss_device *dssdev)
 	struct backlight_properties props;
 	struct taal_data *td;
 	struct backlight_device *bldev;
-	struct nokia_dsi_panel_data *panel_data = get_panel_data(dssdev);
+	struct panel_data *panel_data = get_panel_data(dssdev);
 	struct panel_config *panel_config = NULL;
 	int r, i;
 
@@ -802,7 +796,7 @@ err:
 static void taal_remove(struct omap_dss_device *dssdev)
 {
 	struct taal_data *td = dev_get_drvdata(&dssdev->dev);
-	struct nokia_dsi_panel_data *panel_data = get_panel_data(dssdev);
+	struct panel_data *panel_data = get_panel_data(dssdev);
 	struct backlight_device *bldev;
 
 	dev_dbg(&dssdev->dev, "remove\n");
@@ -942,7 +936,7 @@ static void taal_power_off(struct omap_dss_device *dssdev)
 static int taal_enable(struct omap_dss_device *dssdev)
 {
 	struct taal_data *td = dev_get_drvdata(&dssdev->dev);
-	struct nokia_dsi_panel_data *panel_data = get_panel_data(dssdev);
+	struct panel_data *panel_data = get_panel_data(dssdev);
 	int r;
 
 	dev_dbg(&dssdev->dev, "enable\n");
@@ -1035,7 +1029,7 @@ err:
 static int taal_resume(struct omap_dss_device *dssdev)
 {
 	struct taal_data *td = dev_get_drvdata(&dssdev->dev);
-	struct nokia_dsi_panel_data *panel_data = get_panel_data(dssdev);
+	struct panel_data *panel_data = get_panel_data(dssdev);
 	int r;
 
 	dev_dbg(&dssdev->dev, "resume\n");
@@ -1122,7 +1116,7 @@ static int taal_update(struct omap_dss_device *dssdev,
 				    u16 x, u16 y, u16 w, u16 h)
 {
 	struct taal_data *td = dev_get_drvdata(&dssdev->dev);
-	struct nokia_dsi_panel_data *panel_data = get_panel_data(dssdev);
+	struct panel_data *panel_data = get_panel_data(dssdev);
 	int r;
 
 	dev_dbg(&dssdev->dev, "update %d, %d, %d x %d\n", x, y, w, h);
@@ -1187,7 +1181,7 @@ static int taal_sync(struct omap_dss_device *dssdev)
 static int _taal_enable_te(struct omap_dss_device *dssdev, bool enable)
 {
 	struct taal_data *td = dev_get_drvdata(&dssdev->dev);
-	struct nokia_dsi_panel_data *panel_data = get_panel_data(dssdev);
+	struct panel_data *panel_data = get_panel_data(dssdev);
 	int r;
 
 	if (enable)
@@ -1453,7 +1447,7 @@ static void taal_esd_work(struct work_struct *work)
 	struct taal_data *td = container_of(work, struct taal_data,
 			esd_work.work);
 	struct omap_dss_device *dssdev = td->dssdev;
-	struct nokia_dsi_panel_data *panel_data = get_panel_data(dssdev);
+	struct panel_data *panel_data = get_panel_data(dssdev);
 	u8 state1, state2;
 	int r;
 
-- 
1.7.1

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

* [PATCH 2/3] OMAP: DSS2: Add generic panel display driver
  2010-11-05 19:43 [PATCH 0/3] OMAP: DSS2: introduce generic panel display driver (try #3) Bryan Wu
  2010-11-05 19:43 ` [PATCH 1/3] OMAP: use generic panel data in board files Bryan Wu
@ 2010-11-05 19:43 ` Bryan Wu
  2010-11-05 20:59   ` Taneja, Archit
  2010-11-05 19:43 ` [PATCH 3/3] OMAP: DSS2: remove generic DPI panel driver duplicated panel drivers Bryan Wu
  2 siblings, 1 reply; 16+ messages in thread
From: Bryan Wu @ 2010-11-05 19:43 UTC (permalink / raw)
  To: linux-arm-kernel

Generic panel driver includes the driver and 4 similar panel configurations. It
will match the panel name which is passed from platform data and setup the
right configurations.

With generic panel driver, we can remove those 4 duplicated panel display
drivers. In the future, it is simple for us just add new panel configuration
date in panel-generic.c to support new display panel.

Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
---
 drivers/video/omap2/displays/Kconfig     |    8 +
 drivers/video/omap2/displays/Makefile    |    1 +
 drivers/video/omap2/displays/panel-dpi.c |  306 ++++++++++++++++++++++++++++++
 3 files changed, 315 insertions(+), 0 deletions(-)
 create mode 100644 drivers/video/omap2/displays/panel-dpi.c

diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig
index 12327bb..9602d3f 100644
--- a/drivers/video/omap2/displays/Kconfig
+++ b/drivers/video/omap2/displays/Kconfig
@@ -1,6 +1,14 @@
 menu "OMAP2/3 Display Device Drivers"
         depends on OMAP2_DSS
 
+config PANEL_DPI
+        tristate "Generic DPI Panel"
+        help
+	  Generic DPI panel driver.
+	  Supports DVI output for Beagle and OMAP3 SDP.
+	  Supports LCD Panel used in TI SDP3430 and EVM boards,
+	  OMAP3517 EVM boards and CM-T35.
+
 config PANEL_GENERIC
         tristate "Generic Panel"
         help
diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile
index aa38609..1265772 100644
--- a/drivers/video/omap2/displays/Makefile
+++ b/drivers/video/omap2/displays/Makefile
@@ -1,3 +1,4 @@
+obj-$(CONFIG_PANEL_DPI) += panel-dpi.o
 obj-$(CONFIG_PANEL_GENERIC) += panel-generic.o
 obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o
 obj-$(CONFIG_PANEL_SHARP_LQ043T1DG01) += panel-sharp-lq043t1dg01.o
diff --git a/drivers/video/omap2/displays/panel-dpi.c b/drivers/video/omap2/displays/panel-dpi.c
new file mode 100644
index 0000000..1007ecb
--- /dev/null
+++ b/drivers/video/omap2/displays/panel-dpi.c
@@ -0,0 +1,306 @@
+/*
+ * Generic DPI Panels support
+ *
+ * Copyright (C) 2010 Canonical Ltd.
+ * Author: Bryan Wu <bryan.wu@canonical.com>
+ *
+ * Copyright (C) 2008 Nokia Corporation
+ * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+ *
+ * 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/delay.h>
+
+#include <plat/panel.h>
+
+struct panel_config {
+	struct omap_video_timings timings;
+
+	int acbi;	/* ac-bias pin transitions per interrupt */
+	/* Unit: line clocks */
+	int acb;	/* ac-bias pin frequency */
+
+	enum omap_panel_config config;
+
+	/*
+	 * Used to match device to panel configuration
+	 * when use generic panel driver
+	 */
+	const char *name;
+
+	int data_lines;
+};
+
+/* Panel configurations */
+static struct panel_config dpi_panels[] = {
+	/* Generic Panel */
+	{
+		{
+			.x_res		= 640,
+			.y_res		= 480,
+
+			.pixel_clock	= 23500,
+
+			.hfp		= 48,
+			.hsw		= 32,
+			.hbp		= 80,
+
+			.vfp		= 3,
+			.vsw		= 4,
+			.vbp		= 7,
+		},
+		.acbi			= 0x0,
+		.acb			= 0x0,
+		.config			= OMAP_DSS_LCD_TFT,
+		.name			= "generic",
+		.data_lines		= 24,
+	},
+
+	/* Sharp LQ043T1DG01 */
+	{
+		{
+			.x_res		= 480,
+			.y_res		= 272,
+
+			.pixel_clock	= 9000,
+
+			.hsw		= 42,
+			.hfp		= 3,
+			.hbp		= 2,
+
+			.vsw		= 11,
+			.vfp		= 3,
+			.vbp		= 2,
+		},
+		.acbi			= 0x0,
+		.acb			= 0x0,
+		.config			= OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |
+					OMAP_DSS_LCD_IHS | OMAP_DSS_LCD_IEO,
+		.name			= "sharp_lq",
+		.data_lines		= 16,
+	},
+
+	/* Sharp LS037V7DW01 */
+	{
+		{
+			.x_res		= 480,
+			.y_res		= 640,
+
+			.pixel_clock	= 19200,
+
+			.hsw		= 2,
+			.hfp		= 1,
+			.hbp		= 28,
+
+			.vsw		= 1,
+			.vfp		= 1,
+			.vbp		= 1,
+		},
+		.acbi			= 0x0,
+		.acb			= 0x28,
+		.config			= OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |
+						OMAP_DSS_LCD_IHS,
+		.name			= "sharp_ls",
+		.data_lines		= 16,
+	},
+
+	/* Toppoly TDO35S */
+	{
+		{
+			.x_res		= 480,
+			.y_res		= 640,
+
+			.pixel_clock	= 26000,
+
+			.hfp		= 104,
+			.hsw		= 8,
+			.hbp		= 8,
+
+			.vfp		= 4,
+			.vsw		= 2,
+			.vbp		= 2,
+		},
+		.acbi			= 0x0,
+		.acb			= 0x0,
+		.config			= OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |
+					OMAP_DSS_LCD_IHS | OMAP_DSS_LCD_IPC |
+					OMAP_DSS_LCD_ONOFF,
+		.name			= "toppoly_tdo35s",
+		.data_lines		= 18,
+	},
+};
+
+static int dpi_panel_power_on(struct omap_dss_device *dssdev)
+{
+	int r;
+
+	if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
+		return 0;
+
+	r = omapdss_dpi_display_enable(dssdev);
+	if (r)
+		goto err0;
+
+	if (dssdev->platform_enable) {
+		r = dssdev->platform_enable(dssdev);
+		if (r)
+			goto err1;
+	}
+
+	return 0;
+err1:
+	omapdss_dpi_display_disable(dssdev);
+err0:
+	return r;
+}
+
+static void dpi_panel_power_off(struct omap_dss_device *dssdev)
+{
+	if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
+		return;
+
+	if (dssdev->platform_disable)
+		dssdev->platform_disable(dssdev);
+
+	omapdss_dpi_display_disable(dssdev);
+}
+
+static int dpi_panel_probe(struct omap_dss_device *dssdev)
+{
+	struct panel_data *panel_data = get_panel_data(dssdev);
+	struct panel_config *panel_config = NULL;
+	int i;
+
+	dev_dbg(&dssdev->dev, "probe\n");
+
+	if (!panel_data || !panel_data->name)
+		return -EINVAL;
+
+	for (i = 0; i < ARRAY_SIZE(dpi_panels); i++) {
+		if (strcmp(panel_data->name, dpi_panels[i].name) == 0) {
+			panel_config = &dpi_panels[i];
+			break;
+		}
+	}
+
+	if (!panel_config)
+		return -EINVAL;
+
+	dssdev->type = OMAP_DISPLAY_TYPE_DPI;
+	dssdev->panel.config = panel_config->config;
+	dssdev->panel.timings = panel_config->timings;
+	dssdev->panel.acb = panel_config->acb;
+	dssdev->panel.acbi = panel_config->acbi;
+	dssdev->phy.dpi.data_lines = panel_config->data_lines;
+
+	return 0;
+}
+
+static void dpi_panel_remove(struct omap_dss_device *dssdev)
+{
+}
+
+static int dpi_panel_enable(struct omap_dss_device *dssdev)
+{
+	int r = 0;
+
+	r = dpi_panel_power_on(dssdev);
+	if (r)
+		return r;
+
+	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
+
+	return 0;
+}
+
+static void dpi_panel_disable(struct omap_dss_device *dssdev)
+{
+	dpi_panel_power_off(dssdev);
+
+	dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
+}
+
+static int dpi_panel_suspend(struct omap_dss_device *dssdev)
+{
+	dpi_panel_power_off(dssdev);
+
+	dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
+
+	return 0;
+}
+
+static int dpi_panel_resume(struct omap_dss_device *dssdev)
+{
+	int r = 0;
+
+	r = dpi_panel_power_on(dssdev);
+	if (r)
+		return r;
+
+	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
+
+	return 0;
+}
+
+static void dpi_panel_set_timings(struct omap_dss_device *dssdev,
+		struct omap_video_timings *timings)
+{
+	dpi_set_timings(dssdev, timings);
+}
+
+static void dpi_panel_get_timings(struct omap_dss_device *dssdev,
+		struct omap_video_timings *timings)
+{
+	*timings = dssdev->panel.timings;
+}
+
+static int dpi_panel_check_timings(struct omap_dss_device *dssdev,
+		struct omap_video_timings *timings)
+{
+	return dpi_check_timings(dssdev, timings);
+}
+
+static struct omap_dss_driver dpi_driver = {
+	.probe		= dpi_panel_probe,
+	.remove		= dpi_panel_remove,
+
+	.enable		= dpi_panel_enable,
+	.disable	= dpi_panel_disable,
+	.suspend	= dpi_panel_suspend,
+	.resume		= dpi_panel_resume,
+
+	.set_timings	= dpi_panel_set_timings,
+	.get_timings	= dpi_panel_get_timings,
+	.check_timings	= dpi_panel_check_timings,
+
+	.driver         = {
+		.name   = "dpi_panel",
+		.owner  = THIS_MODULE,
+	},
+};
+
+static int __init dpi_panel_drv_init(void)
+{
+	return omap_dss_register_driver(&dpi_driver);
+}
+
+static void __exit dpi_panel_drv_exit(void)
+{
+	omap_dss_unregister_driver(&dpi_driver);
+}
+
+module_init(dpi_panel_drv_init);
+module_exit(dpi_panel_drv_exit);
+MODULE_LICENSE("GPL");
-- 
1.7.1

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

* [PATCH 3/3] OMAP: DSS2: remove generic DPI panel driver duplicated panel drivers
  2010-11-05 19:43 [PATCH 0/3] OMAP: DSS2: introduce generic panel display driver (try #3) Bryan Wu
  2010-11-05 19:43 ` [PATCH 1/3] OMAP: use generic panel data in board files Bryan Wu
  2010-11-05 19:43 ` [PATCH 2/3] OMAP: DSS2: Add generic panel display driver Bryan Wu
@ 2010-11-05 19:43 ` Bryan Wu
  2 siblings, 0 replies; 16+ messages in thread
From: Bryan Wu @ 2010-11-05 19:43 UTC (permalink / raw)
  To: linux-arm-kernel

Still keep sharp_ls_panel driver, because it contains blacklight control driver.

Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
---
 drivers/video/omap2/displays/Kconfig               |   18 --
 drivers/video/omap2/displays/Makefile              |    3 -
 drivers/video/omap2/displays/panel-generic.c       |  174 --------------------
 .../video/omap2/displays/panel-sharp-lq043t1dg01.c |  165 -------------------
 .../video/omap2/displays/panel-toppoly-tdo35s.c    |  164 ------------------
 5 files changed, 0 insertions(+), 524 deletions(-)
 delete mode 100644 drivers/video/omap2/displays/panel-generic.c
 delete mode 100644 drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c
 delete mode 100644 drivers/video/omap2/displays/panel-toppoly-tdo35s.c

diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig
index 9602d3f..aab2819 100644
--- a/drivers/video/omap2/displays/Kconfig
+++ b/drivers/video/omap2/displays/Kconfig
@@ -9,12 +9,6 @@ config PANEL_DPI
 	  Supports LCD Panel used in TI SDP3430 and EVM boards,
 	  OMAP3517 EVM boards and CM-T35.
 
-config PANEL_GENERIC
-        tristate "Generic Panel"
-        help
-	  Generic panel driver.
-	  Used for DVI output for Beagle and OMAP3 SDP.
-
 config PANEL_SHARP_LS037V7DW01
         tristate "Sharp LS037V7DW01 LCD Panel"
         depends on OMAP2_DSS
@@ -22,24 +16,12 @@ config PANEL_SHARP_LS037V7DW01
         help
           LCD Panel used in TI's SDP3430 and EVM boards
 
-config PANEL_SHARP_LQ043T1DG01
-        tristate "Sharp LQ043T1DG01 LCD Panel"
-        depends on OMAP2_DSS
-        help
-          LCD Panel used in TI's OMAP3517 EVM boards
-
 config PANEL_TAAL
         tristate "Taal DSI Panel"
         depends on OMAP2_DSS_DSI
         help
           Taal DSI command mode panel from TPO.
 
-config PANEL_TOPPOLY_TDO35S
-        tristate "Toppoly TDO35S LCD Panel support"
-        depends on OMAP2_DSS
-        help
-          LCD Panel used in CM-T35
-
 config PANEL_TPO_TD043MTEA1
         tristate "TPO TD043MTEA1 LCD Panel"
         depends on OMAP2_DSS && SPI
diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile
index 1265772..f0947a7 100644
--- a/drivers/video/omap2/displays/Makefile
+++ b/drivers/video/omap2/displays/Makefile
@@ -1,9 +1,6 @@
 obj-$(CONFIG_PANEL_DPI) += panel-dpi.o
-obj-$(CONFIG_PANEL_GENERIC) += panel-generic.o
 obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o
-obj-$(CONFIG_PANEL_SHARP_LQ043T1DG01) += panel-sharp-lq043t1dg01.o
 
 obj-$(CONFIG_PANEL_TAAL) += panel-taal.o
-obj-$(CONFIG_PANEL_TOPPOLY_TDO35S) += panel-toppoly-tdo35s.o
 obj-$(CONFIG_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o
 obj-$(CONFIG_PANEL_ACX565AKM) += panel-acx565akm.o
diff --git a/drivers/video/omap2/displays/panel-generic.c b/drivers/video/omap2/displays/panel-generic.c
deleted file mode 100644
index 395a68d..0000000
--- a/drivers/video/omap2/displays/panel-generic.c
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Generic panel support
- *
- * Copyright (C) 2008 Nokia Corporation
- * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
- *
- * 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/delay.h>
-
-#include <plat/display.h>
-
-static struct omap_video_timings generic_panel_timings = {
-	/* 640 x 480 @ 60 Hz  Reduced blanking VESA CVT 0.31M3-R */
-	.x_res		= 640,
-	.y_res		= 480,
-	.pixel_clock	= 23500,
-	.hfp		= 48,
-	.hsw		= 32,
-	.hbp		= 80,
-	.vfp		= 3,
-	.vsw		= 4,
-	.vbp		= 7,
-};
-
-static int generic_panel_power_on(struct omap_dss_device *dssdev)
-{
-	int r;
-
-	if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
-		return 0;
-
-	r = omapdss_dpi_display_enable(dssdev);
-	if (r)
-		goto err0;
-
-	if (dssdev->platform_enable) {
-		r = dssdev->platform_enable(dssdev);
-		if (r)
-			goto err1;
-	}
-
-	return 0;
-err1:
-	omapdss_dpi_display_disable(dssdev);
-err0:
-	return r;
-}
-
-static void generic_panel_power_off(struct omap_dss_device *dssdev)
-{
-	if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
-		return;
-
-	if (dssdev->platform_disable)
-		dssdev->platform_disable(dssdev);
-
-	omapdss_dpi_display_disable(dssdev);
-}
-
-static int generic_panel_probe(struct omap_dss_device *dssdev)
-{
-	dssdev->panel.config = OMAP_DSS_LCD_TFT;
-	dssdev->panel.timings = generic_panel_timings;
-
-	return 0;
-}
-
-static void generic_panel_remove(struct omap_dss_device *dssdev)
-{
-}
-
-static int generic_panel_enable(struct omap_dss_device *dssdev)
-{
-	int r = 0;
-
-	r = generic_panel_power_on(dssdev);
-	if (r)
-		return r;
-
-	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
-
-	return 0;
-}
-
-static void generic_panel_disable(struct omap_dss_device *dssdev)
-{
-	generic_panel_power_off(dssdev);
-
-	dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
-}
-
-static int generic_panel_suspend(struct omap_dss_device *dssdev)
-{
-	generic_panel_power_off(dssdev);
-	dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
-	return 0;
-}
-
-static int generic_panel_resume(struct omap_dss_device *dssdev)
-{
-	int r = 0;
-
-	r = generic_panel_power_on(dssdev);
-	if (r)
-		return r;
-
-	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
-
-	return 0;
-}
-
-static void generic_panel_set_timings(struct omap_dss_device *dssdev,
-		struct omap_video_timings *timings)
-{
-	dpi_set_timings(dssdev, timings);
-}
-
-static void generic_panel_get_timings(struct omap_dss_device *dssdev,
-		struct omap_video_timings *timings)
-{
-	*timings = dssdev->panel.timings;
-}
-
-static int generic_panel_check_timings(struct omap_dss_device *dssdev,
-		struct omap_video_timings *timings)
-{
-	return dpi_check_timings(dssdev, timings);
-}
-
-static struct omap_dss_driver generic_driver = {
-	.probe		= generic_panel_probe,
-	.remove		= generic_panel_remove,
-
-	.enable		= generic_panel_enable,
-	.disable	= generic_panel_disable,
-	.suspend	= generic_panel_suspend,
-	.resume		= generic_panel_resume,
-
-	.set_timings	= generic_panel_set_timings,
-	.get_timings	= generic_panel_get_timings,
-	.check_timings	= generic_panel_check_timings,
-
-	.driver         = {
-		.name   = "generic_panel",
-		.owner  = THIS_MODULE,
-	},
-};
-
-static int __init generic_panel_drv_init(void)
-{
-	return omap_dss_register_driver(&generic_driver);
-}
-
-static void __exit generic_panel_drv_exit(void)
-{
-	omap_dss_unregister_driver(&generic_driver);
-}
-
-module_init(generic_panel_drv_init);
-module_exit(generic_panel_drv_exit);
-MODULE_LICENSE("GPL");
diff --git a/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c b/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c
deleted file mode 100644
index 0c6896c..0000000
--- a/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * LCD panel driver for Sharp LQ043T1DG01
- *
- * Copyright (C) 2009 Texas Instruments Inc
- * Author: Vaibhav Hiremath <hvaibhav@ti.com>
- *
- * 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/delay.h>
-#include <linux/device.h>
-#include <linux/err.h>
-
-#include <plat/display.h>
-
-static struct omap_video_timings sharp_lq_timings = {
-	.x_res = 480,
-	.y_res = 272,
-
-	.pixel_clock	= 9000,
-
-	.hsw		= 42,
-	.hfp		= 3,
-	.hbp		= 2,
-
-	.vsw		= 11,
-	.vfp		= 3,
-	.vbp		= 2,
-};
-
-static int sharp_lq_panel_power_on(struct omap_dss_device *dssdev)
-{
-	int r;
-
-	if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
-		return 0;
-
-	r = omapdss_dpi_display_enable(dssdev);
-	if (r)
-		goto err0;
-
-	/* wait couple of vsyncs until enabling the LCD */
-	msleep(50);
-
-	if (dssdev->platform_enable) {
-		r = dssdev->platform_enable(dssdev);
-		if (r)
-			goto err1;
-	}
-
-	return 0;
-err1:
-	omapdss_dpi_display_disable(dssdev);
-err0:
-	return r;
-}
-
-static void sharp_lq_panel_power_off(struct omap_dss_device *dssdev)
-{
-	if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
-		return;
-
-	if (dssdev->platform_disable)
-		dssdev->platform_disable(dssdev);
-
-	/* wait at least 5 vsyncs after disabling the LCD */
-	msleep(100);
-
-	omapdss_dpi_display_disable(dssdev);
-}
-
-static int sharp_lq_panel_probe(struct omap_dss_device *dssdev)
-{
-
-	dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |
-		OMAP_DSS_LCD_IHS | OMAP_DSS_LCD_IEO;
-	dssdev->panel.acb = 0x0;
-	dssdev->panel.timings = sharp_lq_timings;
-
-	return 0;
-}
-
-static void sharp_lq_panel_remove(struct omap_dss_device *dssdev)
-{
-}
-
-static int sharp_lq_panel_enable(struct omap_dss_device *dssdev)
-{
-	int r = 0;
-
-	r = sharp_lq_panel_power_on(dssdev);
-	if (r)
-		return r;
-
-	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
-
-	return 0;
-}
-
-static void sharp_lq_panel_disable(struct omap_dss_device *dssdev)
-{
-	sharp_lq_panel_power_off(dssdev);
-
-	dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
-}
-
-static int sharp_lq_panel_suspend(struct omap_dss_device *dssdev)
-{
-	sharp_lq_panel_power_off(dssdev);
-	dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
-	return 0;
-}
-
-static int sharp_lq_panel_resume(struct omap_dss_device *dssdev)
-{
-	int r = 0;
-
-	r = sharp_lq_panel_power_on(dssdev);
-	if (r)
-		return r;
-
-	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
-
-	return 0;
-}
-
-static struct omap_dss_driver sharp_lq_driver = {
-	.probe		= sharp_lq_panel_probe,
-	.remove		= sharp_lq_panel_remove,
-
-	.enable		= sharp_lq_panel_enable,
-	.disable	= sharp_lq_panel_disable,
-	.suspend	= sharp_lq_panel_suspend,
-	.resume		= sharp_lq_panel_resume,
-
-	.driver         = {
-		.name   = "sharp_lq_panel",
-		.owner  = THIS_MODULE,
-	},
-};
-
-static int __init sharp_lq_panel_drv_init(void)
-{
-	return omap_dss_register_driver(&sharp_lq_driver);
-}
-
-static void __exit sharp_lq_panel_drv_exit(void)
-{
-	omap_dss_unregister_driver(&sharp_lq_driver);
-}
-
-module_init(sharp_lq_panel_drv_init);
-module_exit(sharp_lq_panel_drv_exit);
-MODULE_LICENSE("GPL");
diff --git a/drivers/video/omap2/displays/panel-toppoly-tdo35s.c b/drivers/video/omap2/displays/panel-toppoly-tdo35s.c
deleted file mode 100644
index 526e906..0000000
--- a/drivers/video/omap2/displays/panel-toppoly-tdo35s.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * LCD panel driver for Toppoly TDO35S
- *
- * Copyright (C) 2009 CompuLab, Ltd.
- * Author: Mike Rapoport <mike@compulab.co.il>
- *
- * Based on generic panel support
- * Copyright (C) 2008 Nokia Corporation
- * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
- *
- * 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/delay.h>
-
-#include <plat/display.h>
-
-static struct omap_video_timings toppoly_tdo_panel_timings = {
-	/* 640 x 480 @ 60 Hz  Reduced blanking VESA CVT 0.31M3-R */
-	.x_res		= 480,
-	.y_res		= 640,
-
-	.pixel_clock	= 26000,
-
-	.hfp		= 104,
-	.hsw		= 8,
-	.hbp		= 8,
-
-	.vfp		= 4,
-	.vsw		= 2,
-	.vbp		= 2,
-};
-
-static int toppoly_tdo_panel_power_on(struct omap_dss_device *dssdev)
-{
-	int r;
-
-	if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
-		return 0;
-
-	r = omapdss_dpi_display_enable(dssdev);
-	if (r)
-		goto err0;
-
-	if (dssdev->platform_enable) {
-		r = dssdev->platform_enable(dssdev);
-		if (r)
-			goto err1;
-	}
-
-	return 0;
-err1:
-	omapdss_dpi_display_disable(dssdev);
-err0:
-	return r;
-}
-
-static void toppoly_tdo_panel_power_off(struct omap_dss_device *dssdev)
-{
-	if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
-		return;
-
-	if (dssdev->platform_disable)
-		dssdev->platform_disable(dssdev);
-
-	omapdss_dpi_display_disable(dssdev);
-}
-
-static int toppoly_tdo_panel_probe(struct omap_dss_device *dssdev)
-{
-	dssdev->panel.config = OMAP_DSS_LCD_TFT |
-			       OMAP_DSS_LCD_IVS |
-			       OMAP_DSS_LCD_IHS |
-			       OMAP_DSS_LCD_IPC |
-			       OMAP_DSS_LCD_ONOFF;
-
-	dssdev->panel.timings = toppoly_tdo_panel_timings;
-
-	return 0;
-}
-
-static void toppoly_tdo_panel_remove(struct omap_dss_device *dssdev)
-{
-}
-
-static int toppoly_tdo_panel_enable(struct omap_dss_device *dssdev)
-{
-	int r = 0;
-
-	r = toppoly_tdo_panel_power_on(dssdev);
-	if (r)
-		return r;
-
-	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
-
-	return 0;
-}
-
-static void toppoly_tdo_panel_disable(struct omap_dss_device *dssdev)
-{
-	toppoly_tdo_panel_power_off(dssdev);
-
-	dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
-}
-
-static int toppoly_tdo_panel_suspend(struct omap_dss_device *dssdev)
-{
-	toppoly_tdo_panel_power_off(dssdev);
-	dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
-	return 0;
-}
-
-static int toppoly_tdo_panel_resume(struct omap_dss_device *dssdev)
-{
-	int r = 0;
-
-	r = toppoly_tdo_panel_power_on(dssdev);
-	if (r)
-		return r;
-
-	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
-
-	return 0;
-}
-
-static struct omap_dss_driver generic_driver = {
-	.probe		= toppoly_tdo_panel_probe,
-	.remove		= toppoly_tdo_panel_remove,
-
-	.enable		= toppoly_tdo_panel_enable,
-	.disable	= toppoly_tdo_panel_disable,
-	.suspend	= toppoly_tdo_panel_suspend,
-	.resume		= toppoly_tdo_panel_resume,
-
-	.driver         = {
-		.name   = "toppoly_tdo35s_panel",
-		.owner  = THIS_MODULE,
-	},
-};
-
-static int __init toppoly_tdo_panel_drv_init(void)
-{
-	return omap_dss_register_driver(&generic_driver);
-}
-
-static void __exit toppoly_tdo_panel_drv_exit(void)
-{
-	omap_dss_unregister_driver(&generic_driver);
-}
-
-module_init(toppoly_tdo_panel_drv_init);
-module_exit(toppoly_tdo_panel_drv_exit);
-MODULE_LICENSE("GPL");
-- 
1.7.1

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

* [PATCH 2/3] OMAP: DSS2: Add generic panel display driver
  2010-11-05 19:43 ` [PATCH 2/3] OMAP: DSS2: Add generic panel display driver Bryan Wu
@ 2010-11-05 20:59   ` Taneja, Archit
  0 siblings, 0 replies; 16+ messages in thread
From: Taneja, Archit @ 2010-11-05 20:59 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

linux-omap-owner at vger.kernel.org wrote:
> Generic panel driver includes the driver and 4 similar panel
> configurations. It will match the panel name which is passed
> from platform data and setup the right configurations.
> 
> With generic panel driver, we can remove those 4 duplicated
> panel display drivers. In the future, it is simple for us
> just add new panel configuration date in panel-generic.c to
> support new display panel.
> 
> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
> ---

[snip]

> +++ b/drivers/video/omap2/displays/panel-dpi.c
> @@ -0,0 +1,306 @@
> +/*
> + * Generic DPI Panels support
> + *
> + * Copyright (C) 2010 Canonical Ltd.
> + * Author: Bryan Wu <bryan.wu@canonical.com>
> + *
> + * Copyright (C) 2008 Nokia Corporation
> + * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com> + *
> + * 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/delay.h>
> +
> +#include <plat/panel.h>
> +
> +struct panel_config {
> +	struct omap_video_timings timings;
> +
> +	int acbi;	/* ac-bias pin transitions per interrupt */ +	/* Unit: line
> clocks */ +	int acb;	/* ac-bias pin frequency */
> +
> +	enum omap_panel_config config;
> +
> +	/*
> +	 * Used to match device to panel configuration
> +	 * when use generic panel driver
> +	 */
> +	const char *name;
> +
> +	int data_lines;
> +};

You can add the power_on_delay and power_off_delay members out here and
probably other panel specific things too.

The name panel-dpi.c is slightly misleading since this driver doesn't cover
all dpi panels. Probably something like genric-dpi-panel.c with functions like
generic_dpi_panel_power_on() would cover all the dummy dpi panels.

> +
> +/* Panel configurations */
> +static struct panel_config dpi_panels[] = {
> +	/* Generic Panel */
> +	{
> +		{
> +			.x_res		= 640,
> +			.y_res		= 480,
> +
> +			.pixel_clock	= 23500,
> +
> +			.hfp		= 48,
> +			.hsw		= 32,
> +			.hbp		= 80,
> +
> +			.vfp		= 3,
> +			.vsw		= 4,
> +			.vbp		= 7,
> +		},
> +		.acbi			= 0x0,
> +		.acb			= 0x0,
> +		.config			= OMAP_DSS_LCD_TFT,
> +		.name			= "generic",
> +		.data_lines		= 24,
> +	},
> +
> +	/* Sharp LQ043T1DG01 */
> +	{
> +		{
> +			.x_res		= 480,
> +			.y_res		= 272,
> +
> +			.pixel_clock	= 9000,
> +
> +			.hsw		= 42,
> +			.hfp		= 3,
> +			.hbp		= 2,
> +
> +			.vsw		= 11,
> +			.vfp		= 3,
> +			.vbp		= 2,
> +		},
> +		.acbi			= 0x0,
> +		.acb			= 0x0,
> +		.config			= OMAP_DSS_LCD_TFT |
> OMAP_DSS_LCD_IVS |
> +					OMAP_DSS_LCD_IHS |
> OMAP_DSS_LCD_IEO,
> +		.name			= "sharp_lq",
> +		.data_lines		= 16,
> +	},
> +
> +	/* Sharp LS037V7DW01 */
> +	{
> +		{
> +			.x_res		= 480,
> +			.y_res		= 640,
> +
> +			.pixel_clock	= 19200,
> +
> +			.hsw		= 2,
> +			.hfp		= 1,
> +			.hbp		= 28,
> +
> +			.vsw		= 1,
> +			.vfp		= 1,
> +			.vbp		= 1,
> +		},
> +		.acbi			= 0x0,
> +		.acb			= 0x28,
> +		.config			= OMAP_DSS_LCD_TFT |
> OMAP_DSS_LCD_IVS |
> +						OMAP_DSS_LCD_IHS,
> +		.name			= "sharp_ls",
> +		.data_lines		= 16,
> +	},
> +
> +	/* Toppoly TDO35S */
> +	{
> +		{
> +			.x_res		= 480,
> +			.y_res		= 640,
> +
> +			.pixel_clock	= 26000,
> +
> +			.hfp		= 104,
> +			.hsw		= 8,
> +			.hbp		= 8,
> +
> +			.vfp		= 4,
> +			.vsw		= 2,
> +			.vbp		= 2,
> +		},
> +		.acbi			= 0x0,
> +		.acb			= 0x0,
> +		.config			= OMAP_DSS_LCD_TFT |
> OMAP_DSS_LCD_IVS |
> +					OMAP_DSS_LCD_IHS |
> OMAP_DSS_LCD_IPC |
> +					OMAP_DSS_LCD_ONOFF,
> +		.name			= "toppoly_tdo35s",
> +		.data_lines		= 18,
> +	},
> +};
> +
> +static int dpi_panel_power_on(struct omap_dss_device *dssdev) { +	int r;
> +
> +	if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
> +		return 0;
> +
> +	r = omapdss_dpi_display_enable(dssdev);
> +	if (r)
> +		goto err0;
> +
> +	if (dssdev->platform_enable) {
> +		r = dssdev->platform_enable(dssdev);
> +		if (r)
> +			goto err1;
> +	}
> +
> +	return 0;
> +err1:
> +	omapdss_dpi_display_disable(dssdev);
> +err0:
> +	return r;
> +}
> +
> +static void dpi_panel_power_off(struct omap_dss_device *dssdev) {
> +	if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
> +		return;
> +
> +	if (dssdev->platform_disable)
> +		dssdev->platform_disable(dssdev);
> +
> +	omapdss_dpi_display_disable(dssdev);
> +}
> +
> +static int dpi_panel_probe(struct omap_dss_device *dssdev) {
> +	struct panel_data *panel_data = get_panel_data(dssdev);
> +	struct panel_config *panel_config = NULL;
> +	int i;
> +
> +	dev_dbg(&dssdev->dev, "probe\n");
> +
> +	if (!panel_data || !panel_data->name)
> +		return -EINVAL;
> +
> +	for (i = 0; i < ARRAY_SIZE(dpi_panels); i++) {
> +		if (strcmp(panel_data->name, dpi_panels[i].name) == 0) {
> +			panel_config = &dpi_panels[i];
> +			break;
> +		}
> +	}
> +
> +	if (!panel_config)
> +		return -EINVAL;
> +
> +	dssdev->type = OMAP_DISPLAY_TYPE_DPI;
> +	dssdev->panel.config = panel_config->config;
> +	dssdev->panel.timings = panel_config->timings;
> +	dssdev->panel.acb = panel_config->acb;
> +	dssdev->panel.acbi = panel_config->acbi;
> +	dssdev->phy.dpi.data_lines = panel_config->data_lines; +
> +	return 0;
> +}
> +
> +static void dpi_panel_remove(struct omap_dss_device *dssdev) { } +
> +static int dpi_panel_enable(struct omap_dss_device *dssdev) { +	int r = 0;
> +
> +	r = dpi_panel_power_on(dssdev);
> +	if (r)
> +		return r;
> +
> +	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
> +
> +	return 0;
> +}
> +
> +static void dpi_panel_disable(struct omap_dss_device *dssdev) {
> +	dpi_panel_power_off(dssdev);
> +
> +	dssdev->state = OMAP_DSS_DISPLAY_DISABLED; }
> +
> +static int dpi_panel_suspend(struct omap_dss_device *dssdev) {
> +	dpi_panel_power_off(dssdev);
> +
> +	dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
> +
> +	return 0;
> +}
> +
> +static int dpi_panel_resume(struct omap_dss_device *dssdev) { +	int r = 0;
> +
> +	r = dpi_panel_power_on(dssdev);
> +	if (r)
> +		return r;
> +
> +	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
> +
> +	return 0;
> +}
> +
> +static void dpi_panel_set_timings(struct omap_dss_device *dssdev,
> +		struct omap_video_timings *timings)
> +{
> +	dpi_set_timings(dssdev, timings);
> +}
> +
> +static void dpi_panel_get_timings(struct omap_dss_device *dssdev,
> +		struct omap_video_timings *timings)
> +{
> +	*timings = dssdev->panel.timings;
> +}
> +
> +static int dpi_panel_check_timings(struct omap_dss_device *dssdev,
> +		struct omap_video_timings *timings)
> +{
> +	return dpi_check_timings(dssdev, timings); }
> +
> +static struct omap_dss_driver dpi_driver = {
> +	.probe		= dpi_panel_probe,
> +	.remove		= dpi_panel_remove,
> +
> +	.enable		= dpi_panel_enable,
> +	.disable	= dpi_panel_disable,
> +	.suspend	= dpi_panel_suspend,
> +	.resume		= dpi_panel_resume,
> +
> +	.set_timings	= dpi_panel_set_timings,
> +	.get_timings	= dpi_panel_get_timings,
> +	.check_timings	= dpi_panel_check_timings,
> +
> +	.driver         = {
> +		.name   = "dpi_panel",
> +		.owner  = THIS_MODULE,
> +	},
> +};
> +
> +static int __init dpi_panel_drv_init(void) {
> +	return omap_dss_register_driver(&dpi_driver);
> +}
> +
> +static void __exit dpi_panel_drv_exit(void) {
> +	omap_dss_unregister_driver(&dpi_driver);
> +}
> +
> +module_init(dpi_panel_drv_init);
> +module_exit(dpi_panel_drv_exit);
> +MODULE_LICENSE("GPL");
> --
> 1.7.1

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

* [PATCH 1/3] OMAP: use generic panel data in board files
  2010-11-05 19:43 ` [PATCH 1/3] OMAP: use generic panel data in board files Bryan Wu
@ 2010-11-05 21:17   ` Taneja, Archit
  2010-11-08 12:19     ` Tomi Valkeinen
  2010-11-08 12:26   ` Tomi Valkeinen
  1 sibling, 1 reply; 16+ messages in thread
From: Taneja, Archit @ 2010-11-05 21:17 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

linux-omap-owner at vger.kernel.org wrote:
> Introduce struct panel config data in panel.h, which will be
> used to match the right panel configurations in generic DPI
> panel driver and other future dsi panel drivers.
>
> Still keep sharp_ls_panel, since the sharp_ls_panel driver
> contains blacklight control driver code which will be moved
> out later. Then we can use generic DPI driver for sharp_ls_panel.
>
> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
> ---
>  arch/arm/mach-omap2/board-3430sdp.c               |   10 +++-
>  arch/arm/mach-omap2/board-am3517evm.c             |   19 +++++--
>  arch/arm/mach-omap2/board-cm-t35.c                |   19 +++++--
>  arch/arm/mach-omap2/board-devkit8000.c            |   22 +++++---
>  arch/arm/mach-omap2/board-igep0020.c              |   10 +++-
>  arch/arm/mach-omap2/board-omap3beagle.c           |   10 +++-
>  arch/arm/mach-omap2/board-omap3evm.c              |   10 +++-
>  arch/arm/mach-omap2/board-omap3stalker.c          |   19 +++++--
>  arch/arm/plat-omap/include/plat/nokia-dsi-panel.h |   31 -----------
>  arch/arm/plat-omap/include/plat/panel.h           |   57
>  +++++++++++++++++++++ drivers/video/omap2/displays/panel-taal.c         |
>  26 ++++------ 11 files changed, 148 insertions(+), 85 deletions(-)  delete
> mode 100644 arch/arm/plat-omap/include/plat/nokia-dsi-panel.h
>  create mode 100644 arch/arm/plat-omap/include/plat/panel.h

I am not totally sure about the need of removal of nokia-dsi-panel.h
and the addition of a generic panel.h.

I guess the reason why nokia-dsi-panel.h was introduced (and others that
will be introduced in future) was to easily represent panel-specific data
across different boards that use the same panel.

For example, if there is a new panel which for some reson uses 2 pins, one
for switching off and one for switching on the panel, then it would make sense
to introduce a structure for this panel having members on_gpio and off_gpio, this
struct could then be passed and accessed through dssdev->data in the panel's probe
giving us the option to have different gpio numbers for different boards but finally
being accessed in the same way by the driver.

So, there isn't a need to generalize this struct and the corresponding header file
for all panels and make it available for all board files.

As far as the dummy panels are concerned, since the "name" is the only criteria to
differentiate the panel, I think passing the name to the data member of omap_dss_device
should itself be enough for the generic dpi driver to handle things.

>
> diff --git a/arch/arm/mach-omap2/board-3430sdp.c
> b/arch/arm/mach-omap2/board-3430sdp.c
> index 4e3742c..859b4e5 100644
> --- a/arch/arm/mach-omap2/board-3430sdp.c
> +++ b/arch/arm/mach-omap2/board-3430sdp.c
> @@ -38,6 +38,7 @@
>  #include <plat/dma.h>
>  #include <plat/gpmc.h>
>  #include <plat/display.h>
> +#include <plat/panel.h>
>
>  #include <plat/gpmc-smc91x.h>
>
> @@ -270,11 +271,14 @@ static struct omap_dss_device sdp3430_lcd_device = {
>       .platform_disable       = sdp3430_panel_disable_lcd,
>  };
>
> +static struct panel_data dvi_panel = {
> +     .name           = "generic",
> +};
> +
>  static struct omap_dss_device sdp3430_dvi_device = {         .name                   = "dvi",
> -     .driver_name            = "generic_panel",
> -     .type                   = OMAP_DISPLAY_TYPE_DPI,
> -     .phy.dpi.data_lines     = 24,
> +     .driver_name            = "dpi_panel",
> +     .data                   = &dvi_panel,
>       .platform_enable        = sdp3430_panel_enable_dvi,
>       .platform_disable       = sdp3430_panel_disable_dvi,
>  };
> diff --git a/arch/arm/mach-omap2/board-am3517evm.c
> b/arch/arm/mach-omap2/board-am3517evm.c
> index 0739950..9b2b6ff 100644
> --- a/arch/arm/mach-omap2/board-am3517evm.c
> +++ b/arch/arm/mach-omap2/board-am3517evm.c
> @@ -35,6 +35,7 @@
>  #include <plat/common.h>
>  #include <plat/usb.h>
>  #include <plat/display.h>
> +#include <plat/panel.h>
>
>  #include "mux.h"
>  #include "control.h"
> @@ -303,11 +304,14 @@ static void
> am3517_evm_panel_disable_lcd(struct omap_dss_device *dssdev)          lcd_enabled =
>  0; }
>
> +static struct panel_data lcd_panel = {
> +     .name           = "sharp_lq",
> +};
> +
>  static struct omap_dss_device am3517_evm_lcd_device = {
> -     .type                   = OMAP_DISPLAY_TYPE_DPI,
>       .name                   = "lcd",
> -     .driver_name            = "sharp_lq_panel",
> -     .phy.dpi.data_lines     = 16,
> +     .driver_name            = "dpi_panel",
> +     .data                   = &lcd_panel,
>       .platform_enable        = am3517_evm_panel_enable_lcd,
>       .platform_disable       = am3517_evm_panel_disable_lcd,  };
> @@ -346,11 +350,14 @@ static void
> am3517_evm_panel_disable_dvi(struct omap_dss_device *dssdev)          dvi_enabled =
>  0; }
>
> +static struct panel_data dvi_panel = {
> +     .name           = "generic",
> +};
> +
>  static struct omap_dss_device am3517_evm_dvi_device = {
> -     .type                   = OMAP_DISPLAY_TYPE_DPI,
>       .name                   = "dvi",
> -     .driver_name            = "generic_panel",
> -     .phy.dpi.data_lines     = 24,
> +     .driver_name            = "dpi_panel",
> +     .data                   = &dvi_panel,
>       .platform_enable        = am3517_evm_panel_enable_dvi,
>       .platform_disable       = am3517_evm_panel_disable_dvi,  };
> diff --git a/arch/arm/mach-omap2/board-cm-t35.c
> b/arch/arm/mach-omap2/board-cm-t35.c
> index 63f764e..326aa15 100644
> --- a/arch/arm/mach-omap2/board-cm-t35.c
> +++ b/arch/arm/mach-omap2/board-cm-t35.c
> @@ -46,6 +46,7 @@
>  #include <plat/gpmc.h>
>  #include <plat/usb.h>
>  #include <plat/display.h>
> +#include <plat/panel.h>
>  #include <plat/mcspi.h>
>
>  #include <mach/hardware.h>
> @@ -351,20 +352,26 @@ static void
> cm_t35_panel_disable_tv(struct omap_dss_device *dssdev)  {  }
>
> +static struct panel_data lcd_panel = {
> +     .name           = "toppoly_tdo35s",
> +};
> +
>  static struct omap_dss_device cm_t35_lcd_device = {          .name                   = "lcd",
> -     .driver_name            = "toppoly_tdo35s_panel",
> -     .type                   = OMAP_DISPLAY_TYPE_DPI,
> -     .phy.dpi.data_lines     = 18,
> +     .driver_name            = "dpi_panel",
> +     .data                   = &lcd_panel,
>       .platform_enable        = cm_t35_panel_enable_lcd,
>       .platform_disable       = cm_t35_panel_disable_lcd,
>  };
>
> +static struct panel_data dvi_panel = {
> +     .name           = "generic",
> +};
> +
>  static struct omap_dss_device cm_t35_dvi_device = {          .name                   = "dvi",
> -     .driver_name            = "generic_panel",
> -     .type                   = OMAP_DISPLAY_TYPE_DPI,
> -     .phy.dpi.data_lines     = 24,
> +     .driver_name            = "dpi_panel",
> +     .data                   = &dvi_panel,
>       .platform_enable        = cm_t35_panel_enable_dvi,
>       .platform_disable       = cm_t35_panel_disable_dvi,
>  };
> diff --git a/arch/arm/mach-omap2/board-devkit8000.c
> b/arch/arm/mach-omap2/board-devkit8000.c
> index 067f437..c38ece3 100644
> --- a/arch/arm/mach-omap2/board-devkit8000.c
> +++ b/arch/arm/mach-omap2/board-devkit8000.c
> @@ -46,6 +46,7 @@
>  #include <plat/nand.h>
>  #include <plat/usb.h>
>  #include <plat/display.h>
> +#include <plat/panel.h>
>
>  #include <plat/mcspi.h>
>  #include <linux/input/matrix_keypad.h>
> @@ -149,21 +150,26 @@ static struct regulator_consumer_supply
> devkit8000_vmmc1_supply =  static struct
> regulator_consumer_supply devkit8000_vio_supply =
>       REGULATOR_SUPPLY("vcc", "spi2.0");
>
> +static struct panel_data lcd_panel = {
> +     .name           = "generic",
> +};
> +
>  static struct omap_dss_device devkit8000_lcd_device = {
>       .name                   = "lcd",
> -     .driver_name            = "generic_panel",
> -     .type                   = OMAP_DISPLAY_TYPE_DPI,
> -     .phy.dpi.data_lines     = 24,
> -     .reset_gpio             = -EINVAL, /* will be replaced */
> +     .driver_name            = "dpi_panel",
> +     .data                   = &lcd_panel,
>       .platform_enable        = devkit8000_panel_enable_lcd,
>       .platform_disable       = devkit8000_panel_disable_lcd,  };
> +
> +static struct panel_data dvi_panel = {
> +     .name           = "generic",
> +};
> +
>  static struct omap_dss_device devkit8000_dvi_device = {
>       .name                   = "dvi",
> -     .driver_name            = "generic_panel",
> -     .type                   = OMAP_DISPLAY_TYPE_DPI,
> -     .phy.dpi.data_lines     = 24,
> -     .reset_gpio             = -EINVAL, /* will be replaced */
> +     .driver_name            = "dpi_panel",
> +     .data                   = &dvi_panel,
>       .platform_enable        = devkit8000_panel_enable_dvi,
>       .platform_disable       = devkit8000_panel_disable_dvi,  };
> diff --git a/arch/arm/mach-omap2/board-igep0020.c
> b/arch/arm/mach-omap2/board-igep0020.c
> index 5e035a5..c2475bb 100644
> --- a/arch/arm/mach-omap2/board-igep0020.c
> +++ b/arch/arm/mach-omap2/board-igep0020.c
> @@ -30,6 +30,7 @@
>  #include <plat/gpmc.h>
>  #include <plat/usb.h>
>  #include <plat/display.h>
> +#include <plat/panel.h>
>  #include <plat/onenand.h>
>
>  #include "mux.h"
> @@ -433,11 +434,14 @@ static void igep2_disable_dvi(struct omap_dss_device
>       *dssdev) gpio_direction_output(IGEP2_GPIO_DVI_PUP, 0);  }
>
> +static struct panel_data dvi_panel = {
> +     .name           = "generic",
> +};
> +
>  static struct omap_dss_device igep2_dvi_device = {
> -     .type                   = OMAP_DISPLAY_TYPE_DPI,
>       .name                   = "dvi",
> -     .driver_name            = "generic_panel",
> -     .phy.dpi.data_lines     = 24,
> +     .driver_name            = "dpi_panel",
> +     .data                   = &dvi_panel,
>       .platform_enable        = igep2_enable_dvi,
>       .platform_disable       = igep2_disable_dvi,
>  };
> diff --git a/arch/arm/mach-omap2/board-omap3beagle.c
> b/arch/arm/mach-omap2/board-omap3beagle.c
> index 14f4224..1d2a634 100644
> --- a/arch/arm/mach-omap2/board-omap3beagle.c
> +++ b/arch/arm/mach-omap2/board-omap3beagle.c
> @@ -41,6 +41,7 @@
>  #include <plat/board.h>
>  #include <plat/common.h>
>  #include <plat/display.h>
> +#include <plat/panel.h>
>  #include <plat/gpmc.h>
>  #include <plat/nand.h>
>  #include <plat/usb.h>
> @@ -194,11 +195,14 @@ static void beagle_disable_dvi(struct omap_dss_device
>               *dssdev) gpio_set_value(dssdev->reset_gpio, 0);  }
>
> +static struct panel_data dvi_panel = {
> +     .name = "generic",
> +};
> +
>  static struct omap_dss_device beagle_dvi_device = {
> -     .type = OMAP_DISPLAY_TYPE_DPI,
>       .name = "dvi",
> -     .driver_name = "generic_panel",
> -     .phy.dpi.data_lines = 24,
> +     .driver_name = "dpi_panel",
> +     .data = &dvi_panel,
>       .reset_gpio = 170,
>       .platform_enable = beagle_enable_dvi,
>       .platform_disable = beagle_disable_dvi, diff --git
> a/arch/arm/mach-omap2/board-omap3evm.c
> b/arch/arm/mach-omap2/board-omap3evm.c
> index b04365c..981de08 100644
> --- a/arch/arm/mach-omap2/board-omap3evm.c
> +++ b/arch/arm/mach-omap2/board-omap3evm.c
> @@ -43,6 +43,7 @@
>  #include <plat/common.h>
>  #include <plat/mcspi.h>
>  #include <plat/display.h>
> +#include <plat/panel.h>
>
>  #include "mux.h"
>  #include "sdram-micron-mt46h32m32lf-6.h"
> @@ -301,11 +302,14 @@ static void
> omap3_evm_disable_dvi(struct omap_dss_device *dssdev)         dvi_enabled = 0;
>  }
>
> +static struct panel_data dvi_panel = {
> +     .name =         "generic",
> +};
> +
>  static struct omap_dss_device omap3_evm_dvi_device = {       .name                   = "dvi",
> -     .driver_name            = "generic_panel",
> -     .type                   = OMAP_DISPLAY_TYPE_DPI,
> -     .phy.dpi.data_lines     = 24,
> +     .driver_name            = "dpi_panel",
> +     .data                   = &dvi_panel,
>       .platform_enable        = omap3_evm_enable_dvi,
>       .platform_disable       = omap3_evm_disable_dvi,
>  };
> diff --git a/arch/arm/mach-omap2/board-omap3stalker.c
> b/arch/arm/mach-omap2/board-omap3stalker.c
> index f252721..85bcfd6 100644
> --- a/arch/arm/mach-omap2/board-omap3stalker.c
> +++ b/arch/arm/mach-omap2/board-omap3stalker.c
> @@ -40,6 +40,7 @@
>  #include <plat/nand.h>
>  #include <plat/usb.h>
>  #include <plat/display.h>
> +#include <plat/panel.h>
>
>  #include <plat/mcspi.h>
>  #include <linux/input/matrix_keypad.h>
> @@ -160,11 +161,14 @@ static void
> omap3_stalker_disable_lcd(struct omap_dss_device *dssdev)     lcd_enabled = 0;
>  }
>
> +static struct panel_data lcd_panel = {
> +     .name           = "generic",
> +};
> +
>  static struct omap_dss_device omap3_stalker_lcd_device = {   .name                   = "lcd",
> -     .driver_name            = "generic_panel",
> -     .phy.dpi.data_lines     = 24,
> -     .type                   = OMAP_DISPLAY_TYPE_DPI,
> +     .driver_name            = "dpi_panel",
> +     .data                   = &lcd_panel,
>       .platform_enable        = omap3_stalker_enable_lcd,
>       .platform_disable       = omap3_stalker_disable_lcd,
>  };
> @@ -208,11 +212,14 @@ static void
> omap3_stalker_disable_dvi(struct omap_dss_device *dssdev)     dvi_enabled = 0;
>  }
>
> +static struct panel_data dvi_panel = {
> +     .name           = "generic",
> +};
> +
>  static struct omap_dss_device omap3_stalker_dvi_device = {   .name                   = "dvi",
> -     .driver_name            = "generic_panel",
> -     .type                   = OMAP_DISPLAY_TYPE_DPI,
> -     .phy.dpi.data_lines     = 24,
> +     .driver_name            = "dpi_panel",
> +     .data                   = &dvi_panel,
>       .platform_enable        = omap3_stalker_enable_dvi,
>       .platform_disable       = omap3_stalker_disable_dvi,
>  };
> diff --git
> a/arch/arm/plat-omap/include/plat/nokia-dsi-panel.h
> b/arch/arm/plat-omap/include/plat/nokia-dsi-panel.h
> deleted file mode 100644
> index 01ab657..0000000
> --- a/arch/arm/plat-omap/include/plat/nokia-dsi-panel.h +++ /dev/null
> @@ -1,31 +0,0 @@
> -#ifndef __ARCH_ARM_PLAT_OMAP_NOKIA_DSI_PANEL_H
> -#define __ARCH_ARM_PLAT_OMAP_NOKIA_DSI_PANEL_H
> -
> -#include "display.h"
> -
> -/**
> - * struct nokia_dsi_panel_data - Nokia DSI panel driver configuration
> - * @name: panel name
> - * @use_ext_te: use external TE
> - * @ext_te_gpio: external TE GPIO
> - * @use_esd_check: perform ESD checks
> - * @max_backlight_level: maximum backlight level
> - * @set_backlight: pointer to backlight set function
> - * @get_backlight: pointer to backlight get function
> - */
> -struct nokia_dsi_panel_data {
> -     const char *name;
> -
> -     int reset_gpio;
> -
> -     bool use_ext_te;
> -     int ext_te_gpio;
> -
> -     bool use_esd_check;
> -
> -     int max_backlight_level;
> -     int (*set_backlight)(struct omap_dss_device *dssdev, int level);
> -     int (*get_backlight)(struct omap_dss_device *dssdev);
> -};
> -
> -#endif /* __ARCH_ARM_PLAT_OMAP_NOKIA_DSI_PANEL_H */ diff
> --git a/arch/arm/plat-omap/include/plat/panel.h
> b/arch/arm/plat-omap/include/plat/panel.h
> new file mode 100644
> index 0000000..84c6ffd
> --- /dev/null
> +++ b/arch/arm/plat-omap/include/plat/panel.h
> @@ -0,0 +1,57 @@
> +/*
> + * Header for panel driver
> + *
> + * Copyright (C) 2010 Canonical Ltd.
> + * Author: Bryan Wu <bryan.wu@canonical.com>
> + *
> + * 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 __ARCH_ARM_PLAT_OMAP_PANEL_H
> +#define __ARCH_ARM_PLAT_OMAP_PANEL_H
> +
> +#include "display.h"
> +
> +/**
> + * struct panel_data - panel driver configuration
> + * @name: panel name
> + * @use_ext_te: use external TE
> + * @ext_te_gpio: external TE GPIO
> + * @use_esd_check: perform ESD checks
> + * @max_backlight_level: maximum backlight level
> + * @set_backlight: pointer to backlight set function
> + * @get_backlight: pointer to backlight get function  */ struct +panel_data {
> +     const char *name;
> +
> +     int reset_gpio;
> +
> +     bool use_ext_te;
> +     int ext_te_gpio;
> +
> +     bool use_esd_check;
> +
> +     int max_backlight_level;
> +     int (*set_backlight)(struct omap_dss_device *dssdev, int level);
> +     int (*get_backlight)(struct omap_dss_device *dssdev); }; +
> +static inline struct panel_data
> +*get_panel_data(const struct omap_dss_device *dssdev) {
> +     return (struct panel_data *) dssdev->data; }
> +
> +
> +#endif /* __ARCH_ARM_PLAT_OMAP_PANEL_H */
> diff --git a/drivers/video/omap2/displays/panel-taal.c
> b/drivers/video/omap2/displays/panel-taal.c
> index e1c765d..170ef63 100644
> --- a/drivers/video/omap2/displays/panel-taal.c
> +++ b/drivers/video/omap2/displays/panel-taal.c
> @@ -34,7 +34,7 @@
>  #include <linux/mutex.h>
>
>  #include <plat/display.h>
> -#include <plat/nokia-dsi-panel.h>
> +#include <plat/panel.h>
>
>  /* DSI Virtual channel. Hardcoded for now. */
>  #define TCH 0
> @@ -233,12 +233,6 @@ struct taal_data {
>       struct panel_config *panel_config;
>  };
>
> -static inline struct nokia_dsi_panel_data
> -*get_panel_data(const struct omap_dss_device *dssdev) -{
> -     return (struct nokia_dsi_panel_data *) dssdev->data; -}
> -
>  static void taal_esd_work(struct work_struct *work);
>
>  static void hw_guard_start(struct taal_data *td, int guard_msec)
> @@ -422,7 +416,7 @@ static int taal_bl_update_status(struct backlight_device
>  *dev) {
>       struct omap_dss_device *dssdev = dev_get_drvdata(&dev->dev);
>       struct taal_data *td = dev_get_drvdata(&dssdev->dev);
> -     struct nokia_dsi_panel_data *panel_data =
> get_panel_data(dssdev);
> +     struct panel_data *panel_data = get_panel_data(dssdev);         int r;
>       int level;
>
> @@ -639,7 +633,7 @@ static struct attribute_group taal_attr_group = {
>  static void taal_hw_reset(struct omap_dss_device *dssdev)  {
>       struct taal_data *td = dev_get_drvdata(&dssdev->dev);
> -     struct nokia_dsi_panel_data *panel_data =
> get_panel_data(dssdev);
> +     struct panel_data *panel_data = get_panel_data(dssdev);
>
>       if (panel_data->reset_gpio == -1)
>               return;
> @@ -663,7 +657,7 @@ static int taal_probe(struct
> omap_dss_device *dssdev)
>       struct backlight_properties props;
>       struct taal_data *td;
>       struct backlight_device *bldev;
> -     struct nokia_dsi_panel_data *panel_data =
> get_panel_data(dssdev);
> +     struct panel_data *panel_data = get_panel_data(dssdev);
>       struct panel_config *panel_config = NULL;
>       int r, i;
>
> @@ -802,7 +796,7 @@ err:
>  static void taal_remove(struct omap_dss_device *dssdev)  {
>       struct taal_data *td = dev_get_drvdata(&dssdev->dev);
> -     struct nokia_dsi_panel_data *panel_data =
> get_panel_data(dssdev);
> +     struct panel_data *panel_data = get_panel_data(dssdev);
>       struct backlight_device *bldev;
>
>       dev_dbg(&dssdev->dev, "remove\n");
> @@ -942,7 +936,7 @@ static void taal_power_off(struct
> omap_dss_device *dssdev)
>  static int taal_enable(struct omap_dss_device *dssdev)  {
>       struct taal_data *td = dev_get_drvdata(&dssdev->dev);
> -     struct nokia_dsi_panel_data *panel_data =
> get_panel_data(dssdev);
> +     struct panel_data *panel_data = get_panel_data(dssdev);         int r;
>
>       dev_dbg(&dssdev->dev, "enable\n");
> @@ -1035,7 +1029,7 @@ err:
>  static int taal_resume(struct omap_dss_device *dssdev)  {
>       struct taal_data *td = dev_get_drvdata(&dssdev->dev);
> -     struct nokia_dsi_panel_data *panel_data =
> get_panel_data(dssdev);
> +     struct panel_data *panel_data = get_panel_data(dssdev);         int r;
>
>       dev_dbg(&dssdev->dev, "resume\n");
> @@ -1122,7 +1116,7 @@ static int taal_update(struct
> omap_dss_device *dssdev,
>                                   u16 x, u16 y, u16 w, u16 h)
>  {
>       struct taal_data *td = dev_get_drvdata(&dssdev->dev);
> -     struct nokia_dsi_panel_data *panel_data =
> get_panel_data(dssdev);
> +     struct panel_data *panel_data = get_panel_data(dssdev);         int r;
>
>       dev_dbg(&dssdev->dev, "update %d, %d, %d x %d\n", x, y, w, h);
> @@ -1187,7 +1181,7 @@ static int taal_sync(struct
> omap_dss_device *dssdev)
>  static int _taal_enable_te(struct omap_dss_device *dssdev,
> bool enable)
>  {
>       struct taal_data *td = dev_get_drvdata(&dssdev->dev);
> -     struct nokia_dsi_panel_data *panel_data =
> get_panel_data(dssdev);
> +     struct panel_data *panel_data = get_panel_data(dssdev);         int r;
>
>       if (enable)
> @@ -1453,7 +1447,7 @@ static void taal_esd_work(struct
> work_struct *work)
>       struct taal_data *td = container_of(work, struct taal_data,
>       esd_work.work); struct omap_dss_device *dssdev = td->dssdev;
> -     struct nokia_dsi_panel_data *panel_data =
> get_panel_data(dssdev);
> +     struct panel_data *panel_data = get_panel_data(dssdev);         u8 state1, state2;
>       int r;
>
> --
> 1.7.1

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

* [PATCH 1/3] OMAP: use generic panel data in board files
  2010-11-05 21:17   ` Taneja, Archit
@ 2010-11-08 12:19     ` Tomi Valkeinen
  2010-11-08 19:49       ` Bryan Wu
  0 siblings, 1 reply; 16+ messages in thread
From: Tomi Valkeinen @ 2010-11-08 12:19 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Fri, 2010-11-05 at 22:17 +0100, ext Taneja, Archit wrote:
> Hi,
> 
> linux-omap-owner at vger.kernel.org wrote:
> > Introduce struct panel config data in panel.h, which will be
> > used to match the right panel configurations in generic DPI
> > panel driver and other future dsi panel drivers.
> >
> > Still keep sharp_ls_panel, since the sharp_ls_panel driver
> > contains blacklight control driver code which will be moved
> > out later. Then we can use generic DPI driver for sharp_ls_panel.
> >
> > Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
> > ---
> >  arch/arm/mach-omap2/board-3430sdp.c               |   10 +++-
> >  arch/arm/mach-omap2/board-am3517evm.c             |   19 +++++--
> >  arch/arm/mach-omap2/board-cm-t35.c                |   19 +++++--
> >  arch/arm/mach-omap2/board-devkit8000.c            |   22 +++++---
> >  arch/arm/mach-omap2/board-igep0020.c              |   10 +++-
> >  arch/arm/mach-omap2/board-omap3beagle.c           |   10 +++-
> >  arch/arm/mach-omap2/board-omap3evm.c              |   10 +++-
> >  arch/arm/mach-omap2/board-omap3stalker.c          |   19 +++++--
> >  arch/arm/plat-omap/include/plat/nokia-dsi-panel.h |   31 -----------
> >  arch/arm/plat-omap/include/plat/panel.h           |   57
> >  +++++++++++++++++++++ drivers/video/omap2/displays/panel-taal.c         |
> >  26 ++++------ 11 files changed, 148 insertions(+), 85 deletions(-)  delete
> > mode 100644 arch/arm/plat-omap/include/plat/nokia-dsi-panel.h
> >  create mode 100644 arch/arm/plat-omap/include/plat/panel.h
> 
> I am not totally sure about the need of removal of nokia-dsi-panel.h
> and the addition of a generic panel.h.
> 
> I guess the reason why nokia-dsi-panel.h was introduced (and others that
> will be introduced in future) was to easily represent panel-specific data
> across different boards that use the same panel.

Right. Don't touch panel-taal.c or nokia-dsi-panel.h, they are not
related to this DPI panel stuff.

> For example, if there is a new panel which for some reson uses 2 pins, one
> for switching off and one for switching on the panel, then it would make sense
> to introduce a structure for this panel having members on_gpio and off_gpio, this
> struct could then be passed and accessed through dssdev->data in the panel's probe
> giving us the option to have different gpio numbers for different boards but finally
> being accessed in the same way by the driver.
> 
> So, there isn't a need to generalize this struct and the corresponding header file
> for all panels and make it available for all board files.
> 
> As far as the dummy panels are concerned, since the "name" is the only criteria to
> differentiate the panel, I think passing the name to the data member of omap_dss_device
> should itself be enough for the generic dpi driver to handle things.

I think it's a bit confusing to just put a string to the void *data
member, but fortunately we don't need to ponder about that: the generic
DPI panel should be told about reset_gpio, max_backlight_level,
platform_enable/disable and set/get_backlight, which need to be passed
in a struct. So a header and a struct is needed for this generic DPI
driver.

 Tomi

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

* [PATCH 1/3] OMAP: use generic panel data in board files
  2010-11-05 19:43 ` [PATCH 1/3] OMAP: use generic panel data in board files Bryan Wu
  2010-11-05 21:17   ` Taneja, Archit
@ 2010-11-08 12:26   ` Tomi Valkeinen
  2010-11-08 19:43     ` Bryan Wu
  1 sibling, 1 reply; 16+ messages in thread
From: Tomi Valkeinen @ 2010-11-08 12:26 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Fri, 2010-11-05 at 20:43 +0100, ext Bryan Wu wrote:
> Introduce struct panel config data in panel.h, which will be used to match
> the right panel configurations in generic DPI panel driver and other future
> dsi panel drivers.
> 
> Still keep sharp_ls_panel, since the sharp_ls_panel driver contains blacklight
> control driver code which will be moved out later. Then we can use generic DPI
> driver for sharp_ls_panel.

As mentioned in the other mail, don't touch panel-taal or
nokia-dsi-panel.h. They are not related to this change.

The panel.h file should be spesific for the generic panel driver, so
name the .c and .h files similarly. (yes, panel-taal.c and
nokia-dsi-panel.h are not good examples for this, but I have a patch
fixing it, I just haven't had time to push it forward =).

And remember that the kernel should compile and work after each
individual patch in the patch set. In this patch you set the boards to
use dvi_panel driver, but there is no dvi_panel driver yet.

Also some comments inline.

> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
> ---
>  arch/arm/mach-omap2/board-3430sdp.c               |   10 +++-
>  arch/arm/mach-omap2/board-am3517evm.c             |   19 +++++--
>  arch/arm/mach-omap2/board-cm-t35.c                |   19 +++++--
>  arch/arm/mach-omap2/board-devkit8000.c            |   22 +++++---
>  arch/arm/mach-omap2/board-igep0020.c              |   10 +++-
>  arch/arm/mach-omap2/board-omap3beagle.c           |   10 +++-
>  arch/arm/mach-omap2/board-omap3evm.c              |   10 +++-
>  arch/arm/mach-omap2/board-omap3stalker.c          |   19 +++++--
>  arch/arm/plat-omap/include/plat/nokia-dsi-panel.h |   31 -----------
>  arch/arm/plat-omap/include/plat/panel.h           |   57 +++++++++++++++++++++
>  drivers/video/omap2/displays/panel-taal.c         |   26 ++++------
>  11 files changed, 148 insertions(+), 85 deletions(-)
>  delete mode 100644 arch/arm/plat-omap/include/plat/nokia-dsi-panel.h
>  create mode 100644 arch/arm/plat-omap/include/plat/panel.h
> 
> diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
> index 4e3742c..859b4e5 100644
> --- a/arch/arm/mach-omap2/board-3430sdp.c
> +++ b/arch/arm/mach-omap2/board-3430sdp.c
> @@ -38,6 +38,7 @@
>  #include <plat/dma.h>
>  #include <plat/gpmc.h>
>  #include <plat/display.h>
> +#include <plat/panel.h>
> 
>  #include <plat/gpmc-smc91x.h>
> 
> @@ -270,11 +271,14 @@ static struct omap_dss_device sdp3430_lcd_device = {
>         .platform_disable       = sdp3430_panel_disable_lcd,
>  };
> 
> +static struct panel_data dvi_panel = {
> +       .name           = "generic",
> +};
> +
>  static struct omap_dss_device sdp3430_dvi_device = {
>         .name                   = "dvi",
> -       .driver_name            = "generic_panel",
> -       .type                   = OMAP_DISPLAY_TYPE_DPI,
> -       .phy.dpi.data_lines     = 24,

Why do you remove type and datalines configuration? You do this for the
other panels also.

 Tomi

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

* [PATCH 1/3] OMAP: use generic panel data in board files
  2010-11-08 12:26   ` Tomi Valkeinen
@ 2010-11-08 19:43     ` Bryan Wu
  2010-11-09 10:13       ` Tomi Valkeinen
  0 siblings, 1 reply; 16+ messages in thread
From: Bryan Wu @ 2010-11-08 19:43 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Nov 8, 2010 at 7:26 AM, Tomi Valkeinen <tomi.valkeinen@nokia.com> wrote:
> Hi,
>
> On Fri, 2010-11-05 at 20:43 +0100, ext Bryan Wu wrote:
>> Introduce struct panel config data in panel.h, which will be used to match
>> the right panel configurations in generic DPI panel driver and other future
>> dsi panel drivers.
>>
>> Still keep sharp_ls_panel, since the sharp_ls_panel driver contains blacklight
>> control driver code which will be moved out later. Then we can use generic DPI
>> driver for sharp_ls_panel.
>
> As mentioned in the other mail, don't touch panel-taal or
> nokia-dsi-panel.h. They are not related to this change.
>

Got it. I just found nokia-dsi-panel.h is some kind of confusing and
tried to unify them. Obviously I should not touch them in this
patchset. I will remove them in next version.

> The panel.h file should be spesific for the generic panel driver, so
> name the .c and .h files similarly. (yes, panel-taal.c and
> nokia-dsi-panel.h are not good examples for this, but I have a patch
> fixing it, I just haven't had time to push it forward =).
>

OK, I got it. Actually I did that, but wanna unify the
nokia-dis-panel.h somehow. I will change back.

> And remember that the kernel should compile and work after each
> individual patch in the patch set. In this patch you set the boards to
> use dvi_panel driver, but there is no dvi_panel driver yet.
>

Got it. I will fold some patches together.

> Also some comments inline.
>
>> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
>> ---
>> ?arch/arm/mach-omap2/board-3430sdp.c ? ? ? ? ? ? ? | ? 10 +++-
>> ?arch/arm/mach-omap2/board-am3517evm.c ? ? ? ? ? ? | ? 19 +++++--
>> ?arch/arm/mach-omap2/board-cm-t35.c ? ? ? ? ? ? ? ?| ? 19 +++++--
>> ?arch/arm/mach-omap2/board-devkit8000.c ? ? ? ? ? ?| ? 22 +++++---
>> ?arch/arm/mach-omap2/board-igep0020.c ? ? ? ? ? ? ?| ? 10 +++-
>> ?arch/arm/mach-omap2/board-omap3beagle.c ? ? ? ? ? | ? 10 +++-
>> ?arch/arm/mach-omap2/board-omap3evm.c ? ? ? ? ? ? ?| ? 10 +++-
>> ?arch/arm/mach-omap2/board-omap3stalker.c ? ? ? ? ?| ? 19 +++++--
>> ?arch/arm/plat-omap/include/plat/nokia-dsi-panel.h | ? 31 -----------
>> ?arch/arm/plat-omap/include/plat/panel.h ? ? ? ? ? | ? 57 +++++++++++++++++++++
>> ?drivers/video/omap2/displays/panel-taal.c ? ? ? ? | ? 26 ++++------
>> ?11 files changed, 148 insertions(+), 85 deletions(-)
>> ?delete mode 100644 arch/arm/plat-omap/include/plat/nokia-dsi-panel.h
>> ?create mode 100644 arch/arm/plat-omap/include/plat/panel.h
>>
>> diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
>> index 4e3742c..859b4e5 100644
>> --- a/arch/arm/mach-omap2/board-3430sdp.c
>> +++ b/arch/arm/mach-omap2/board-3430sdp.c
>> @@ -38,6 +38,7 @@
>> ?#include <plat/dma.h>
>> ?#include <plat/gpmc.h>
>> ?#include <plat/display.h>
>> +#include <plat/panel.h>
>>
>> ?#include <plat/gpmc-smc91x.h>
>>
>> @@ -270,11 +271,14 @@ static struct omap_dss_device sdp3430_lcd_device = {
>> ? ? ? ? .platform_disable ? ? ? = sdp3430_panel_disable_lcd,
>> ?};
>>
>> +static struct panel_data dvi_panel = {
>> + ? ? ? .name ? ? ? ? ? = "generic",
>> +};
>> +
>> ?static struct omap_dss_device sdp3430_dvi_device = {
>> ? ? ? ? .name ? ? ? ? ? ? ? ? ? = "dvi",
>> - ? ? ? .driver_name ? ? ? ? ? ?= "generic_panel",
>> - ? ? ? .type ? ? ? ? ? ? ? ? ? = OMAP_DISPLAY_TYPE_DPI,
>> - ? ? ? .phy.dpi.data_lines ? ? = 24,
>
> Why do you remove type and datalines configuration? You do this for the
> other panels also.
>

I found this is common in all the generic dpi panel, but the value
depends on the specific panel. I move this to the panel configuration
data and will set this value in panel-dpi driver. Do you think need I
keep them here? Actually I found all of them are 24 for generic one.
16 or 18 for others.

-- 
Bryan Wu <bryan.wu@canonical.com>
Kernel Developer ? ?+86.138-1617-6545 Mobile
Ubuntu Kernel Team
Canonical Ltd. ? ? ?www.canonical.com
Ubuntu - Linux for human beings | www.ubuntu.com

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

* [PATCH 1/3] OMAP: use generic panel data in board files
  2010-11-08 12:19     ` Tomi Valkeinen
@ 2010-11-08 19:49       ` Bryan Wu
  0 siblings, 0 replies; 16+ messages in thread
From: Bryan Wu @ 2010-11-08 19:49 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Nov 8, 2010 at 7:19 AM, Tomi Valkeinen <tomi.valkeinen@nokia.com> wrote:
> Hi,
>
> On Fri, 2010-11-05 at 22:17 +0100, ext Taneja, Archit wrote:
>> Hi,
>>
>> linux-omap-owner at vger.kernel.org wrote:
>> > Introduce struct panel config data in panel.h, which will be
>> > used to match the right panel configurations in generic DPI
>> > panel driver and other future dsi panel drivers.
>> >
>> > Still keep sharp_ls_panel, since the sharp_ls_panel driver
>> > contains blacklight control driver code which will be moved
>> > out later. Then we can use generic DPI driver for sharp_ls_panel.
>> >
>> > Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
>> > ---
>> > ?arch/arm/mach-omap2/board-3430sdp.c ? ? ? ? ? ? ? | ? 10 +++-
>> > ?arch/arm/mach-omap2/board-am3517evm.c ? ? ? ? ? ? | ? 19 +++++--
>> > ?arch/arm/mach-omap2/board-cm-t35.c ? ? ? ? ? ? ? ?| ? 19 +++++--
>> > ?arch/arm/mach-omap2/board-devkit8000.c ? ? ? ? ? ?| ? 22 +++++---
>> > ?arch/arm/mach-omap2/board-igep0020.c ? ? ? ? ? ? ?| ? 10 +++-
>> > ?arch/arm/mach-omap2/board-omap3beagle.c ? ? ? ? ? | ? 10 +++-
>> > ?arch/arm/mach-omap2/board-omap3evm.c ? ? ? ? ? ? ?| ? 10 +++-
>> > ?arch/arm/mach-omap2/board-omap3stalker.c ? ? ? ? ?| ? 19 +++++--
>> > ?arch/arm/plat-omap/include/plat/nokia-dsi-panel.h | ? 31 -----------
>> > ?arch/arm/plat-omap/include/plat/panel.h ? ? ? ? ? | ? 57
>> > ?+++++++++++++++++++++ drivers/video/omap2/displays/panel-taal.c ? ? ? ? |
>> > ?26 ++++------ 11 files changed, 148 insertions(+), 85 deletions(-) ?delete
>> > mode 100644 arch/arm/plat-omap/include/plat/nokia-dsi-panel.h
>> > ?create mode 100644 arch/arm/plat-omap/include/plat/panel.h
>>
>> I am not totally sure about the need of removal of nokia-dsi-panel.h
>> and the addition of a generic panel.h.
>>
>> I guess the reason why nokia-dsi-panel.h was introduced (and others that
>> will be introduced in future) was to easily represent panel-specific data
>> across different boards that use the same panel.
>
> Right. Don't touch panel-taal.c or nokia-dsi-panel.h, they are not
> related to this DPI panel stuff.
>
>> For example, if there is a new panel which for some reson uses 2 pins, one
>> for switching off and one for switching on the panel, then it would make sense
>> to introduce a structure for this panel having members on_gpio and off_gpio, this
>> struct could then be passed and accessed through dssdev->data in the panel's probe
>> giving us the option to have different gpio numbers for different boards but finally
>> being accessed in the same way by the driver.
>>
>> So, there isn't a need to generalize this struct and the corresponding header file
>> for all panels and make it available for all board files.
>>
>> As far as the dummy panels are concerned, since the "name" is the only criteria to
>> differentiate the panel, I think passing the name to the data member of omap_dss_device
>> should itself be enough for the generic dpi driver to handle things.
>
> I think it's a bit confusing to just put a string to the void *data
> member, but fortunately we don't need to ponder about that: the generic
> DPI panel should be told about reset_gpio, max_backlight_level,
> platform_enable/disable and set/get_backlight, which need to be passed
> in a struct. So a header and a struct is needed for this generic DPI
> driver.
>

Yeah, so we just put  a name field in a struct such as
generic-dpi-panel-data in generic-dpi-panel.h
And our driver file will be panel-generic-dpi.c?

Thanks,
-- 
Bryan Wu <bryan.wu@canonical.com>
Kernel Developer ? ?+86.138-1617-6545 Mobile
Ubuntu Kernel Team
Canonical Ltd. ? ? ?www.canonical.com
Ubuntu - Linux for human beings | www.ubuntu.com

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

* [PATCH 3/3] OMAP: DSS2: remove generic DPI panel driver duplicated panel drivers
  2010-11-08 21:44 [PATCH 0/3] OMAP: DSS2: introduce generic panel display driver (try #4) Bryan Wu
@ 2010-11-08 21:45 ` Bryan Wu
  0 siblings, 0 replies; 16+ messages in thread
From: Bryan Wu @ 2010-11-08 21:45 UTC (permalink / raw)
  To: linux-arm-kernel

Still keep sharp_ls_panel driver, because it contains blacklight control driver.

Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
---
 drivers/video/omap2/displays/Kconfig               |   18 --
 drivers/video/omap2/displays/Makefile              |    3 -
 drivers/video/omap2/displays/panel-generic.c       |  174 --------------------
 .../video/omap2/displays/panel-sharp-lq043t1dg01.c |  165 -------------------
 .../video/omap2/displays/panel-toppoly-tdo35s.c    |  164 ------------------
 5 files changed, 0 insertions(+), 524 deletions(-)
 delete mode 100644 drivers/video/omap2/displays/panel-generic.c
 delete mode 100644 drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c
 delete mode 100644 drivers/video/omap2/displays/panel-toppoly-tdo35s.c

diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig
index cb3e339..9c09afd 100644
--- a/drivers/video/omap2/displays/Kconfig
+++ b/drivers/video/omap2/displays/Kconfig
@@ -9,12 +9,6 @@ config PANEL_GENERIC_DPI
 	  Supports LCD Panel used in TI SDP3430 and EVM boards,
 	  OMAP3517 EVM boards and CM-T35.
 
-config PANEL_GENERIC
-        tristate "Generic Panel"
-        help
-	  Generic panel driver.
-	  Used for DVI output for Beagle and OMAP3 SDP.
-
 config PANEL_SHARP_LS037V7DW01
         tristate "Sharp LS037V7DW01 LCD Panel"
         depends on OMAP2_DSS
@@ -22,24 +16,12 @@ config PANEL_SHARP_LS037V7DW01
         help
           LCD Panel used in TI's SDP3430 and EVM boards
 
-config PANEL_SHARP_LQ043T1DG01
-        tristate "Sharp LQ043T1DG01 LCD Panel"
-        depends on OMAP2_DSS
-        help
-          LCD Panel used in TI's OMAP3517 EVM boards
-
 config PANEL_TAAL
         tristate "Taal DSI Panel"
         depends on OMAP2_DSS_DSI
         help
           Taal DSI command mode panel from TPO.
 
-config PANEL_TOPPOLY_TDO35S
-        tristate "Toppoly TDO35S LCD Panel support"
-        depends on OMAP2_DSS
-        help
-          LCD Panel used in CM-T35
-
 config PANEL_TPO_TD043MTEA1
         tristate "TPO TD043MTEA1 LCD Panel"
         depends on OMAP2_DSS && SPI
diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile
index 022058c..3bebe4d 100644
--- a/drivers/video/omap2/displays/Makefile
+++ b/drivers/video/omap2/displays/Makefile
@@ -1,9 +1,6 @@
 obj-$(CONFIG_PANEL_GENERIC_DPI) += panel-generic-dpi.o
-obj-$(CONFIG_PANEL_GENERIC) += panel-generic.o
 obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o
-obj-$(CONFIG_PANEL_SHARP_LQ043T1DG01) += panel-sharp-lq043t1dg01.o
 
 obj-$(CONFIG_PANEL_TAAL) += panel-taal.o
-obj-$(CONFIG_PANEL_TOPPOLY_TDO35S) += panel-toppoly-tdo35s.o
 obj-$(CONFIG_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o
 obj-$(CONFIG_PANEL_ACX565AKM) += panel-acx565akm.o
diff --git a/drivers/video/omap2/displays/panel-generic.c b/drivers/video/omap2/displays/panel-generic.c
deleted file mode 100644
index 395a68d..0000000
--- a/drivers/video/omap2/displays/panel-generic.c
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Generic panel support
- *
- * Copyright (C) 2008 Nokia Corporation
- * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
- *
- * 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/delay.h>
-
-#include <plat/display.h>
-
-static struct omap_video_timings generic_panel_timings = {
-	/* 640 x 480 @ 60 Hz  Reduced blanking VESA CVT 0.31M3-R */
-	.x_res		= 640,
-	.y_res		= 480,
-	.pixel_clock	= 23500,
-	.hfp		= 48,
-	.hsw		= 32,
-	.hbp		= 80,
-	.vfp		= 3,
-	.vsw		= 4,
-	.vbp		= 7,
-};
-
-static int generic_panel_power_on(struct omap_dss_device *dssdev)
-{
-	int r;
-
-	if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
-		return 0;
-
-	r = omapdss_dpi_display_enable(dssdev);
-	if (r)
-		goto err0;
-
-	if (dssdev->platform_enable) {
-		r = dssdev->platform_enable(dssdev);
-		if (r)
-			goto err1;
-	}
-
-	return 0;
-err1:
-	omapdss_dpi_display_disable(dssdev);
-err0:
-	return r;
-}
-
-static void generic_panel_power_off(struct omap_dss_device *dssdev)
-{
-	if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
-		return;
-
-	if (dssdev->platform_disable)
-		dssdev->platform_disable(dssdev);
-
-	omapdss_dpi_display_disable(dssdev);
-}
-
-static int generic_panel_probe(struct omap_dss_device *dssdev)
-{
-	dssdev->panel.config = OMAP_DSS_LCD_TFT;
-	dssdev->panel.timings = generic_panel_timings;
-
-	return 0;
-}
-
-static void generic_panel_remove(struct omap_dss_device *dssdev)
-{
-}
-
-static int generic_panel_enable(struct omap_dss_device *dssdev)
-{
-	int r = 0;
-
-	r = generic_panel_power_on(dssdev);
-	if (r)
-		return r;
-
-	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
-
-	return 0;
-}
-
-static void generic_panel_disable(struct omap_dss_device *dssdev)
-{
-	generic_panel_power_off(dssdev);
-
-	dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
-}
-
-static int generic_panel_suspend(struct omap_dss_device *dssdev)
-{
-	generic_panel_power_off(dssdev);
-	dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
-	return 0;
-}
-
-static int generic_panel_resume(struct omap_dss_device *dssdev)
-{
-	int r = 0;
-
-	r = generic_panel_power_on(dssdev);
-	if (r)
-		return r;
-
-	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
-
-	return 0;
-}
-
-static void generic_panel_set_timings(struct omap_dss_device *dssdev,
-		struct omap_video_timings *timings)
-{
-	dpi_set_timings(dssdev, timings);
-}
-
-static void generic_panel_get_timings(struct omap_dss_device *dssdev,
-		struct omap_video_timings *timings)
-{
-	*timings = dssdev->panel.timings;
-}
-
-static int generic_panel_check_timings(struct omap_dss_device *dssdev,
-		struct omap_video_timings *timings)
-{
-	return dpi_check_timings(dssdev, timings);
-}
-
-static struct omap_dss_driver generic_driver = {
-	.probe		= generic_panel_probe,
-	.remove		= generic_panel_remove,
-
-	.enable		= generic_panel_enable,
-	.disable	= generic_panel_disable,
-	.suspend	= generic_panel_suspend,
-	.resume		= generic_panel_resume,
-
-	.set_timings	= generic_panel_set_timings,
-	.get_timings	= generic_panel_get_timings,
-	.check_timings	= generic_panel_check_timings,
-
-	.driver         = {
-		.name   = "generic_panel",
-		.owner  = THIS_MODULE,
-	},
-};
-
-static int __init generic_panel_drv_init(void)
-{
-	return omap_dss_register_driver(&generic_driver);
-}
-
-static void __exit generic_panel_drv_exit(void)
-{
-	omap_dss_unregister_driver(&generic_driver);
-}
-
-module_init(generic_panel_drv_init);
-module_exit(generic_panel_drv_exit);
-MODULE_LICENSE("GPL");
diff --git a/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c b/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c
deleted file mode 100644
index 0c6896c..0000000
--- a/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * LCD panel driver for Sharp LQ043T1DG01
- *
- * Copyright (C) 2009 Texas Instruments Inc
- * Author: Vaibhav Hiremath <hvaibhav@ti.com>
- *
- * 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/delay.h>
-#include <linux/device.h>
-#include <linux/err.h>
-
-#include <plat/display.h>
-
-static struct omap_video_timings sharp_lq_timings = {
-	.x_res = 480,
-	.y_res = 272,
-
-	.pixel_clock	= 9000,
-
-	.hsw		= 42,
-	.hfp		= 3,
-	.hbp		= 2,
-
-	.vsw		= 11,
-	.vfp		= 3,
-	.vbp		= 2,
-};
-
-static int sharp_lq_panel_power_on(struct omap_dss_device *dssdev)
-{
-	int r;
-
-	if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
-		return 0;
-
-	r = omapdss_dpi_display_enable(dssdev);
-	if (r)
-		goto err0;
-
-	/* wait couple of vsyncs until enabling the LCD */
-	msleep(50);
-
-	if (dssdev->platform_enable) {
-		r = dssdev->platform_enable(dssdev);
-		if (r)
-			goto err1;
-	}
-
-	return 0;
-err1:
-	omapdss_dpi_display_disable(dssdev);
-err0:
-	return r;
-}
-
-static void sharp_lq_panel_power_off(struct omap_dss_device *dssdev)
-{
-	if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
-		return;
-
-	if (dssdev->platform_disable)
-		dssdev->platform_disable(dssdev);
-
-	/* wait at least 5 vsyncs after disabling the LCD */
-	msleep(100);
-
-	omapdss_dpi_display_disable(dssdev);
-}
-
-static int sharp_lq_panel_probe(struct omap_dss_device *dssdev)
-{
-
-	dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |
-		OMAP_DSS_LCD_IHS | OMAP_DSS_LCD_IEO;
-	dssdev->panel.acb = 0x0;
-	dssdev->panel.timings = sharp_lq_timings;
-
-	return 0;
-}
-
-static void sharp_lq_panel_remove(struct omap_dss_device *dssdev)
-{
-}
-
-static int sharp_lq_panel_enable(struct omap_dss_device *dssdev)
-{
-	int r = 0;
-
-	r = sharp_lq_panel_power_on(dssdev);
-	if (r)
-		return r;
-
-	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
-
-	return 0;
-}
-
-static void sharp_lq_panel_disable(struct omap_dss_device *dssdev)
-{
-	sharp_lq_panel_power_off(dssdev);
-
-	dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
-}
-
-static int sharp_lq_panel_suspend(struct omap_dss_device *dssdev)
-{
-	sharp_lq_panel_power_off(dssdev);
-	dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
-	return 0;
-}
-
-static int sharp_lq_panel_resume(struct omap_dss_device *dssdev)
-{
-	int r = 0;
-
-	r = sharp_lq_panel_power_on(dssdev);
-	if (r)
-		return r;
-
-	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
-
-	return 0;
-}
-
-static struct omap_dss_driver sharp_lq_driver = {
-	.probe		= sharp_lq_panel_probe,
-	.remove		= sharp_lq_panel_remove,
-
-	.enable		= sharp_lq_panel_enable,
-	.disable	= sharp_lq_panel_disable,
-	.suspend	= sharp_lq_panel_suspend,
-	.resume		= sharp_lq_panel_resume,
-
-	.driver         = {
-		.name   = "sharp_lq_panel",
-		.owner  = THIS_MODULE,
-	},
-};
-
-static int __init sharp_lq_panel_drv_init(void)
-{
-	return omap_dss_register_driver(&sharp_lq_driver);
-}
-
-static void __exit sharp_lq_panel_drv_exit(void)
-{
-	omap_dss_unregister_driver(&sharp_lq_driver);
-}
-
-module_init(sharp_lq_panel_drv_init);
-module_exit(sharp_lq_panel_drv_exit);
-MODULE_LICENSE("GPL");
diff --git a/drivers/video/omap2/displays/panel-toppoly-tdo35s.c b/drivers/video/omap2/displays/panel-toppoly-tdo35s.c
deleted file mode 100644
index 526e906..0000000
--- a/drivers/video/omap2/displays/panel-toppoly-tdo35s.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * LCD panel driver for Toppoly TDO35S
- *
- * Copyright (C) 2009 CompuLab, Ltd.
- * Author: Mike Rapoport <mike@compulab.co.il>
- *
- * Based on generic panel support
- * Copyright (C) 2008 Nokia Corporation
- * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
- *
- * 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/delay.h>
-
-#include <plat/display.h>
-
-static struct omap_video_timings toppoly_tdo_panel_timings = {
-	/* 640 x 480 @ 60 Hz  Reduced blanking VESA CVT 0.31M3-R */
-	.x_res		= 480,
-	.y_res		= 640,
-
-	.pixel_clock	= 26000,
-
-	.hfp		= 104,
-	.hsw		= 8,
-	.hbp		= 8,
-
-	.vfp		= 4,
-	.vsw		= 2,
-	.vbp		= 2,
-};
-
-static int toppoly_tdo_panel_power_on(struct omap_dss_device *dssdev)
-{
-	int r;
-
-	if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
-		return 0;
-
-	r = omapdss_dpi_display_enable(dssdev);
-	if (r)
-		goto err0;
-
-	if (dssdev->platform_enable) {
-		r = dssdev->platform_enable(dssdev);
-		if (r)
-			goto err1;
-	}
-
-	return 0;
-err1:
-	omapdss_dpi_display_disable(dssdev);
-err0:
-	return r;
-}
-
-static void toppoly_tdo_panel_power_off(struct omap_dss_device *dssdev)
-{
-	if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
-		return;
-
-	if (dssdev->platform_disable)
-		dssdev->platform_disable(dssdev);
-
-	omapdss_dpi_display_disable(dssdev);
-}
-
-static int toppoly_tdo_panel_probe(struct omap_dss_device *dssdev)
-{
-	dssdev->panel.config = OMAP_DSS_LCD_TFT |
-			       OMAP_DSS_LCD_IVS |
-			       OMAP_DSS_LCD_IHS |
-			       OMAP_DSS_LCD_IPC |
-			       OMAP_DSS_LCD_ONOFF;
-
-	dssdev->panel.timings = toppoly_tdo_panel_timings;
-
-	return 0;
-}
-
-static void toppoly_tdo_panel_remove(struct omap_dss_device *dssdev)
-{
-}
-
-static int toppoly_tdo_panel_enable(struct omap_dss_device *dssdev)
-{
-	int r = 0;
-
-	r = toppoly_tdo_panel_power_on(dssdev);
-	if (r)
-		return r;
-
-	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
-
-	return 0;
-}
-
-static void toppoly_tdo_panel_disable(struct omap_dss_device *dssdev)
-{
-	toppoly_tdo_panel_power_off(dssdev);
-
-	dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
-}
-
-static int toppoly_tdo_panel_suspend(struct omap_dss_device *dssdev)
-{
-	toppoly_tdo_panel_power_off(dssdev);
-	dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
-	return 0;
-}
-
-static int toppoly_tdo_panel_resume(struct omap_dss_device *dssdev)
-{
-	int r = 0;
-
-	r = toppoly_tdo_panel_power_on(dssdev);
-	if (r)
-		return r;
-
-	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
-
-	return 0;
-}
-
-static struct omap_dss_driver generic_driver = {
-	.probe		= toppoly_tdo_panel_probe,
-	.remove		= toppoly_tdo_panel_remove,
-
-	.enable		= toppoly_tdo_panel_enable,
-	.disable	= toppoly_tdo_panel_disable,
-	.suspend	= toppoly_tdo_panel_suspend,
-	.resume		= toppoly_tdo_panel_resume,
-
-	.driver         = {
-		.name   = "toppoly_tdo35s_panel",
-		.owner  = THIS_MODULE,
-	},
-};
-
-static int __init toppoly_tdo_panel_drv_init(void)
-{
-	return omap_dss_register_driver(&generic_driver);
-}
-
-static void __exit toppoly_tdo_panel_drv_exit(void)
-{
-	omap_dss_unregister_driver(&generic_driver);
-}
-
-module_init(toppoly_tdo_panel_drv_init);
-module_exit(toppoly_tdo_panel_drv_exit);
-MODULE_LICENSE("GPL");
-- 
1.7.1

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

* [PATCH 1/3] OMAP: use generic panel data in board files
  2010-11-08 19:43     ` Bryan Wu
@ 2010-11-09 10:13       ` Tomi Valkeinen
  0 siblings, 0 replies; 16+ messages in thread
From: Tomi Valkeinen @ 2010-11-09 10:13 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, 2010-11-08 at 20:43 +0100, ext Bryan Wu wrote:
> On Mon, Nov 8, 2010 at 7:26 AM, Tomi Valkeinen <tomi.valkeinen@nokia.com> wrote:
> > Hi,
> >
> > On Fri, 2010-11-05 at 20:43 +0100, ext Bryan Wu wrote:

> >>  static struct omap_dss_device sdp3430_dvi_device = {
> >>         .name                   = "dvi",
> >> -       .driver_name            = "generic_panel",
> >> -       .type                   = OMAP_DISPLAY_TYPE_DPI,
> >> -       .phy.dpi.data_lines     = 24,
> >
> > Why do you remove type and datalines configuration? You do this for the
> > other panels also.
> >
> 
> I found this is common in all the generic dpi panel, but the value
> depends on the specific panel. I move this to the panel configuration
> data and will set this value in panel-dpi driver. Do you think need I
> keep them here? Actually I found all of them are 24 for generic one.
> 16 or 18 for others.

Both type and .phy.dpi.data_lines tell about the connection to the
panel, not about the panel itself. Thus I think it's more consistent to
have them defined in the board file.

Also, it's really up to the board HW design how many lines are connected
from OMAP to the panel. You could connect only 16, for example, so it's
something that has to be defined in the board file.

 Tomi

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

* [PATCH 3/3] OMAP: DSS2: remove generic DPI panel driver duplicated panel drivers
  2010-11-09 17:12 [PATCH 0/3] OMAP: DSS2: introduce generic panel display driver (try #5) Bryan Wu
@ 2010-11-09 17:12 ` Bryan Wu
  0 siblings, 0 replies; 16+ messages in thread
From: Bryan Wu @ 2010-11-09 17:12 UTC (permalink / raw)
  To: linux-arm-kernel

Still keep sharp_ls_panel driver, because it contains blacklight control driver.

Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
---
 drivers/video/omap2/displays/Kconfig               |   18 --
 drivers/video/omap2/displays/Makefile              |    3 -
 drivers/video/omap2/displays/panel-generic.c       |  174 --------------------
 .../video/omap2/displays/panel-sharp-lq043t1dg01.c |  165 -------------------
 .../video/omap2/displays/panel-toppoly-tdo35s.c    |  164 ------------------
 5 files changed, 0 insertions(+), 524 deletions(-)
 delete mode 100644 drivers/video/omap2/displays/panel-generic.c
 delete mode 100644 drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c
 delete mode 100644 drivers/video/omap2/displays/panel-toppoly-tdo35s.c

diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig
index cb3e339..9c09afd 100644
--- a/drivers/video/omap2/displays/Kconfig
+++ b/drivers/video/omap2/displays/Kconfig
@@ -9,12 +9,6 @@ config PANEL_GENERIC_DPI
 	  Supports LCD Panel used in TI SDP3430 and EVM boards,
 	  OMAP3517 EVM boards and CM-T35.
 
-config PANEL_GENERIC
-        tristate "Generic Panel"
-        help
-	  Generic panel driver.
-	  Used for DVI output for Beagle and OMAP3 SDP.
-
 config PANEL_SHARP_LS037V7DW01
         tristate "Sharp LS037V7DW01 LCD Panel"
         depends on OMAP2_DSS
@@ -22,24 +16,12 @@ config PANEL_SHARP_LS037V7DW01
         help
           LCD Panel used in TI's SDP3430 and EVM boards
 
-config PANEL_SHARP_LQ043T1DG01
-        tristate "Sharp LQ043T1DG01 LCD Panel"
-        depends on OMAP2_DSS
-        help
-          LCD Panel used in TI's OMAP3517 EVM boards
-
 config PANEL_TAAL
         tristate "Taal DSI Panel"
         depends on OMAP2_DSS_DSI
         help
           Taal DSI command mode panel from TPO.
 
-config PANEL_TOPPOLY_TDO35S
-        tristate "Toppoly TDO35S LCD Panel support"
-        depends on OMAP2_DSS
-        help
-          LCD Panel used in CM-T35
-
 config PANEL_TPO_TD043MTEA1
         tristate "TPO TD043MTEA1 LCD Panel"
         depends on OMAP2_DSS && SPI
diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile
index 022058c..3bebe4d 100644
--- a/drivers/video/omap2/displays/Makefile
+++ b/drivers/video/omap2/displays/Makefile
@@ -1,9 +1,6 @@
 obj-$(CONFIG_PANEL_GENERIC_DPI) += panel-generic-dpi.o
-obj-$(CONFIG_PANEL_GENERIC) += panel-generic.o
 obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o
-obj-$(CONFIG_PANEL_SHARP_LQ043T1DG01) += panel-sharp-lq043t1dg01.o
 
 obj-$(CONFIG_PANEL_TAAL) += panel-taal.o
-obj-$(CONFIG_PANEL_TOPPOLY_TDO35S) += panel-toppoly-tdo35s.o
 obj-$(CONFIG_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o
 obj-$(CONFIG_PANEL_ACX565AKM) += panel-acx565akm.o
diff --git a/drivers/video/omap2/displays/panel-generic.c b/drivers/video/omap2/displays/panel-generic.c
deleted file mode 100644
index 395a68d..0000000
--- a/drivers/video/omap2/displays/panel-generic.c
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Generic panel support
- *
- * Copyright (C) 2008 Nokia Corporation
- * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
- *
- * 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/delay.h>
-
-#include <plat/display.h>
-
-static struct omap_video_timings generic_panel_timings = {
-	/* 640 x 480 @ 60 Hz  Reduced blanking VESA CVT 0.31M3-R */
-	.x_res		= 640,
-	.y_res		= 480,
-	.pixel_clock	= 23500,
-	.hfp		= 48,
-	.hsw		= 32,
-	.hbp		= 80,
-	.vfp		= 3,
-	.vsw		= 4,
-	.vbp		= 7,
-};
-
-static int generic_panel_power_on(struct omap_dss_device *dssdev)
-{
-	int r;
-
-	if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
-		return 0;
-
-	r = omapdss_dpi_display_enable(dssdev);
-	if (r)
-		goto err0;
-
-	if (dssdev->platform_enable) {
-		r = dssdev->platform_enable(dssdev);
-		if (r)
-			goto err1;
-	}
-
-	return 0;
-err1:
-	omapdss_dpi_display_disable(dssdev);
-err0:
-	return r;
-}
-
-static void generic_panel_power_off(struct omap_dss_device *dssdev)
-{
-	if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
-		return;
-
-	if (dssdev->platform_disable)
-		dssdev->platform_disable(dssdev);
-
-	omapdss_dpi_display_disable(dssdev);
-}
-
-static int generic_panel_probe(struct omap_dss_device *dssdev)
-{
-	dssdev->panel.config = OMAP_DSS_LCD_TFT;
-	dssdev->panel.timings = generic_panel_timings;
-
-	return 0;
-}
-
-static void generic_panel_remove(struct omap_dss_device *dssdev)
-{
-}
-
-static int generic_panel_enable(struct omap_dss_device *dssdev)
-{
-	int r = 0;
-
-	r = generic_panel_power_on(dssdev);
-	if (r)
-		return r;
-
-	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
-
-	return 0;
-}
-
-static void generic_panel_disable(struct omap_dss_device *dssdev)
-{
-	generic_panel_power_off(dssdev);
-
-	dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
-}
-
-static int generic_panel_suspend(struct omap_dss_device *dssdev)
-{
-	generic_panel_power_off(dssdev);
-	dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
-	return 0;
-}
-
-static int generic_panel_resume(struct omap_dss_device *dssdev)
-{
-	int r = 0;
-
-	r = generic_panel_power_on(dssdev);
-	if (r)
-		return r;
-
-	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
-
-	return 0;
-}
-
-static void generic_panel_set_timings(struct omap_dss_device *dssdev,
-		struct omap_video_timings *timings)
-{
-	dpi_set_timings(dssdev, timings);
-}
-
-static void generic_panel_get_timings(struct omap_dss_device *dssdev,
-		struct omap_video_timings *timings)
-{
-	*timings = dssdev->panel.timings;
-}
-
-static int generic_panel_check_timings(struct omap_dss_device *dssdev,
-		struct omap_video_timings *timings)
-{
-	return dpi_check_timings(dssdev, timings);
-}
-
-static struct omap_dss_driver generic_driver = {
-	.probe		= generic_panel_probe,
-	.remove		= generic_panel_remove,
-
-	.enable		= generic_panel_enable,
-	.disable	= generic_panel_disable,
-	.suspend	= generic_panel_suspend,
-	.resume		= generic_panel_resume,
-
-	.set_timings	= generic_panel_set_timings,
-	.get_timings	= generic_panel_get_timings,
-	.check_timings	= generic_panel_check_timings,
-
-	.driver         = {
-		.name   = "generic_panel",
-		.owner  = THIS_MODULE,
-	},
-};
-
-static int __init generic_panel_drv_init(void)
-{
-	return omap_dss_register_driver(&generic_driver);
-}
-
-static void __exit generic_panel_drv_exit(void)
-{
-	omap_dss_unregister_driver(&generic_driver);
-}
-
-module_init(generic_panel_drv_init);
-module_exit(generic_panel_drv_exit);
-MODULE_LICENSE("GPL");
diff --git a/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c b/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c
deleted file mode 100644
index 0c6896c..0000000
--- a/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * LCD panel driver for Sharp LQ043T1DG01
- *
- * Copyright (C) 2009 Texas Instruments Inc
- * Author: Vaibhav Hiremath <hvaibhav@ti.com>
- *
- * 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/delay.h>
-#include <linux/device.h>
-#include <linux/err.h>
-
-#include <plat/display.h>
-
-static struct omap_video_timings sharp_lq_timings = {
-	.x_res = 480,
-	.y_res = 272,
-
-	.pixel_clock	= 9000,
-
-	.hsw		= 42,
-	.hfp		= 3,
-	.hbp		= 2,
-
-	.vsw		= 11,
-	.vfp		= 3,
-	.vbp		= 2,
-};
-
-static int sharp_lq_panel_power_on(struct omap_dss_device *dssdev)
-{
-	int r;
-
-	if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
-		return 0;
-
-	r = omapdss_dpi_display_enable(dssdev);
-	if (r)
-		goto err0;
-
-	/* wait couple of vsyncs until enabling the LCD */
-	msleep(50);
-
-	if (dssdev->platform_enable) {
-		r = dssdev->platform_enable(dssdev);
-		if (r)
-			goto err1;
-	}
-
-	return 0;
-err1:
-	omapdss_dpi_display_disable(dssdev);
-err0:
-	return r;
-}
-
-static void sharp_lq_panel_power_off(struct omap_dss_device *dssdev)
-{
-	if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
-		return;
-
-	if (dssdev->platform_disable)
-		dssdev->platform_disable(dssdev);
-
-	/* wait at least 5 vsyncs after disabling the LCD */
-	msleep(100);
-
-	omapdss_dpi_display_disable(dssdev);
-}
-
-static int sharp_lq_panel_probe(struct omap_dss_device *dssdev)
-{
-
-	dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |
-		OMAP_DSS_LCD_IHS | OMAP_DSS_LCD_IEO;
-	dssdev->panel.acb = 0x0;
-	dssdev->panel.timings = sharp_lq_timings;
-
-	return 0;
-}
-
-static void sharp_lq_panel_remove(struct omap_dss_device *dssdev)
-{
-}
-
-static int sharp_lq_panel_enable(struct omap_dss_device *dssdev)
-{
-	int r = 0;
-
-	r = sharp_lq_panel_power_on(dssdev);
-	if (r)
-		return r;
-
-	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
-
-	return 0;
-}
-
-static void sharp_lq_panel_disable(struct omap_dss_device *dssdev)
-{
-	sharp_lq_panel_power_off(dssdev);
-
-	dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
-}
-
-static int sharp_lq_panel_suspend(struct omap_dss_device *dssdev)
-{
-	sharp_lq_panel_power_off(dssdev);
-	dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
-	return 0;
-}
-
-static int sharp_lq_panel_resume(struct omap_dss_device *dssdev)
-{
-	int r = 0;
-
-	r = sharp_lq_panel_power_on(dssdev);
-	if (r)
-		return r;
-
-	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
-
-	return 0;
-}
-
-static struct omap_dss_driver sharp_lq_driver = {
-	.probe		= sharp_lq_panel_probe,
-	.remove		= sharp_lq_panel_remove,
-
-	.enable		= sharp_lq_panel_enable,
-	.disable	= sharp_lq_panel_disable,
-	.suspend	= sharp_lq_panel_suspend,
-	.resume		= sharp_lq_panel_resume,
-
-	.driver         = {
-		.name   = "sharp_lq_panel",
-		.owner  = THIS_MODULE,
-	},
-};
-
-static int __init sharp_lq_panel_drv_init(void)
-{
-	return omap_dss_register_driver(&sharp_lq_driver);
-}
-
-static void __exit sharp_lq_panel_drv_exit(void)
-{
-	omap_dss_unregister_driver(&sharp_lq_driver);
-}
-
-module_init(sharp_lq_panel_drv_init);
-module_exit(sharp_lq_panel_drv_exit);
-MODULE_LICENSE("GPL");
diff --git a/drivers/video/omap2/displays/panel-toppoly-tdo35s.c b/drivers/video/omap2/displays/panel-toppoly-tdo35s.c
deleted file mode 100644
index 526e906..0000000
--- a/drivers/video/omap2/displays/panel-toppoly-tdo35s.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * LCD panel driver for Toppoly TDO35S
- *
- * Copyright (C) 2009 CompuLab, Ltd.
- * Author: Mike Rapoport <mike@compulab.co.il>
- *
- * Based on generic panel support
- * Copyright (C) 2008 Nokia Corporation
- * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
- *
- * 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/delay.h>
-
-#include <plat/display.h>
-
-static struct omap_video_timings toppoly_tdo_panel_timings = {
-	/* 640 x 480 @ 60 Hz  Reduced blanking VESA CVT 0.31M3-R */
-	.x_res		= 480,
-	.y_res		= 640,
-
-	.pixel_clock	= 26000,
-
-	.hfp		= 104,
-	.hsw		= 8,
-	.hbp		= 8,
-
-	.vfp		= 4,
-	.vsw		= 2,
-	.vbp		= 2,
-};
-
-static int toppoly_tdo_panel_power_on(struct omap_dss_device *dssdev)
-{
-	int r;
-
-	if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
-		return 0;
-
-	r = omapdss_dpi_display_enable(dssdev);
-	if (r)
-		goto err0;
-
-	if (dssdev->platform_enable) {
-		r = dssdev->platform_enable(dssdev);
-		if (r)
-			goto err1;
-	}
-
-	return 0;
-err1:
-	omapdss_dpi_display_disable(dssdev);
-err0:
-	return r;
-}
-
-static void toppoly_tdo_panel_power_off(struct omap_dss_device *dssdev)
-{
-	if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
-		return;
-
-	if (dssdev->platform_disable)
-		dssdev->platform_disable(dssdev);
-
-	omapdss_dpi_display_disable(dssdev);
-}
-
-static int toppoly_tdo_panel_probe(struct omap_dss_device *dssdev)
-{
-	dssdev->panel.config = OMAP_DSS_LCD_TFT |
-			       OMAP_DSS_LCD_IVS |
-			       OMAP_DSS_LCD_IHS |
-			       OMAP_DSS_LCD_IPC |
-			       OMAP_DSS_LCD_ONOFF;
-
-	dssdev->panel.timings = toppoly_tdo_panel_timings;
-
-	return 0;
-}
-
-static void toppoly_tdo_panel_remove(struct omap_dss_device *dssdev)
-{
-}
-
-static int toppoly_tdo_panel_enable(struct omap_dss_device *dssdev)
-{
-	int r = 0;
-
-	r = toppoly_tdo_panel_power_on(dssdev);
-	if (r)
-		return r;
-
-	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
-
-	return 0;
-}
-
-static void toppoly_tdo_panel_disable(struct omap_dss_device *dssdev)
-{
-	toppoly_tdo_panel_power_off(dssdev);
-
-	dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
-}
-
-static int toppoly_tdo_panel_suspend(struct omap_dss_device *dssdev)
-{
-	toppoly_tdo_panel_power_off(dssdev);
-	dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
-	return 0;
-}
-
-static int toppoly_tdo_panel_resume(struct omap_dss_device *dssdev)
-{
-	int r = 0;
-
-	r = toppoly_tdo_panel_power_on(dssdev);
-	if (r)
-		return r;
-
-	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
-
-	return 0;
-}
-
-static struct omap_dss_driver generic_driver = {
-	.probe		= toppoly_tdo_panel_probe,
-	.remove		= toppoly_tdo_panel_remove,
-
-	.enable		= toppoly_tdo_panel_enable,
-	.disable	= toppoly_tdo_panel_disable,
-	.suspend	= toppoly_tdo_panel_suspend,
-	.resume		= toppoly_tdo_panel_resume,
-
-	.driver         = {
-		.name   = "toppoly_tdo35s_panel",
-		.owner  = THIS_MODULE,
-	},
-};
-
-static int __init toppoly_tdo_panel_drv_init(void)
-{
-	return omap_dss_register_driver(&generic_driver);
-}
-
-static void __exit toppoly_tdo_panel_drv_exit(void)
-{
-	omap_dss_unregister_driver(&generic_driver);
-}
-
-module_init(toppoly_tdo_panel_drv_init);
-module_exit(toppoly_tdo_panel_drv_exit);
-MODULE_LICENSE("GPL");
-- 
1.7.1

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

* [PATCH 3/3] OMAP: DSS2: remove generic DPI panel driver duplicated panel drivers
  2010-11-16  4:17 [PATCH 0/3] OMAP: DSS2: introduce generic panel display driver (try #6) Bryan Wu
@ 2010-11-16  4:17 ` Bryan Wu
  0 siblings, 0 replies; 16+ messages in thread
From: Bryan Wu @ 2010-11-16  4:17 UTC (permalink / raw)
  To: linux-arm-kernel

Still keep sharp_ls_panel driver, because it contains blacklight control driver.

Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
---
 drivers/video/omap2/displays/Kconfig               |   18 --
 drivers/video/omap2/displays/Makefile              |    3 -
 drivers/video/omap2/displays/panel-generic.c       |  174 --------------------
 .../video/omap2/displays/panel-sharp-lq043t1dg01.c |  165 -------------------
 .../video/omap2/displays/panel-toppoly-tdo35s.c    |  164 ------------------
 5 files changed, 0 insertions(+), 524 deletions(-)
 delete mode 100644 drivers/video/omap2/displays/panel-generic.c
 delete mode 100644 drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c
 delete mode 100644 drivers/video/omap2/displays/panel-toppoly-tdo35s.c

diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig
index cb3e339..9c09afd 100644
--- a/drivers/video/omap2/displays/Kconfig
+++ b/drivers/video/omap2/displays/Kconfig
@@ -9,12 +9,6 @@ config PANEL_GENERIC_DPI
 	  Supports LCD Panel used in TI SDP3430 and EVM boards,
 	  OMAP3517 EVM boards and CM-T35.
 
-config PANEL_GENERIC
-        tristate "Generic Panel"
-        help
-	  Generic panel driver.
-	  Used for DVI output for Beagle and OMAP3 SDP.
-
 config PANEL_SHARP_LS037V7DW01
         tristate "Sharp LS037V7DW01 LCD Panel"
         depends on OMAP2_DSS
@@ -22,24 +16,12 @@ config PANEL_SHARP_LS037V7DW01
         help
           LCD Panel used in TI's SDP3430 and EVM boards
 
-config PANEL_SHARP_LQ043T1DG01
-        tristate "Sharp LQ043T1DG01 LCD Panel"
-        depends on OMAP2_DSS
-        help
-          LCD Panel used in TI's OMAP3517 EVM boards
-
 config PANEL_TAAL
         tristate "Taal DSI Panel"
         depends on OMAP2_DSS_DSI
         help
           Taal DSI command mode panel from TPO.
 
-config PANEL_TOPPOLY_TDO35S
-        tristate "Toppoly TDO35S LCD Panel support"
-        depends on OMAP2_DSS
-        help
-          LCD Panel used in CM-T35
-
 config PANEL_TPO_TD043MTEA1
         tristate "TPO TD043MTEA1 LCD Panel"
         depends on OMAP2_DSS && SPI
diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile
index 022058c..3bebe4d 100644
--- a/drivers/video/omap2/displays/Makefile
+++ b/drivers/video/omap2/displays/Makefile
@@ -1,9 +1,6 @@
 obj-$(CONFIG_PANEL_GENERIC_DPI) += panel-generic-dpi.o
-obj-$(CONFIG_PANEL_GENERIC) += panel-generic.o
 obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o
-obj-$(CONFIG_PANEL_SHARP_LQ043T1DG01) += panel-sharp-lq043t1dg01.o
 
 obj-$(CONFIG_PANEL_TAAL) += panel-taal.o
-obj-$(CONFIG_PANEL_TOPPOLY_TDO35S) += panel-toppoly-tdo35s.o
 obj-$(CONFIG_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o
 obj-$(CONFIG_PANEL_ACX565AKM) += panel-acx565akm.o
diff --git a/drivers/video/omap2/displays/panel-generic.c b/drivers/video/omap2/displays/panel-generic.c
deleted file mode 100644
index 395a68d..0000000
--- a/drivers/video/omap2/displays/panel-generic.c
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Generic panel support
- *
- * Copyright (C) 2008 Nokia Corporation
- * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
- *
- * 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/delay.h>
-
-#include <plat/display.h>
-
-static struct omap_video_timings generic_panel_timings = {
-	/* 640 x 480 @ 60 Hz  Reduced blanking VESA CVT 0.31M3-R */
-	.x_res		= 640,
-	.y_res		= 480,
-	.pixel_clock	= 23500,
-	.hfp		= 48,
-	.hsw		= 32,
-	.hbp		= 80,
-	.vfp		= 3,
-	.vsw		= 4,
-	.vbp		= 7,
-};
-
-static int generic_panel_power_on(struct omap_dss_device *dssdev)
-{
-	int r;
-
-	if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
-		return 0;
-
-	r = omapdss_dpi_display_enable(dssdev);
-	if (r)
-		goto err0;
-
-	if (dssdev->platform_enable) {
-		r = dssdev->platform_enable(dssdev);
-		if (r)
-			goto err1;
-	}
-
-	return 0;
-err1:
-	omapdss_dpi_display_disable(dssdev);
-err0:
-	return r;
-}
-
-static void generic_panel_power_off(struct omap_dss_device *dssdev)
-{
-	if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
-		return;
-
-	if (dssdev->platform_disable)
-		dssdev->platform_disable(dssdev);
-
-	omapdss_dpi_display_disable(dssdev);
-}
-
-static int generic_panel_probe(struct omap_dss_device *dssdev)
-{
-	dssdev->panel.config = OMAP_DSS_LCD_TFT;
-	dssdev->panel.timings = generic_panel_timings;
-
-	return 0;
-}
-
-static void generic_panel_remove(struct omap_dss_device *dssdev)
-{
-}
-
-static int generic_panel_enable(struct omap_dss_device *dssdev)
-{
-	int r = 0;
-
-	r = generic_panel_power_on(dssdev);
-	if (r)
-		return r;
-
-	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
-
-	return 0;
-}
-
-static void generic_panel_disable(struct omap_dss_device *dssdev)
-{
-	generic_panel_power_off(dssdev);
-
-	dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
-}
-
-static int generic_panel_suspend(struct omap_dss_device *dssdev)
-{
-	generic_panel_power_off(dssdev);
-	dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
-	return 0;
-}
-
-static int generic_panel_resume(struct omap_dss_device *dssdev)
-{
-	int r = 0;
-
-	r = generic_panel_power_on(dssdev);
-	if (r)
-		return r;
-
-	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
-
-	return 0;
-}
-
-static void generic_panel_set_timings(struct omap_dss_device *dssdev,
-		struct omap_video_timings *timings)
-{
-	dpi_set_timings(dssdev, timings);
-}
-
-static void generic_panel_get_timings(struct omap_dss_device *dssdev,
-		struct omap_video_timings *timings)
-{
-	*timings = dssdev->panel.timings;
-}
-
-static int generic_panel_check_timings(struct omap_dss_device *dssdev,
-		struct omap_video_timings *timings)
-{
-	return dpi_check_timings(dssdev, timings);
-}
-
-static struct omap_dss_driver generic_driver = {
-	.probe		= generic_panel_probe,
-	.remove		= generic_panel_remove,
-
-	.enable		= generic_panel_enable,
-	.disable	= generic_panel_disable,
-	.suspend	= generic_panel_suspend,
-	.resume		= generic_panel_resume,
-
-	.set_timings	= generic_panel_set_timings,
-	.get_timings	= generic_panel_get_timings,
-	.check_timings	= generic_panel_check_timings,
-
-	.driver         = {
-		.name   = "generic_panel",
-		.owner  = THIS_MODULE,
-	},
-};
-
-static int __init generic_panel_drv_init(void)
-{
-	return omap_dss_register_driver(&generic_driver);
-}
-
-static void __exit generic_panel_drv_exit(void)
-{
-	omap_dss_unregister_driver(&generic_driver);
-}
-
-module_init(generic_panel_drv_init);
-module_exit(generic_panel_drv_exit);
-MODULE_LICENSE("GPL");
diff --git a/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c b/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c
deleted file mode 100644
index 0c6896c..0000000
--- a/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * LCD panel driver for Sharp LQ043T1DG01
- *
- * Copyright (C) 2009 Texas Instruments Inc
- * Author: Vaibhav Hiremath <hvaibhav@ti.com>
- *
- * 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/delay.h>
-#include <linux/device.h>
-#include <linux/err.h>
-
-#include <plat/display.h>
-
-static struct omap_video_timings sharp_lq_timings = {
-	.x_res = 480,
-	.y_res = 272,
-
-	.pixel_clock	= 9000,
-
-	.hsw		= 42,
-	.hfp		= 3,
-	.hbp		= 2,
-
-	.vsw		= 11,
-	.vfp		= 3,
-	.vbp		= 2,
-};
-
-static int sharp_lq_panel_power_on(struct omap_dss_device *dssdev)
-{
-	int r;
-
-	if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
-		return 0;
-
-	r = omapdss_dpi_display_enable(dssdev);
-	if (r)
-		goto err0;
-
-	/* wait couple of vsyncs until enabling the LCD */
-	msleep(50);
-
-	if (dssdev->platform_enable) {
-		r = dssdev->platform_enable(dssdev);
-		if (r)
-			goto err1;
-	}
-
-	return 0;
-err1:
-	omapdss_dpi_display_disable(dssdev);
-err0:
-	return r;
-}
-
-static void sharp_lq_panel_power_off(struct omap_dss_device *dssdev)
-{
-	if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
-		return;
-
-	if (dssdev->platform_disable)
-		dssdev->platform_disable(dssdev);
-
-	/* wait at least 5 vsyncs after disabling the LCD */
-	msleep(100);
-
-	omapdss_dpi_display_disable(dssdev);
-}
-
-static int sharp_lq_panel_probe(struct omap_dss_device *dssdev)
-{
-
-	dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |
-		OMAP_DSS_LCD_IHS | OMAP_DSS_LCD_IEO;
-	dssdev->panel.acb = 0x0;
-	dssdev->panel.timings = sharp_lq_timings;
-
-	return 0;
-}
-
-static void sharp_lq_panel_remove(struct omap_dss_device *dssdev)
-{
-}
-
-static int sharp_lq_panel_enable(struct omap_dss_device *dssdev)
-{
-	int r = 0;
-
-	r = sharp_lq_panel_power_on(dssdev);
-	if (r)
-		return r;
-
-	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
-
-	return 0;
-}
-
-static void sharp_lq_panel_disable(struct omap_dss_device *dssdev)
-{
-	sharp_lq_panel_power_off(dssdev);
-
-	dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
-}
-
-static int sharp_lq_panel_suspend(struct omap_dss_device *dssdev)
-{
-	sharp_lq_panel_power_off(dssdev);
-	dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
-	return 0;
-}
-
-static int sharp_lq_panel_resume(struct omap_dss_device *dssdev)
-{
-	int r = 0;
-
-	r = sharp_lq_panel_power_on(dssdev);
-	if (r)
-		return r;
-
-	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
-
-	return 0;
-}
-
-static struct omap_dss_driver sharp_lq_driver = {
-	.probe		= sharp_lq_panel_probe,
-	.remove		= sharp_lq_panel_remove,
-
-	.enable		= sharp_lq_panel_enable,
-	.disable	= sharp_lq_panel_disable,
-	.suspend	= sharp_lq_panel_suspend,
-	.resume		= sharp_lq_panel_resume,
-
-	.driver         = {
-		.name   = "sharp_lq_panel",
-		.owner  = THIS_MODULE,
-	},
-};
-
-static int __init sharp_lq_panel_drv_init(void)
-{
-	return omap_dss_register_driver(&sharp_lq_driver);
-}
-
-static void __exit sharp_lq_panel_drv_exit(void)
-{
-	omap_dss_unregister_driver(&sharp_lq_driver);
-}
-
-module_init(sharp_lq_panel_drv_init);
-module_exit(sharp_lq_panel_drv_exit);
-MODULE_LICENSE("GPL");
diff --git a/drivers/video/omap2/displays/panel-toppoly-tdo35s.c b/drivers/video/omap2/displays/panel-toppoly-tdo35s.c
deleted file mode 100644
index 526e906..0000000
--- a/drivers/video/omap2/displays/panel-toppoly-tdo35s.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * LCD panel driver for Toppoly TDO35S
- *
- * Copyright (C) 2009 CompuLab, Ltd.
- * Author: Mike Rapoport <mike@compulab.co.il>
- *
- * Based on generic panel support
- * Copyright (C) 2008 Nokia Corporation
- * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
- *
- * 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/delay.h>
-
-#include <plat/display.h>
-
-static struct omap_video_timings toppoly_tdo_panel_timings = {
-	/* 640 x 480 @ 60 Hz  Reduced blanking VESA CVT 0.31M3-R */
-	.x_res		= 480,
-	.y_res		= 640,
-
-	.pixel_clock	= 26000,
-
-	.hfp		= 104,
-	.hsw		= 8,
-	.hbp		= 8,
-
-	.vfp		= 4,
-	.vsw		= 2,
-	.vbp		= 2,
-};
-
-static int toppoly_tdo_panel_power_on(struct omap_dss_device *dssdev)
-{
-	int r;
-
-	if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
-		return 0;
-
-	r = omapdss_dpi_display_enable(dssdev);
-	if (r)
-		goto err0;
-
-	if (dssdev->platform_enable) {
-		r = dssdev->platform_enable(dssdev);
-		if (r)
-			goto err1;
-	}
-
-	return 0;
-err1:
-	omapdss_dpi_display_disable(dssdev);
-err0:
-	return r;
-}
-
-static void toppoly_tdo_panel_power_off(struct omap_dss_device *dssdev)
-{
-	if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
-		return;
-
-	if (dssdev->platform_disable)
-		dssdev->platform_disable(dssdev);
-
-	omapdss_dpi_display_disable(dssdev);
-}
-
-static int toppoly_tdo_panel_probe(struct omap_dss_device *dssdev)
-{
-	dssdev->panel.config = OMAP_DSS_LCD_TFT |
-			       OMAP_DSS_LCD_IVS |
-			       OMAP_DSS_LCD_IHS |
-			       OMAP_DSS_LCD_IPC |
-			       OMAP_DSS_LCD_ONOFF;
-
-	dssdev->panel.timings = toppoly_tdo_panel_timings;
-
-	return 0;
-}
-
-static void toppoly_tdo_panel_remove(struct omap_dss_device *dssdev)
-{
-}
-
-static int toppoly_tdo_panel_enable(struct omap_dss_device *dssdev)
-{
-	int r = 0;
-
-	r = toppoly_tdo_panel_power_on(dssdev);
-	if (r)
-		return r;
-
-	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
-
-	return 0;
-}
-
-static void toppoly_tdo_panel_disable(struct omap_dss_device *dssdev)
-{
-	toppoly_tdo_panel_power_off(dssdev);
-
-	dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
-}
-
-static int toppoly_tdo_panel_suspend(struct omap_dss_device *dssdev)
-{
-	toppoly_tdo_panel_power_off(dssdev);
-	dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
-	return 0;
-}
-
-static int toppoly_tdo_panel_resume(struct omap_dss_device *dssdev)
-{
-	int r = 0;
-
-	r = toppoly_tdo_panel_power_on(dssdev);
-	if (r)
-		return r;
-
-	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
-
-	return 0;
-}
-
-static struct omap_dss_driver generic_driver = {
-	.probe		= toppoly_tdo_panel_probe,
-	.remove		= toppoly_tdo_panel_remove,
-
-	.enable		= toppoly_tdo_panel_enable,
-	.disable	= toppoly_tdo_panel_disable,
-	.suspend	= toppoly_tdo_panel_suspend,
-	.resume		= toppoly_tdo_panel_resume,
-
-	.driver         = {
-		.name   = "toppoly_tdo35s_panel",
-		.owner  = THIS_MODULE,
-	},
-};
-
-static int __init toppoly_tdo_panel_drv_init(void)
-{
-	return omap_dss_register_driver(&generic_driver);
-}
-
-static void __exit toppoly_tdo_panel_drv_exit(void)
-{
-	omap_dss_unregister_driver(&generic_driver);
-}
-
-module_init(toppoly_tdo_panel_drv_init);
-module_exit(toppoly_tdo_panel_drv_exit);
-MODULE_LICENSE("GPL");
-- 
1.7.1

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

* [PATCH 3/3] OMAP: DSS2: remove generic DPI panel driver duplicated panel drivers
  2010-11-17  2:23 [PATCH 0/3] OMAP: DSS2: introduce generic panel display driver (try #7) Bryan Wu
@ 2010-11-17  2:24 ` Bryan Wu
  0 siblings, 0 replies; 16+ messages in thread
From: Bryan Wu @ 2010-11-17  2:24 UTC (permalink / raw)
  To: linux-arm-kernel

Still keep sharp_ls_panel driver, because it contains blacklight control driver.

Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
---
 drivers/video/omap2/displays/Kconfig               |   18 --
 drivers/video/omap2/displays/Makefile              |    3 -
 drivers/video/omap2/displays/panel-generic.c       |  174 --------------------
 .../video/omap2/displays/panel-sharp-lq043t1dg01.c |  165 -------------------
 .../video/omap2/displays/panel-toppoly-tdo35s.c    |  164 ------------------
 5 files changed, 0 insertions(+), 524 deletions(-)
 delete mode 100644 drivers/video/omap2/displays/panel-generic.c
 delete mode 100644 drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c
 delete mode 100644 drivers/video/omap2/displays/panel-toppoly-tdo35s.c

diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig
index cb3e339..9c09afd 100644
--- a/drivers/video/omap2/displays/Kconfig
+++ b/drivers/video/omap2/displays/Kconfig
@@ -9,12 +9,6 @@ config PANEL_GENERIC_DPI
 	  Supports LCD Panel used in TI SDP3430 and EVM boards,
 	  OMAP3517 EVM boards and CM-T35.
 
-config PANEL_GENERIC
-        tristate "Generic Panel"
-        help
-	  Generic panel driver.
-	  Used for DVI output for Beagle and OMAP3 SDP.
-
 config PANEL_SHARP_LS037V7DW01
         tristate "Sharp LS037V7DW01 LCD Panel"
         depends on OMAP2_DSS
@@ -22,24 +16,12 @@ config PANEL_SHARP_LS037V7DW01
         help
           LCD Panel used in TI's SDP3430 and EVM boards
 
-config PANEL_SHARP_LQ043T1DG01
-        tristate "Sharp LQ043T1DG01 LCD Panel"
-        depends on OMAP2_DSS
-        help
-          LCD Panel used in TI's OMAP3517 EVM boards
-
 config PANEL_TAAL
         tristate "Taal DSI Panel"
         depends on OMAP2_DSS_DSI
         help
           Taal DSI command mode panel from TPO.
 
-config PANEL_TOPPOLY_TDO35S
-        tristate "Toppoly TDO35S LCD Panel support"
-        depends on OMAP2_DSS
-        help
-          LCD Panel used in CM-T35
-
 config PANEL_TPO_TD043MTEA1
         tristate "TPO TD043MTEA1 LCD Panel"
         depends on OMAP2_DSS && SPI
diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile
index 022058c..3bebe4d 100644
--- a/drivers/video/omap2/displays/Makefile
+++ b/drivers/video/omap2/displays/Makefile
@@ -1,9 +1,6 @@
 obj-$(CONFIG_PANEL_GENERIC_DPI) += panel-generic-dpi.o
-obj-$(CONFIG_PANEL_GENERIC) += panel-generic.o
 obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o
-obj-$(CONFIG_PANEL_SHARP_LQ043T1DG01) += panel-sharp-lq043t1dg01.o
 
 obj-$(CONFIG_PANEL_TAAL) += panel-taal.o
-obj-$(CONFIG_PANEL_TOPPOLY_TDO35S) += panel-toppoly-tdo35s.o
 obj-$(CONFIG_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o
 obj-$(CONFIG_PANEL_ACX565AKM) += panel-acx565akm.o
diff --git a/drivers/video/omap2/displays/panel-generic.c b/drivers/video/omap2/displays/panel-generic.c
deleted file mode 100644
index 395a68d..0000000
--- a/drivers/video/omap2/displays/panel-generic.c
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Generic panel support
- *
- * Copyright (C) 2008 Nokia Corporation
- * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
- *
- * 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/delay.h>
-
-#include <plat/display.h>
-
-static struct omap_video_timings generic_panel_timings = {
-	/* 640 x 480 @ 60 Hz  Reduced blanking VESA CVT 0.31M3-R */
-	.x_res		= 640,
-	.y_res		= 480,
-	.pixel_clock	= 23500,
-	.hfp		= 48,
-	.hsw		= 32,
-	.hbp		= 80,
-	.vfp		= 3,
-	.vsw		= 4,
-	.vbp		= 7,
-};
-
-static int generic_panel_power_on(struct omap_dss_device *dssdev)
-{
-	int r;
-
-	if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
-		return 0;
-
-	r = omapdss_dpi_display_enable(dssdev);
-	if (r)
-		goto err0;
-
-	if (dssdev->platform_enable) {
-		r = dssdev->platform_enable(dssdev);
-		if (r)
-			goto err1;
-	}
-
-	return 0;
-err1:
-	omapdss_dpi_display_disable(dssdev);
-err0:
-	return r;
-}
-
-static void generic_panel_power_off(struct omap_dss_device *dssdev)
-{
-	if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
-		return;
-
-	if (dssdev->platform_disable)
-		dssdev->platform_disable(dssdev);
-
-	omapdss_dpi_display_disable(dssdev);
-}
-
-static int generic_panel_probe(struct omap_dss_device *dssdev)
-{
-	dssdev->panel.config = OMAP_DSS_LCD_TFT;
-	dssdev->panel.timings = generic_panel_timings;
-
-	return 0;
-}
-
-static void generic_panel_remove(struct omap_dss_device *dssdev)
-{
-}
-
-static int generic_panel_enable(struct omap_dss_device *dssdev)
-{
-	int r = 0;
-
-	r = generic_panel_power_on(dssdev);
-	if (r)
-		return r;
-
-	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
-
-	return 0;
-}
-
-static void generic_panel_disable(struct omap_dss_device *dssdev)
-{
-	generic_panel_power_off(dssdev);
-
-	dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
-}
-
-static int generic_panel_suspend(struct omap_dss_device *dssdev)
-{
-	generic_panel_power_off(dssdev);
-	dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
-	return 0;
-}
-
-static int generic_panel_resume(struct omap_dss_device *dssdev)
-{
-	int r = 0;
-
-	r = generic_panel_power_on(dssdev);
-	if (r)
-		return r;
-
-	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
-
-	return 0;
-}
-
-static void generic_panel_set_timings(struct omap_dss_device *dssdev,
-		struct omap_video_timings *timings)
-{
-	dpi_set_timings(dssdev, timings);
-}
-
-static void generic_panel_get_timings(struct omap_dss_device *dssdev,
-		struct omap_video_timings *timings)
-{
-	*timings = dssdev->panel.timings;
-}
-
-static int generic_panel_check_timings(struct omap_dss_device *dssdev,
-		struct omap_video_timings *timings)
-{
-	return dpi_check_timings(dssdev, timings);
-}
-
-static struct omap_dss_driver generic_driver = {
-	.probe		= generic_panel_probe,
-	.remove		= generic_panel_remove,
-
-	.enable		= generic_panel_enable,
-	.disable	= generic_panel_disable,
-	.suspend	= generic_panel_suspend,
-	.resume		= generic_panel_resume,
-
-	.set_timings	= generic_panel_set_timings,
-	.get_timings	= generic_panel_get_timings,
-	.check_timings	= generic_panel_check_timings,
-
-	.driver         = {
-		.name   = "generic_panel",
-		.owner  = THIS_MODULE,
-	},
-};
-
-static int __init generic_panel_drv_init(void)
-{
-	return omap_dss_register_driver(&generic_driver);
-}
-
-static void __exit generic_panel_drv_exit(void)
-{
-	omap_dss_unregister_driver(&generic_driver);
-}
-
-module_init(generic_panel_drv_init);
-module_exit(generic_panel_drv_exit);
-MODULE_LICENSE("GPL");
diff --git a/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c b/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c
deleted file mode 100644
index 0c6896c..0000000
--- a/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * LCD panel driver for Sharp LQ043T1DG01
- *
- * Copyright (C) 2009 Texas Instruments Inc
- * Author: Vaibhav Hiremath <hvaibhav@ti.com>
- *
- * 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/delay.h>
-#include <linux/device.h>
-#include <linux/err.h>
-
-#include <plat/display.h>
-
-static struct omap_video_timings sharp_lq_timings = {
-	.x_res = 480,
-	.y_res = 272,
-
-	.pixel_clock	= 9000,
-
-	.hsw		= 42,
-	.hfp		= 3,
-	.hbp		= 2,
-
-	.vsw		= 11,
-	.vfp		= 3,
-	.vbp		= 2,
-};
-
-static int sharp_lq_panel_power_on(struct omap_dss_device *dssdev)
-{
-	int r;
-
-	if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
-		return 0;
-
-	r = omapdss_dpi_display_enable(dssdev);
-	if (r)
-		goto err0;
-
-	/* wait couple of vsyncs until enabling the LCD */
-	msleep(50);
-
-	if (dssdev->platform_enable) {
-		r = dssdev->platform_enable(dssdev);
-		if (r)
-			goto err1;
-	}
-
-	return 0;
-err1:
-	omapdss_dpi_display_disable(dssdev);
-err0:
-	return r;
-}
-
-static void sharp_lq_panel_power_off(struct omap_dss_device *dssdev)
-{
-	if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
-		return;
-
-	if (dssdev->platform_disable)
-		dssdev->platform_disable(dssdev);
-
-	/* wait at least 5 vsyncs after disabling the LCD */
-	msleep(100);
-
-	omapdss_dpi_display_disable(dssdev);
-}
-
-static int sharp_lq_panel_probe(struct omap_dss_device *dssdev)
-{
-
-	dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |
-		OMAP_DSS_LCD_IHS | OMAP_DSS_LCD_IEO;
-	dssdev->panel.acb = 0x0;
-	dssdev->panel.timings = sharp_lq_timings;
-
-	return 0;
-}
-
-static void sharp_lq_panel_remove(struct omap_dss_device *dssdev)
-{
-}
-
-static int sharp_lq_panel_enable(struct omap_dss_device *dssdev)
-{
-	int r = 0;
-
-	r = sharp_lq_panel_power_on(dssdev);
-	if (r)
-		return r;
-
-	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
-
-	return 0;
-}
-
-static void sharp_lq_panel_disable(struct omap_dss_device *dssdev)
-{
-	sharp_lq_panel_power_off(dssdev);
-
-	dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
-}
-
-static int sharp_lq_panel_suspend(struct omap_dss_device *dssdev)
-{
-	sharp_lq_panel_power_off(dssdev);
-	dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
-	return 0;
-}
-
-static int sharp_lq_panel_resume(struct omap_dss_device *dssdev)
-{
-	int r = 0;
-
-	r = sharp_lq_panel_power_on(dssdev);
-	if (r)
-		return r;
-
-	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
-
-	return 0;
-}
-
-static struct omap_dss_driver sharp_lq_driver = {
-	.probe		= sharp_lq_panel_probe,
-	.remove		= sharp_lq_panel_remove,
-
-	.enable		= sharp_lq_panel_enable,
-	.disable	= sharp_lq_panel_disable,
-	.suspend	= sharp_lq_panel_suspend,
-	.resume		= sharp_lq_panel_resume,
-
-	.driver         = {
-		.name   = "sharp_lq_panel",
-		.owner  = THIS_MODULE,
-	},
-};
-
-static int __init sharp_lq_panel_drv_init(void)
-{
-	return omap_dss_register_driver(&sharp_lq_driver);
-}
-
-static void __exit sharp_lq_panel_drv_exit(void)
-{
-	omap_dss_unregister_driver(&sharp_lq_driver);
-}
-
-module_init(sharp_lq_panel_drv_init);
-module_exit(sharp_lq_panel_drv_exit);
-MODULE_LICENSE("GPL");
diff --git a/drivers/video/omap2/displays/panel-toppoly-tdo35s.c b/drivers/video/omap2/displays/panel-toppoly-tdo35s.c
deleted file mode 100644
index 526e906..0000000
--- a/drivers/video/omap2/displays/panel-toppoly-tdo35s.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * LCD panel driver for Toppoly TDO35S
- *
- * Copyright (C) 2009 CompuLab, Ltd.
- * Author: Mike Rapoport <mike@compulab.co.il>
- *
- * Based on generic panel support
- * Copyright (C) 2008 Nokia Corporation
- * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
- *
- * 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/delay.h>
-
-#include <plat/display.h>
-
-static struct omap_video_timings toppoly_tdo_panel_timings = {
-	/* 640 x 480 @ 60 Hz  Reduced blanking VESA CVT 0.31M3-R */
-	.x_res		= 480,
-	.y_res		= 640,
-
-	.pixel_clock	= 26000,
-
-	.hfp		= 104,
-	.hsw		= 8,
-	.hbp		= 8,
-
-	.vfp		= 4,
-	.vsw		= 2,
-	.vbp		= 2,
-};
-
-static int toppoly_tdo_panel_power_on(struct omap_dss_device *dssdev)
-{
-	int r;
-
-	if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
-		return 0;
-
-	r = omapdss_dpi_display_enable(dssdev);
-	if (r)
-		goto err0;
-
-	if (dssdev->platform_enable) {
-		r = dssdev->platform_enable(dssdev);
-		if (r)
-			goto err1;
-	}
-
-	return 0;
-err1:
-	omapdss_dpi_display_disable(dssdev);
-err0:
-	return r;
-}
-
-static void toppoly_tdo_panel_power_off(struct omap_dss_device *dssdev)
-{
-	if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
-		return;
-
-	if (dssdev->platform_disable)
-		dssdev->platform_disable(dssdev);
-
-	omapdss_dpi_display_disable(dssdev);
-}
-
-static int toppoly_tdo_panel_probe(struct omap_dss_device *dssdev)
-{
-	dssdev->panel.config = OMAP_DSS_LCD_TFT |
-			       OMAP_DSS_LCD_IVS |
-			       OMAP_DSS_LCD_IHS |
-			       OMAP_DSS_LCD_IPC |
-			       OMAP_DSS_LCD_ONOFF;
-
-	dssdev->panel.timings = toppoly_tdo_panel_timings;
-
-	return 0;
-}
-
-static void toppoly_tdo_panel_remove(struct omap_dss_device *dssdev)
-{
-}
-
-static int toppoly_tdo_panel_enable(struct omap_dss_device *dssdev)
-{
-	int r = 0;
-
-	r = toppoly_tdo_panel_power_on(dssdev);
-	if (r)
-		return r;
-
-	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
-
-	return 0;
-}
-
-static void toppoly_tdo_panel_disable(struct omap_dss_device *dssdev)
-{
-	toppoly_tdo_panel_power_off(dssdev);
-
-	dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
-}
-
-static int toppoly_tdo_panel_suspend(struct omap_dss_device *dssdev)
-{
-	toppoly_tdo_panel_power_off(dssdev);
-	dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
-	return 0;
-}
-
-static int toppoly_tdo_panel_resume(struct omap_dss_device *dssdev)
-{
-	int r = 0;
-
-	r = toppoly_tdo_panel_power_on(dssdev);
-	if (r)
-		return r;
-
-	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
-
-	return 0;
-}
-
-static struct omap_dss_driver generic_driver = {
-	.probe		= toppoly_tdo_panel_probe,
-	.remove		= toppoly_tdo_panel_remove,
-
-	.enable		= toppoly_tdo_panel_enable,
-	.disable	= toppoly_tdo_panel_disable,
-	.suspend	= toppoly_tdo_panel_suspend,
-	.resume		= toppoly_tdo_panel_resume,
-
-	.driver         = {
-		.name   = "toppoly_tdo35s_panel",
-		.owner  = THIS_MODULE,
-	},
-};
-
-static int __init toppoly_tdo_panel_drv_init(void)
-{
-	return omap_dss_register_driver(&generic_driver);
-}
-
-static void __exit toppoly_tdo_panel_drv_exit(void)
-{
-	omap_dss_unregister_driver(&generic_driver);
-}
-
-module_init(toppoly_tdo_panel_drv_init);
-module_exit(toppoly_tdo_panel_drv_exit);
-MODULE_LICENSE("GPL");
-- 
1.7.1

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

* [PATCH 3/3] OMAP: DSS2: remove generic DPI panel driver duplicated panel drivers
  2010-11-17 13:34 [PATCH 0/3] OMAP: DSS2: introduce generic panel display driver (try #8) Bryan Wu
@ 2010-11-17 13:34 ` Bryan Wu
  0 siblings, 0 replies; 16+ messages in thread
From: Bryan Wu @ 2010-11-17 13:34 UTC (permalink / raw)
  To: linux-arm-kernel

Still keep sharp_ls_panel driver, because it contains blacklight control driver.

Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
---
 drivers/video/omap2/displays/Kconfig               |   18 --
 drivers/video/omap2/displays/Makefile              |    3 -
 drivers/video/omap2/displays/panel-generic.c       |  174 --------------------
 .../video/omap2/displays/panel-sharp-lq043t1dg01.c |  165 -------------------
 .../video/omap2/displays/panel-toppoly-tdo35s.c    |  164 ------------------
 5 files changed, 0 insertions(+), 524 deletions(-)
 delete mode 100644 drivers/video/omap2/displays/panel-generic.c
 delete mode 100644 drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c
 delete mode 100644 drivers/video/omap2/displays/panel-toppoly-tdo35s.c

diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig
index cb3e339..9c09afd 100644
--- a/drivers/video/omap2/displays/Kconfig
+++ b/drivers/video/omap2/displays/Kconfig
@@ -9,12 +9,6 @@ config PANEL_GENERIC_DPI
 	  Supports LCD Panel used in TI SDP3430 and EVM boards,
 	  OMAP3517 EVM boards and CM-T35.
 
-config PANEL_GENERIC
-        tristate "Generic Panel"
-        help
-	  Generic panel driver.
-	  Used for DVI output for Beagle and OMAP3 SDP.
-
 config PANEL_SHARP_LS037V7DW01
         tristate "Sharp LS037V7DW01 LCD Panel"
         depends on OMAP2_DSS
@@ -22,24 +16,12 @@ config PANEL_SHARP_LS037V7DW01
         help
           LCD Panel used in TI's SDP3430 and EVM boards
 
-config PANEL_SHARP_LQ043T1DG01
-        tristate "Sharp LQ043T1DG01 LCD Panel"
-        depends on OMAP2_DSS
-        help
-          LCD Panel used in TI's OMAP3517 EVM boards
-
 config PANEL_TAAL
         tristate "Taal DSI Panel"
         depends on OMAP2_DSS_DSI
         help
           Taal DSI command mode panel from TPO.
 
-config PANEL_TOPPOLY_TDO35S
-        tristate "Toppoly TDO35S LCD Panel support"
-        depends on OMAP2_DSS
-        help
-          LCD Panel used in CM-T35
-
 config PANEL_TPO_TD043MTEA1
         tristate "TPO TD043MTEA1 LCD Panel"
         depends on OMAP2_DSS && SPI
diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile
index 022058c..3bebe4d 100644
--- a/drivers/video/omap2/displays/Makefile
+++ b/drivers/video/omap2/displays/Makefile
@@ -1,9 +1,6 @@
 obj-$(CONFIG_PANEL_GENERIC_DPI) += panel-generic-dpi.o
-obj-$(CONFIG_PANEL_GENERIC) += panel-generic.o
 obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o
-obj-$(CONFIG_PANEL_SHARP_LQ043T1DG01) += panel-sharp-lq043t1dg01.o
 
 obj-$(CONFIG_PANEL_TAAL) += panel-taal.o
-obj-$(CONFIG_PANEL_TOPPOLY_TDO35S) += panel-toppoly-tdo35s.o
 obj-$(CONFIG_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o
 obj-$(CONFIG_PANEL_ACX565AKM) += panel-acx565akm.o
diff --git a/drivers/video/omap2/displays/panel-generic.c b/drivers/video/omap2/displays/panel-generic.c
deleted file mode 100644
index 395a68d..0000000
--- a/drivers/video/omap2/displays/panel-generic.c
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Generic panel support
- *
- * Copyright (C) 2008 Nokia Corporation
- * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
- *
- * 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/delay.h>
-
-#include <plat/display.h>
-
-static struct omap_video_timings generic_panel_timings = {
-	/* 640 x 480 @ 60 Hz  Reduced blanking VESA CVT 0.31M3-R */
-	.x_res		= 640,
-	.y_res		= 480,
-	.pixel_clock	= 23500,
-	.hfp		= 48,
-	.hsw		= 32,
-	.hbp		= 80,
-	.vfp		= 3,
-	.vsw		= 4,
-	.vbp		= 7,
-};
-
-static int generic_panel_power_on(struct omap_dss_device *dssdev)
-{
-	int r;
-
-	if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
-		return 0;
-
-	r = omapdss_dpi_display_enable(dssdev);
-	if (r)
-		goto err0;
-
-	if (dssdev->platform_enable) {
-		r = dssdev->platform_enable(dssdev);
-		if (r)
-			goto err1;
-	}
-
-	return 0;
-err1:
-	omapdss_dpi_display_disable(dssdev);
-err0:
-	return r;
-}
-
-static void generic_panel_power_off(struct omap_dss_device *dssdev)
-{
-	if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
-		return;
-
-	if (dssdev->platform_disable)
-		dssdev->platform_disable(dssdev);
-
-	omapdss_dpi_display_disable(dssdev);
-}
-
-static int generic_panel_probe(struct omap_dss_device *dssdev)
-{
-	dssdev->panel.config = OMAP_DSS_LCD_TFT;
-	dssdev->panel.timings = generic_panel_timings;
-
-	return 0;
-}
-
-static void generic_panel_remove(struct omap_dss_device *dssdev)
-{
-}
-
-static int generic_panel_enable(struct omap_dss_device *dssdev)
-{
-	int r = 0;
-
-	r = generic_panel_power_on(dssdev);
-	if (r)
-		return r;
-
-	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
-
-	return 0;
-}
-
-static void generic_panel_disable(struct omap_dss_device *dssdev)
-{
-	generic_panel_power_off(dssdev);
-
-	dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
-}
-
-static int generic_panel_suspend(struct omap_dss_device *dssdev)
-{
-	generic_panel_power_off(dssdev);
-	dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
-	return 0;
-}
-
-static int generic_panel_resume(struct omap_dss_device *dssdev)
-{
-	int r = 0;
-
-	r = generic_panel_power_on(dssdev);
-	if (r)
-		return r;
-
-	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
-
-	return 0;
-}
-
-static void generic_panel_set_timings(struct omap_dss_device *dssdev,
-		struct omap_video_timings *timings)
-{
-	dpi_set_timings(dssdev, timings);
-}
-
-static void generic_panel_get_timings(struct omap_dss_device *dssdev,
-		struct omap_video_timings *timings)
-{
-	*timings = dssdev->panel.timings;
-}
-
-static int generic_panel_check_timings(struct omap_dss_device *dssdev,
-		struct omap_video_timings *timings)
-{
-	return dpi_check_timings(dssdev, timings);
-}
-
-static struct omap_dss_driver generic_driver = {
-	.probe		= generic_panel_probe,
-	.remove		= generic_panel_remove,
-
-	.enable		= generic_panel_enable,
-	.disable	= generic_panel_disable,
-	.suspend	= generic_panel_suspend,
-	.resume		= generic_panel_resume,
-
-	.set_timings	= generic_panel_set_timings,
-	.get_timings	= generic_panel_get_timings,
-	.check_timings	= generic_panel_check_timings,
-
-	.driver         = {
-		.name   = "generic_panel",
-		.owner  = THIS_MODULE,
-	},
-};
-
-static int __init generic_panel_drv_init(void)
-{
-	return omap_dss_register_driver(&generic_driver);
-}
-
-static void __exit generic_panel_drv_exit(void)
-{
-	omap_dss_unregister_driver(&generic_driver);
-}
-
-module_init(generic_panel_drv_init);
-module_exit(generic_panel_drv_exit);
-MODULE_LICENSE("GPL");
diff --git a/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c b/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c
deleted file mode 100644
index 0c6896c..0000000
--- a/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * LCD panel driver for Sharp LQ043T1DG01
- *
- * Copyright (C) 2009 Texas Instruments Inc
- * Author: Vaibhav Hiremath <hvaibhav@ti.com>
- *
- * 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/delay.h>
-#include <linux/device.h>
-#include <linux/err.h>
-
-#include <plat/display.h>
-
-static struct omap_video_timings sharp_lq_timings = {
-	.x_res = 480,
-	.y_res = 272,
-
-	.pixel_clock	= 9000,
-
-	.hsw		= 42,
-	.hfp		= 3,
-	.hbp		= 2,
-
-	.vsw		= 11,
-	.vfp		= 3,
-	.vbp		= 2,
-};
-
-static int sharp_lq_panel_power_on(struct omap_dss_device *dssdev)
-{
-	int r;
-
-	if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
-		return 0;
-
-	r = omapdss_dpi_display_enable(dssdev);
-	if (r)
-		goto err0;
-
-	/* wait couple of vsyncs until enabling the LCD */
-	msleep(50);
-
-	if (dssdev->platform_enable) {
-		r = dssdev->platform_enable(dssdev);
-		if (r)
-			goto err1;
-	}
-
-	return 0;
-err1:
-	omapdss_dpi_display_disable(dssdev);
-err0:
-	return r;
-}
-
-static void sharp_lq_panel_power_off(struct omap_dss_device *dssdev)
-{
-	if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
-		return;
-
-	if (dssdev->platform_disable)
-		dssdev->platform_disable(dssdev);
-
-	/* wait at least 5 vsyncs after disabling the LCD */
-	msleep(100);
-
-	omapdss_dpi_display_disable(dssdev);
-}
-
-static int sharp_lq_panel_probe(struct omap_dss_device *dssdev)
-{
-
-	dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |
-		OMAP_DSS_LCD_IHS | OMAP_DSS_LCD_IEO;
-	dssdev->panel.acb = 0x0;
-	dssdev->panel.timings = sharp_lq_timings;
-
-	return 0;
-}
-
-static void sharp_lq_panel_remove(struct omap_dss_device *dssdev)
-{
-}
-
-static int sharp_lq_panel_enable(struct omap_dss_device *dssdev)
-{
-	int r = 0;
-
-	r = sharp_lq_panel_power_on(dssdev);
-	if (r)
-		return r;
-
-	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
-
-	return 0;
-}
-
-static void sharp_lq_panel_disable(struct omap_dss_device *dssdev)
-{
-	sharp_lq_panel_power_off(dssdev);
-
-	dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
-}
-
-static int sharp_lq_panel_suspend(struct omap_dss_device *dssdev)
-{
-	sharp_lq_panel_power_off(dssdev);
-	dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
-	return 0;
-}
-
-static int sharp_lq_panel_resume(struct omap_dss_device *dssdev)
-{
-	int r = 0;
-
-	r = sharp_lq_panel_power_on(dssdev);
-	if (r)
-		return r;
-
-	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
-
-	return 0;
-}
-
-static struct omap_dss_driver sharp_lq_driver = {
-	.probe		= sharp_lq_panel_probe,
-	.remove		= sharp_lq_panel_remove,
-
-	.enable		= sharp_lq_panel_enable,
-	.disable	= sharp_lq_panel_disable,
-	.suspend	= sharp_lq_panel_suspend,
-	.resume		= sharp_lq_panel_resume,
-
-	.driver         = {
-		.name   = "sharp_lq_panel",
-		.owner  = THIS_MODULE,
-	},
-};
-
-static int __init sharp_lq_panel_drv_init(void)
-{
-	return omap_dss_register_driver(&sharp_lq_driver);
-}
-
-static void __exit sharp_lq_panel_drv_exit(void)
-{
-	omap_dss_unregister_driver(&sharp_lq_driver);
-}
-
-module_init(sharp_lq_panel_drv_init);
-module_exit(sharp_lq_panel_drv_exit);
-MODULE_LICENSE("GPL");
diff --git a/drivers/video/omap2/displays/panel-toppoly-tdo35s.c b/drivers/video/omap2/displays/panel-toppoly-tdo35s.c
deleted file mode 100644
index 526e906..0000000
--- a/drivers/video/omap2/displays/panel-toppoly-tdo35s.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * LCD panel driver for Toppoly TDO35S
- *
- * Copyright (C) 2009 CompuLab, Ltd.
- * Author: Mike Rapoport <mike@compulab.co.il>
- *
- * Based on generic panel support
- * Copyright (C) 2008 Nokia Corporation
- * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
- *
- * 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/delay.h>
-
-#include <plat/display.h>
-
-static struct omap_video_timings toppoly_tdo_panel_timings = {
-	/* 640 x 480 @ 60 Hz  Reduced blanking VESA CVT 0.31M3-R */
-	.x_res		= 480,
-	.y_res		= 640,
-
-	.pixel_clock	= 26000,
-
-	.hfp		= 104,
-	.hsw		= 8,
-	.hbp		= 8,
-
-	.vfp		= 4,
-	.vsw		= 2,
-	.vbp		= 2,
-};
-
-static int toppoly_tdo_panel_power_on(struct omap_dss_device *dssdev)
-{
-	int r;
-
-	if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
-		return 0;
-
-	r = omapdss_dpi_display_enable(dssdev);
-	if (r)
-		goto err0;
-
-	if (dssdev->platform_enable) {
-		r = dssdev->platform_enable(dssdev);
-		if (r)
-			goto err1;
-	}
-
-	return 0;
-err1:
-	omapdss_dpi_display_disable(dssdev);
-err0:
-	return r;
-}
-
-static void toppoly_tdo_panel_power_off(struct omap_dss_device *dssdev)
-{
-	if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
-		return;
-
-	if (dssdev->platform_disable)
-		dssdev->platform_disable(dssdev);
-
-	omapdss_dpi_display_disable(dssdev);
-}
-
-static int toppoly_tdo_panel_probe(struct omap_dss_device *dssdev)
-{
-	dssdev->panel.config = OMAP_DSS_LCD_TFT |
-			       OMAP_DSS_LCD_IVS |
-			       OMAP_DSS_LCD_IHS |
-			       OMAP_DSS_LCD_IPC |
-			       OMAP_DSS_LCD_ONOFF;
-
-	dssdev->panel.timings = toppoly_tdo_panel_timings;
-
-	return 0;
-}
-
-static void toppoly_tdo_panel_remove(struct omap_dss_device *dssdev)
-{
-}
-
-static int toppoly_tdo_panel_enable(struct omap_dss_device *dssdev)
-{
-	int r = 0;
-
-	r = toppoly_tdo_panel_power_on(dssdev);
-	if (r)
-		return r;
-
-	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
-
-	return 0;
-}
-
-static void toppoly_tdo_panel_disable(struct omap_dss_device *dssdev)
-{
-	toppoly_tdo_panel_power_off(dssdev);
-
-	dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
-}
-
-static int toppoly_tdo_panel_suspend(struct omap_dss_device *dssdev)
-{
-	toppoly_tdo_panel_power_off(dssdev);
-	dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
-	return 0;
-}
-
-static int toppoly_tdo_panel_resume(struct omap_dss_device *dssdev)
-{
-	int r = 0;
-
-	r = toppoly_tdo_panel_power_on(dssdev);
-	if (r)
-		return r;
-
-	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
-
-	return 0;
-}
-
-static struct omap_dss_driver generic_driver = {
-	.probe		= toppoly_tdo_panel_probe,
-	.remove		= toppoly_tdo_panel_remove,
-
-	.enable		= toppoly_tdo_panel_enable,
-	.disable	= toppoly_tdo_panel_disable,
-	.suspend	= toppoly_tdo_panel_suspend,
-	.resume		= toppoly_tdo_panel_resume,
-
-	.driver         = {
-		.name   = "toppoly_tdo35s_panel",
-		.owner  = THIS_MODULE,
-	},
-};
-
-static int __init toppoly_tdo_panel_drv_init(void)
-{
-	return omap_dss_register_driver(&generic_driver);
-}
-
-static void __exit toppoly_tdo_panel_drv_exit(void)
-{
-	omap_dss_unregister_driver(&generic_driver);
-}
-
-module_init(toppoly_tdo_panel_drv_init);
-module_exit(toppoly_tdo_panel_drv_exit);
-MODULE_LICENSE("GPL");
-- 
1.7.1

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

end of thread, other threads:[~2010-11-17 13:34 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-05 19:43 [PATCH 0/3] OMAP: DSS2: introduce generic panel display driver (try #3) Bryan Wu
2010-11-05 19:43 ` [PATCH 1/3] OMAP: use generic panel data in board files Bryan Wu
2010-11-05 21:17   ` Taneja, Archit
2010-11-08 12:19     ` Tomi Valkeinen
2010-11-08 19:49       ` Bryan Wu
2010-11-08 12:26   ` Tomi Valkeinen
2010-11-08 19:43     ` Bryan Wu
2010-11-09 10:13       ` Tomi Valkeinen
2010-11-05 19:43 ` [PATCH 2/3] OMAP: DSS2: Add generic panel display driver Bryan Wu
2010-11-05 20:59   ` Taneja, Archit
2010-11-05 19:43 ` [PATCH 3/3] OMAP: DSS2: remove generic DPI panel driver duplicated panel drivers Bryan Wu
  -- strict thread matches above, loose matches on Subject: below --
2010-11-08 21:44 [PATCH 0/3] OMAP: DSS2: introduce generic panel display driver (try #4) Bryan Wu
2010-11-08 21:45 ` [PATCH 3/3] OMAP: DSS2: remove generic DPI panel driver duplicated panel drivers Bryan Wu
2010-11-09 17:12 [PATCH 0/3] OMAP: DSS2: introduce generic panel display driver (try #5) Bryan Wu
2010-11-09 17:12 ` [PATCH 3/3] OMAP: DSS2: remove generic DPI panel driver duplicated panel drivers Bryan Wu
2010-11-16  4:17 [PATCH 0/3] OMAP: DSS2: introduce generic panel display driver (try #6) Bryan Wu
2010-11-16  4:17 ` [PATCH 3/3] OMAP: DSS2: remove generic DPI panel driver duplicated panel drivers Bryan Wu
2010-11-17  2:23 [PATCH 0/3] OMAP: DSS2: introduce generic panel display driver (try #7) Bryan Wu
2010-11-17  2:24 ` [PATCH 3/3] OMAP: DSS2: remove generic DPI panel driver duplicated panel drivers Bryan Wu
2010-11-17 13:34 [PATCH 0/3] OMAP: DSS2: introduce generic panel display driver (try #8) Bryan Wu
2010-11-17 13:34 ` [PATCH 3/3] OMAP: DSS2: remove generic DPI panel driver duplicated panel drivers Bryan Wu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).