OMAP: DSS2: introduce generic panel display driver (try #3)
Subsystems (4)
cover OMAP: DSS2: introduce generic panel display driver (try #3)
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
PATCH 1/3 OMAP: use generic panel data in board files
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.
--- 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
arch/arm/mach-omap2/board-3430sdp.c +7 -3
@@ -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, };
arch/arm/mach-omap2/board-am3517evm.c +13 -6
@@ -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, };
arch/arm/mach-omap2/board-cm-t35.c +13 -6
@@ -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, };
arch/arm/mach-omap2/board-devkit8000.c +14 -8
@@ -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, };
arch/arm/mach-omap2/board-igep0020.c +7 -3
@@ -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, };
arch/arm/mach-omap2/board-omap3beagle.c +7 -3
@@ -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,
arch/arm/mach-omap2/board-omap3evm.c +7 -3
@@ -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, };
arch/arm/mach-omap2/board-omap3stalker.c +13 -6
@@ -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, };
arch/arm/plat-omap/include/plat/nokia-dsi-panel.h deleted +0 -31
@@ -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 */
arch/arm/plat-omap/include/plat/panel.h new file +57 -0
57 lines not on this page · raw message
drivers/video/omap2/displays/panel-taal.c +10 -16
@@ -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;
Signature · 1 line
1.7.1
PATCH 1/3 OMAP: use generic panel data in board files
Hi,
Quoted 9 lines · linux-omap-owner at vger.kernel.org
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 thesharp_ls_paneldriver contains blacklight control driver code which will be moved out later. Then we can use generic DPI driver forsharp_ls_panel.Signed-off-by Bryan Wu <[email protected]>
Quoted 15 lines
--- 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.
Quoted 517 lines
arch/arm/mach-omap2/board-3430sdp.c +7
-3@@ -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, };arch/arm/mach-omap2/board-am3517evm.c +1
-0@@ -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; }arch/arm/mach-omap2/board-am3517evm.c +6
-3+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; }arch/arm/mach-omap2/board-am3517evm.c +6
-3+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, };arch/arm/mach-omap2/board-cm-t35.c +13
-6@@ -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, };arch/arm/mach-omap2/board-devkit8000.c +1
-0@@ -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 structregulator_consumer_supplydevkit8000_vio_supply=REGULATOR_SUPPLY("vcc", "spi2.0");arch/arm/mach-omap2/board-devkit8000.c +13
-8+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, };arch/arm/mach-omap2/board-igep0020.c +7
-3@@ -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, };arch/arm/mach-omap2/board-omap3beagle.c +7
-3@@ -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.cb/arch/arm/mach-omap2/board-omap3evm.c
index b04365c..981de08 100644arch/arm/mach-omap2/board-omap3evm.c +7
-3@@ -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, };arch/arm/mach-omap2/board-omap3stalker.c +13
-6@@ -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.hb/arch/arm/plat-omap/include/plat/nokia-dsi-panel.hdeleted file mode 100644
index 01ab657..0000000
---a/arch/arm/plat-omap/include/plat/nokia-dsi-panel.h+++/dev/nullarch/arm/mach-omap2/board-omap3stalker.c +0
-32@@ -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..84c6ffdarch/arm/plat-omap/include/plat/panel.h new file +7
-0@@ -0,0 +1,57 @@ +/* +* Header for panel driver +* +* Copyright (C) 2010 Canonical Ltd. +* Author: Bryan Wu <[email protected]> +* +* 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, butarch/arm/plat-omap/include/plat/panel.h new file +7
-0+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 +alongwith + * this program. If not, see <http://www.gnu.org/licenses/>. + */
arch/arm/plat-omap/include/plat/panel.h new file +33
-0+ +#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 */ drivers/video/omap2/displays/panel-taal.c +4
-8@@ -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;drivers/video/omap2/displays/panel-taal.c +4
-4@@ -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(structomap_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);drivers/video/omap2/displays/panel-taal.c +1
-1@@ -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)
drivers/video/omap2/displays/panel-taal.c +1
-2@@ -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
PATCH 1/3 OMAP: use generic panel data in board files
Hi,
Quoted 28 lines · Archit
Hi,
Quoted 9 lines · [email protected] 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 thesharp_ls_paneldriver contains blacklight control driver code which will be moved out later. Then we can use generic DPI driver forsharp_ls_panel.Signed-off-by Bryan Wu <[email protected]>Quoted 15 lines
--- 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
Quoted 6 lines
I am not totally sure about the need of removal of
nokia-dsi-panel.hand the addition of a genericpanel.h.I guess the reason why
nokia-dsi-panel.hwas 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.
Quoted 7 lines
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_gpioandoff_gpio, this struct could then be passed and accessed throughdssdev->datain 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.
Quoted 6 lines
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_deviceshould 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
PATCH 1/3 OMAP: use generic panel data in board files
Quoted 55 lines · Tomi Valkeinen
Hi,
Quoted 28 lines · Archit
Hi,
Quoted 20 lines · linux-omap-owner at vger.kernel.org
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 thesharp_ls_paneldriver contains blacklight control driver code which will be moved out later. Then we can use generic DPI driver forsharp_ls_panel.Signed-off-by Bryan Wu <[email protected]>---
?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 ? ? ? ? ? | ? 57Quoted 4 lines
?+++++++++++++++++++++
drivers/video/omap2/displays/panel-taal.c? ? ? ? | ?26 ++++------ 11 files changed, 148 insertions(+), 85 deletions(-) ?delete mode 100644arch/arm/plat-omap/include/plat/nokia-dsi-panel.h?create mode 100644arch/arm/plat-omap/include/plat/panel.hQuoted 6 lines
I am not totally sure about the need of removal of
nokia-dsi-panel.hand the addition of a genericpanel.h.I guess the reason why
nokia-dsi-panel.hwas 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.cornokia-dsi-panel.h, they are not related to this DPI panel stuff.Quoted 7 lines
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_gpioandoff_gpio, this struct could then be passed and accessed throughdssdev->datain 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.Quoted 6 lines
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_deviceshould itself be enough for the generic dpi driver to handle things.
Quoted 7 lines
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,
Signature · 5 lines
Bryan Wu <[email protected]> Kernel Developer ? ?+86.138-1617-6545 Mobile Ubuntu Kernel Team Canonical Ltd. ? ? ?www.canonical.com Ubuntu - Linux for human beings | www.ubuntu.com
PATCH 1/3 OMAP: use generic panel data in board files
In reply to Bryan WuHi,
Quoted 7 lines · ext Bryan Wu
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 thesharp_ls_paneldriver contains blacklight control driver code which will be moved out later. Then we can use generic DPI driver forsharp_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.
Quoted 32 lines
Signed-off-by Bryan Wu <[email protected]>--- 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.harch/arm/mach-omap2/board-3430sdp.c +1
-0@@ -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, };
arch/arm/mach-omap2/board-3430sdp.c static struct omap_dss_device sdp3430_lcd_device = { · line 277
Quoted 10 lines
arch/arm/mach-omap2/board-3430sdp.c +4
-3+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
PATCH 1/3 OMAP: use generic panel data in board files
Quoted 7 lines · Tomi Valkeinen
Hi,
Quoted 4 lines · ext Bryan Wu
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.
Quoted 7 lines
Quoted 3 lines
Still keep
sharp_ls_panel, since thesharp_ls_paneldriver contains blacklight control driver code which will be moved out later. Then we can use generic DPI driver forsharp_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.
Quoted 5 lines
The
panel.hfile should be spesific for the generic panel driver, so name the .c and .h files similarly. (yes,panel-taal.candnokia-dsi-panel.hare 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.
Quoted 4 lines
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_paneldriver, but there is nodvi_paneldriver yet.
Got it. I will fold some patches together.
Quoted 35 lines
Also some comments inline.
Quoted 33 lines
Signed-off-by Bryan Wu <[email protected]>---
?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 100644arch/arm/plat-omap/include/plat/panel.harch/arm/mach-omap2/board-3430sdp.c +0
-0@@ -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>arch/arm/mach-omap2/board-3430sdp.c +0
-0@@ -270,11 +271,14 @@ static struct omap_dss_device sdp3430_lcd_device = { ? ? ? ? .platform_disable ? ? ? = sdp3430_panel_disable_lcd, ?};
Quoted 13 lines
arch/arm/mach-omap2/board-3430sdp.c static struct omap_dss_device sdp3430_lcd_device = { · line 277
Quoted 9 lines
arch/arm/mach-omap2/board-3430sdp.c +4
-3+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.
Signature · 5 lines
Bryan Wu <[email protected]> Kernel Developer ? ?+86.138-1617-6545 Mobile Ubuntu Kernel Team Canonical Ltd. ? ? ?www.canonical.com Ubuntu - Linux for human beings | www.ubuntu.com
PATCH 1/3 OMAP: use generic panel data in board files
Quoted 15 lines · ext Bryan Wu
Quoted 4 lines · Tomi Valkeinen
Hi,
On Fri, 2010-11-05 at 20:43 +0100, ext Bryan Wu wrote:
Quoted 9 lines
arch/arm/mach-omap2/board-3430sdp.c static struct omap_dss_device sdp3430_lcd_device = { · line 277
Quoted 5 lines
static struct
omap_dss_devicesdp3430_dvi_device= {
.name = "dvi",arch/arm/mach-omap2/board-3430sdp.c +0
-3- .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.
Quoted 5 lines
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
PATCH 2/3 OMAP: DSS2: Add generic panel display driver
In reply to Bryan WuGeneric 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.
--- 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
drivers/video/omap2/displays/Kconfig +8 -0
@@ -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
drivers/video/omap2/displays/Makefile +1 -0
@@ -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
drivers/video/omap2/displays/panel-dpi.c new file +306 -0
306 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH 2/3 OMAP: DSS2: Add generic panel display driver
Hi,
Quoted 11 lines · linux-omap-owner at vger.kernel.org
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.cto support new display panel.Signed-off-by Bryan Wu <[email protected]>---
[snip]
Quoted 38 lines
+++
b/drivers/video/omap2/displays/panel-dpi.cdrivers/video/omap2/displays/panel-dpi.c new file +9
-0@@ -0,0 +1,306 @@ +/* +* Generic DPI Panels support +* +* Copyright (C) 2010 Canonical Ltd. +* Author: Bryan Wu <[email protected]> +* +* Copyright (C) 2008 Nokia Corporation +* Author: Tomi Valkeinen <[email protected]> + * +* 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(quoted diff) +7
-0+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 +alongwith + * this program. If not, see <http://www.gnu.org/licenses/>. + */
drivers/video/omap2/displays/panel-dpi.c new file +10
-0+ +#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: lineclocks */ + int acb; /* ac-bias pin frequency */
drivers/video/omap2/displays/panel-dpi.c new file +1
-0+
drivers/video/omap2/displays/panel-dpi.c line 44
Quoted 10 lines
drivers/video/omap2/displays/panel-dpi.c new file +10
-0+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.
Quoted 251 lines
drivers/video/omap2/displays/panel-dpi.c new file +45
-0+ +/* 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|(quoted diff) +1
-0+ OMAP_DSS_LCD_IHS |
OMAP_DSS_LCD_IEO,drivers/video/omap2/displays/panel-dpi.c new file +23
-0+ .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|drivers/video/omap2/displays/panel-dpi.c new file +24
-0+ 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|(quoted diff) +1
-0+ OMAP_DSS_LCD_IHS |
OMAP_DSS_LCD_IPC|drivers/video/omap2/displays/panel-dpi.c new file +150
-1+ 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
PATCH 3/3 OMAP: DSS2: remove generic DPI panel driver duplicated panel drivers
In reply to Bryan WuStill keep sharp_ls_panel driver, because it contains blacklight control driver.
--- 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
drivers/video/omap2/displays/Kconfig +0 -18
@@ -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
drivers/video/omap2/displays/Makefile +0 -3
@@ -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
drivers/video/omap2/displays/panel-generic.c deleted +0 -174
174 lines not on this page · raw message
drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c deleted +0 -165
165 lines not on this page · raw message
drivers/video/omap2/displays/panel-toppoly-tdo35s.c deleted +0 -164
164 lines not on this page · raw message
Signature · 1 line
1.7.1