[PATCH 06/21] ARM: OMAP: overo: use new display drivers

2013-07-26 Thread Tomi Valkeinen
Use the new display drivers for OMAP3 Overo board.

The new OMAP display drivers were merged for 3.11, and we can now change
the board files to use the new ones and phase out the old ones.

Note that the LCD add-on boards for lcd43 and lcd35 use the same GPIOs
for the panels. This means that both panel devices cannot be probed at
the same time.

DT will handle this correctly, i.e. the DT data will contain the panel
device only for the add-on board that is attached. However, for the
board file we need a hackish solution: We parse the kernel boot command
line, and see whether lcd43 or lcd35 is set as a default display, and
add the given one. Or, if neither is given, default to lcd43.

Signed-off-by: Tomi Valkeinen 
---
 arch/arm/mach-omap2/board-overo.c | 160 --
 1 file changed, 100 insertions(+), 60 deletions(-)

diff --git a/arch/arm/mach-omap2/board-overo.c 
b/arch/arm/mach-omap2/board-overo.c
index 5748b5d..f6d3841 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -72,6 +72,9 @@
 #define OVERO_SMSC911X2_CS 4
 #define OVERO_SMSC911X2_GPIO   65
 
+/* whether to register LCD35 instead of LCD43 */
+static bool overo_use_lcd35;
+
 #if defined(CONFIG_TOUCHSCREEN_ADS7846) || \
defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
 
@@ -149,78 +152,94 @@ static inline void __init overo_init_smsc911x(void) { 
return; }
 #define OVERO_GPIO_LCD_EN 144
 #define OVERO_GPIO_LCD_BL 145
 
-static struct tfp410_platform_data dvi_panel = {
-   .i2c_bus_num= 3,
-   .power_down_gpio= -1,
+static struct connector_atv_platform_data overo_tv_pdata = {
+   .name = "tv",
+   .source = "venc.0",
+   .connector_type = OMAP_DSS_VENC_TYPE_SVIDEO,
+   .invert_polarity = false,
 };
 
-static struct omap_dss_device overo_dvi_device = {
-   .name   = "dvi",
-   .type   = OMAP_DISPLAY_TYPE_DPI,
-   .driver_name= "tfp410",
-   .data   = &dvi_panel,
-   .phy.dpi.data_lines = 24,
+static struct platform_device overo_tv_connector_device = {
+   .name   = "connector-analog-tv",
+   .id = 0,
+   .dev.platform_data  = &overo_tv_pdata,
 };
 
-static struct omap_dss_device overo_tv_device = {
-   .name = "tv",
-   .driver_name = "venc",
-   .type = OMAP_DISPLAY_TYPE_VENC,
-   .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
+static const struct display_timing overo_lcd43_videomode = {
+   .pixelclock = { 0, 920, 0 },
+
+   .hactive = { 0, 480, 0 },
+   .hfront_porch = { 0, 8, 0 },
+   .hback_porch = { 0, 4, 0 },
+   .hsync_len = { 0, 41, 0 },
+
+   .vactive = { 0, 272, 0 },
+   .vfront_porch = { 0, 4, 0 },
+   .vback_porch = { 0, 2, 0 },
+   .vsync_len = { 0, 10, 0 },
+
+   .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
+   DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_POSEDGE,
 };
 
-static struct panel_generic_dpi_data lcd43_panel = {
-   .name   = "samsung_lte430wq_f0c",
-   .num_gpios  = 2,
-   .gpios  = {
-   OVERO_GPIO_LCD_EN,
-   OVERO_GPIO_LCD_BL
-   },
+static struct panel_dpi_platform_data overo_lcd43_pdata = {
+   .name   = "lcd43",
+   .source = "dpi.0",
+
+   .data_lines = 24,
+
+   .display_timing = &overo_lcd43_videomode,
+
+   .enable_gpio= OVERO_GPIO_LCD_EN,
+   .backlight_gpio = OVERO_GPIO_LCD_BL,
 };
 
-static struct omap_dss_device overo_lcd43_device = {
-   .name   = "lcd43",
-   .type   = OMAP_DISPLAY_TYPE_DPI,
-   .driver_name= "generic_dpi_panel",
-   .data   = &lcd43_panel,
-   .phy.dpi.data_lines = 24,
+static struct platform_device overo_lcd43_device = {
+   .name   = "panel-dpi",
+   .id = 0,
+   .dev.platform_data  = &overo_lcd43_pdata,
 };
 
-#if defined(CONFIG_PANEL_LGPHILIPS_LB035Q02) || \
-   defined(CONFIG_PANEL_LGPHILIPS_LB035Q02_MODULE)
-static struct panel_generic_dpi_data lcd35_panel = {
-   .num_gpios  = 2,
-   .gpios  = {
-   OVERO_GPIO_LCD_EN,
-   OVERO_GPIO_LCD_BL
-   },
+static struct connector_dvi_platform_data overo_dvi_connector_pdata = {
+   .name   = "dvi",
+   .source = "tfp410.0",
+   .i2c_bus_num= 3,
 };
 
-static struct omap_dss_device overo_lcd35_device = {
-   .type   = OMAP_DISPLAY_TYPE_DPI,
-   .name   = "lcd35",
-   .driver_name= "lgphilips_lb035q02_panel",
-   .phy.dpi.data_lines = 24,
-   .data   = &lcd35_panel,
+static struct platform_dev

Re: [PATCH 06/21] ARM: OMAP: overo: use new display drivers

2013-07-29 Thread Archit Taneja

Hi,

On Friday 26 July 2013 12:38 PM, Tomi Valkeinen wrote:

Use the new display drivers for OMAP3 Overo board.

The new OMAP display drivers were merged for 3.11, and we can now change
the board files to use the new ones and phase out the old ones.

Note that the LCD add-on boards for lcd43 and lcd35 use the same GPIOs
for the panels. This means that both panel devices cannot be probed at
the same time.

DT will handle this correctly, i.e. the DT data will contain the panel
device only for the add-on board that is attached. However, for the
board file we need a hackish solution: We parse the kernel boot command
line, and see whether lcd43 or lcd35 is set as a default display, and
add the given one. Or, if neither is given, default to lcd43.






  static struct omap_dss_board_info overo_dss_data = {
-   .num_devices= ARRAY_SIZE(overo_dss_devices),
-   .devices= overo_dss_devices,
-   .default_device = &overo_dvi_device,
+   .default_display_name = "lcd43",
  };


The default display previously was the dvi device, if both lcd43 and 
lcd35 are on add-on boards, then we should probably stick to dvi itself, 
right? The hack won't work if dvi is the default device though.


Archit

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 06/21] ARM: OMAP: overo: use new display drivers

2013-07-29 Thread Tomi Valkeinen
On 30/07/13 09:21, Archit Taneja wrote:
> Hi,
> 
> On Friday 26 July 2013 12:38 PM, Tomi Valkeinen wrote:
>> Use the new display drivers for OMAP3 Overo board.
>>
>> The new OMAP display drivers were merged for 3.11, and we can now change
>> the board files to use the new ones and phase out the old ones.
>>
>> Note that the LCD add-on boards for lcd43 and lcd35 use the same GPIOs
>> for the panels. This means that both panel devices cannot be probed at
>> the same time.
>>
>> DT will handle this correctly, i.e. the DT data will contain the panel
>> device only for the add-on board that is attached. However, for the
>> board file we need a hackish solution: We parse the kernel boot command
>> line, and see whether lcd43 or lcd35 is set as a default display, and
>> add the given one. Or, if neither is given, default to lcd43.
>>
> 
> 
> 
>>   static struct omap_dss_board_info overo_dss_data = {
>> -.num_devices= ARRAY_SIZE(overo_dss_devices),
>> -.devices= overo_dss_devices,
>> -.default_device= &overo_dvi_device,
>> +.default_display_name = "lcd43",
>>   };
> 
> The default display previously was the dvi device, if both lcd43 and
> lcd35 are on add-on boards, then we should probably stick to dvi itself,
> right? The hack won't work if dvi is the default device though.

DVI is also on an add-on board, but it doesn't conflict with lcd43 or lcd35.

The hack works fine even if DVI is the default device. In that case, it
doesn't matter if lcd43 or lcd35 is added, because the user doesn't use
them (as long as only one of them is added, because otherwise there'll
be an error during probe).

If DVI is the default device, we could actually skip adding both lcd43
and lcd35. I just wanted to minimize the code in this hack, so I didn't
do that.

 Tomi




signature.asc
Description: OpenPGP digital signature


Re: [PATCH 06/21] ARM: OMAP: overo: use new display drivers

2013-07-30 Thread Archit Taneja

On Tuesday 30 July 2013 12:09 PM, Tomi Valkeinen wrote:

On 30/07/13 09:21, Archit Taneja wrote:

Hi,

On Friday 26 July 2013 12:38 PM, Tomi Valkeinen wrote:

Use the new display drivers for OMAP3 Overo board.

The new OMAP display drivers were merged for 3.11, and we can now change
the board files to use the new ones and phase out the old ones.

Note that the LCD add-on boards for lcd43 and lcd35 use the same GPIOs
for the panels. This means that both panel devices cannot be probed at
the same time.

DT will handle this correctly, i.e. the DT data will contain the panel
device only for the add-on board that is attached. However, for the
board file we need a hackish solution: We parse the kernel boot command
line, and see whether lcd43 or lcd35 is set as a default display, and
add the given one. Or, if neither is given, default to lcd43.






   static struct omap_dss_board_info overo_dss_data = {
-.num_devices= ARRAY_SIZE(overo_dss_devices),
-.devices= overo_dss_devices,
-.default_device= &overo_dvi_device,
+.default_display_name = "lcd43",
   };


The default display previously was the dvi device, if both lcd43 and
lcd35 are on add-on boards, then we should probably stick to dvi itself,
right? The hack won't work if dvi is the default device though.


DVI is also on an add-on board, but it doesn't conflict with lcd43 or lcd35.

The hack works fine even if DVI is the default device. In that case, it
doesn't matter if lcd43 or lcd35 is added, because the user doesn't use
them (as long as only one of them is added, because otherwise there'll
be an error during probe).

If DVI is the default device, we could actually skip adding both lcd43
and lcd35. I just wanted to minimize the code in this hack, so I didn't
do that.


Okay, thanks for the clarification, looks fine then.

Archit

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html