* [PATCH 0/6] OMAP: board file changes for DSS2 porting
@ 2011-05-09 7:36 Tomi Valkeinen
2011-05-09 7:36 ` [PATCH 1/6] OMAP: RX51: Remove unused old omapfb stuff Tomi Valkeinen
` (6 more replies)
0 siblings, 7 replies; 34+ messages in thread
From: Tomi Valkeinen @ 2011-05-09 7:36 UTC (permalink / raw)
To: tony; +Cc: linux-omap, Tomi Valkeinen
Hi Tony,
I posted last week a patch set porting most of the old omapfb OMAP2/3 drivers
to DSS2 (http://marc.info/?l=linux-fbdev&m=130451207802788&w=2). That patch set
contains changes to both the drivers and the board files, and it seems there is
already a minor conflict in them.
So I think it's simpler to divide the set into two parts, this one, which
contains the board file changes, and another containing the driver changes.
Merging will probably go easier if you can take this patch set via linux-omap,
and I'll take the driver changes via dss2 tree.
Applying this set without the driver changes will obviously disable the
displays of the affected boards until the drivers are also merged.
Tomi
Tomi Valkeinen (6):
OMAP: RX51: Remove unused old omapfb stuff
OMAP: omap3touchbook: Remove unused lcd stuff
OMAP: 2420SDP: Port the display driver to new DSS2
OMAP: LDP: Port the display driver to new DSS2
OMAP: H4: Port the display driver to new DSS2
OMAP: Apollon: Port the display driver to new DSS2
arch/arm/mach-omap2/board-2430sdp.c | 84 +++++++++++++++++++++++-----
arch/arm/mach-omap2/board-apollon.c | 34 +++++++----
arch/arm/mach-omap2/board-h4.c | 41 ++++++++-----
arch/arm/mach-omap2/board-ldp.c | 73 +++++++++++++++++++++---
arch/arm/mach-omap2/board-omap3touchbook.c | 18 ------
arch/arm/mach-omap2/board-rx51.c | 25 --------
6 files changed, 180 insertions(+), 95 deletions(-)
--
1.7.4.1
^ permalink raw reply [flat|nested] 34+ messages in thread
* [PATCH 1/6] OMAP: RX51: Remove unused old omapfb stuff
2011-05-09 7:36 [PATCH 0/6] OMAP: board file changes for DSS2 porting Tomi Valkeinen
@ 2011-05-09 7:36 ` Tomi Valkeinen
2011-05-09 7:36 ` [PATCH 2/6] OMAP: omap3touchbook: Remove unused lcd stuff Tomi Valkeinen
` (5 subsequent siblings)
6 siblings, 0 replies; 34+ messages in thread
From: Tomi Valkeinen @ 2011-05-09 7:36 UTC (permalink / raw)
To: tony; +Cc: linux-omap, Tomi Valkeinen
RX51 uses the new DSS2 display driver, but the board file still
contained some code for the old omapfb driver. The old code can be
removed.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
arch/arm/mach-omap2/board-rx51.c | 25 -------------------------
1 files changed, 0 insertions(+), 25 deletions(-)
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
index e964895..116e19b 100644
--- a/arch/arm/mach-omap2/board-rx51.c
+++ b/arch/arm/mach-omap2/board-rx51.c
@@ -75,29 +75,6 @@ static struct cpuidle_params rx51_cpuidle_params[] = {
{1, 7505, 15274, 484329},
};
-static struct omap_lcd_config rx51_lcd_config = {
- .ctrl_name = "internal",
-};
-
-static struct omap_fbmem_config rx51_fbmem0_config = {
- .size = 752 * 1024,
-};
-
-static struct omap_fbmem_config rx51_fbmem1_config = {
- .size = 752 * 1024,
-};
-
-static struct omap_fbmem_config rx51_fbmem2_config = {
- .size = 752 * 1024,
-};
-
-static struct omap_board_config_kernel rx51_config[] = {
- { OMAP_TAG_FBMEM, &rx51_fbmem0_config },
- { OMAP_TAG_FBMEM, &rx51_fbmem1_config },
- { OMAP_TAG_FBMEM, &rx51_fbmem2_config },
- { OMAP_TAG_LCD, &rx51_lcd_config },
-};
-
static void __init rx51_init_early(void)
{
struct omap_sdrc_params *sdrc_params;
@@ -124,8 +101,6 @@ static struct omap_musb_board_data musb_board_data = {
static void __init rx51_init(void)
{
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
- omap_board_config = rx51_config;
- omap_board_config_size = ARRAY_SIZE(rx51_config);
omap3_pm_init_cpuidle(rx51_cpuidle_params);
omap_serial_init();
usb_musb_init(&musb_board_data);
--
1.7.4.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 2/6] OMAP: omap3touchbook: Remove unused lcd stuff
2011-05-09 7:36 [PATCH 0/6] OMAP: board file changes for DSS2 porting Tomi Valkeinen
2011-05-09 7:36 ` [PATCH 1/6] OMAP: RX51: Remove unused old omapfb stuff Tomi Valkeinen
@ 2011-05-09 7:36 ` Tomi Valkeinen
2011-05-09 7:36 ` [PATCH 3/6] OMAP: 2420SDP: Port the display driver to new DSS2 Tomi Valkeinen
` (4 subsequent siblings)
6 siblings, 0 replies; 34+ messages in thread
From: Tomi Valkeinen @ 2011-05-09 7:36 UTC (permalink / raw)
To: tony; +Cc: linux-omap, Tomi Valkeinen, Gregoire Gentil
board-omap3touchbook.c adds an LCD device, but the kernel doesn't
contain a driver for the device. So let's remove the unneeded LCD
device.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Gregoire Gentil <gregoire@gentil.com>
---
arch/arm/mach-omap2/board-omap3touchbook.c | 18 ------------------
1 files changed, 0 insertions(+), 18 deletions(-)
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
index 127cb17..1c717a4 100644
--- a/arch/arm/mach-omap2/board-omap3touchbook.c
+++ b/arch/arm/mach-omap2/board-omap3touchbook.c
@@ -115,15 +115,6 @@ static struct omap2_hsmmc_info mmc[] = {
{} /* Terminator */
};
-static struct platform_device omap3_touchbook_lcd_device = {
- .name = "omap3touchbook_lcd",
- .id = -1,
-};
-
-static struct omap_lcd_config omap3_touchbook_lcd_config __initdata = {
- .ctrl_name = "internal",
-};
-
static struct regulator_consumer_supply touchbook_vmmc1_supply = {
.supply = "vmmc",
};
@@ -181,12 +172,10 @@ static struct twl4030_gpio_platform_data touchbook_gpio_data = {
static struct regulator_consumer_supply touchbook_vdac_supply = {
.supply = "vdac",
- .dev = &omap3_touchbook_lcd_device.dev,
};
static struct regulator_consumer_supply touchbook_vdvi_supply = {
.supply = "vdvi",
- .dev = &omap3_touchbook_lcd_device.dev,
};
/* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
@@ -403,10 +392,6 @@ static struct platform_device keys_gpio = {
},
};
-static struct omap_board_config_kernel omap3_touchbook_config[] __initdata = {
- { OMAP_TAG_LCD, &omap3_touchbook_lcd_config },
-};
-
#ifdef CONFIG_OMAP_MUX
static struct omap_board_mux board_mux[] __initdata = {
{ .reg_offset = OMAP_MUX_TERMINATOR },
@@ -429,7 +414,6 @@ static void __init omap3_touchbook_init_irq(void)
}
static struct platform_device *omap3_touchbook_devices[] __initdata = {
- &omap3_touchbook_lcd_device,
&leds_gpio,
&keys_gpio,
};
@@ -510,8 +494,6 @@ static struct omap_musb_board_data musb_board_data = {
static void __init omap3_touchbook_init(void)
{
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
- omap_board_config = omap3_touchbook_config;
- omap_board_config_size = ARRAY_SIZE(omap3_touchbook_config);
pm_power_off = omap3_touchbook_poweroff;
--
1.7.4.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 3/6] OMAP: 2420SDP: Port the display driver to new DSS2
2011-05-09 7:36 [PATCH 0/6] OMAP: board file changes for DSS2 porting Tomi Valkeinen
2011-05-09 7:36 ` [PATCH 1/6] OMAP: RX51: Remove unused old omapfb stuff Tomi Valkeinen
2011-05-09 7:36 ` [PATCH 2/6] OMAP: omap3touchbook: Remove unused lcd stuff Tomi Valkeinen
@ 2011-05-09 7:36 ` Tomi Valkeinen
2011-05-09 8:21 ` Igor Grinberg
2011-05-09 7:36 ` [PATCH 4/6] OMAP: LDP: " Tomi Valkeinen
` (3 subsequent siblings)
6 siblings, 1 reply; 34+ messages in thread
From: Tomi Valkeinen @ 2011-05-09 7:36 UTC (permalink / raw)
To: tony; +Cc: linux-omap, Tomi Valkeinen, Hunyue Yau
Port the old omapfb panel driver to DSS2. This patch changes the board
file only, the driver is ported in separate patch.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Hunyue Yau <hyau@mvista.com>
---
arch/arm/mach-omap2/board-2430sdp.c | 84 +++++++++++++++++++++++++++++------
1 files changed, 70 insertions(+), 14 deletions(-)
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index 1fa6bb8..9b6e987 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -38,6 +38,8 @@
#include <plat/gpmc.h>
#include <plat/usb.h>
#include <plat/gpmc-smc91x.h>
+#include <plat/display.h>
+#include <plat/panel-generic-dpi.h>
#include "mux.h"
#include "hsmmc.h"
@@ -98,20 +100,79 @@ static struct platform_device sdp2430_flash_device = {
.resource = &sdp2430_flash_resource,
};
-static struct platform_device sdp2430_lcd_device = {
- .name = "sdp2430_lcd",
- .id = -1,
-};
-
static struct platform_device *sdp2430_devices[] __initdata = {
&sdp2430_flash_device,
+};
+
+/* LCD */
+#define SDP2430_LCD_PANEL_BACKLIGHT_GPIO 91
+#define SDP2430_LCD_PANEL_ENABLE_GPIO 154
+
+static int sdp2430_panel_enable_lcd(struct omap_dss_device *dssdev)
+{
+ gpio_direction_output(SDP2430_LCD_PANEL_ENABLE_GPIO, 1);
+ gpio_direction_output(SDP2430_LCD_PANEL_BACKLIGHT_GPIO, 1);
+
+ return 0;
+}
+
+static void sdp2430_panel_disable_lcd(struct omap_dss_device *dssdev)
+{
+ gpio_direction_output(SDP2430_LCD_PANEL_ENABLE_GPIO, 0);
+ gpio_direction_output(SDP2430_LCD_PANEL_BACKLIGHT_GPIO, 0);
+}
+
+static struct panel_generic_dpi_data sdp2430_panel_data = {
+ .name = "2430sdp",
+ .platform_enable = sdp2430_panel_enable_lcd,
+ .platform_disable = sdp2430_panel_disable_lcd,
+};
+
+static struct omap_dss_device sdp2430_lcd_device = {
+ .name = "lcd",
+ .driver_name = "generic_dpi_panel",
+ .type = OMAP_DISPLAY_TYPE_DPI,
+ .phy.dpi.data_lines = 16,
+ .data = &sdp2430_panel_data,
+};
+
+static struct omap_dss_device *sdp2430_dss_devices[] = {
&sdp2430_lcd_device,
};
-static struct omap_lcd_config sdp2430_lcd_config __initdata = {
- .ctrl_name = "internal",
+static struct omap_dss_board_info sdp2430_dss_data = {
+ .num_devices = ARRAY_SIZE(sdp2430_dss_devices),
+ .devices = sdp2430_dss_devices,
+ .default_device = &sdp2430_lcd_device,
};
+static void __init sdp2430_display_init(void)
+{
+ int r;
+
+ r = gpio_request_one(SDP2430_LCD_PANEL_ENABLE_GPIO,
+ GPIOF_OUT_INIT_LOW, "LCD reset");
+ if (r) {
+ printk(KERN_ERR "failed to get LCD reset GPIO\n");
+ goto err0;
+ }
+
+ r = gpio_request_one(SDP2430_LCD_PANEL_BACKLIGHT_GPIO,
+ GPIOF_OUT_INIT_LOW, "LCD Backlight");
+ if (r) {
+ printk(KERN_ERR "failed to get LCD backlight GPIO\n");
+ goto err1;
+ }
+
+ omap_display_init(&sdp2430_dss_data);
+
+ return;
+err1:
+ gpio_free(SDP2430_LCD_PANEL_ENABLE_GPIO);
+err0:
+ return;
+}
+
#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91x_MODULE)
static struct omap_smc91x_platform_data board_smc91x_data = {
@@ -136,10 +197,6 @@ static inline void board_smc91x_init(void)
#endif
-static struct omap_board_config_kernel sdp2430_config[] __initdata = {
- {OMAP_TAG_LCD, &sdp2430_lcd_config},
-};
-
static void __init omap_2430sdp_init_early(void)
{
omap2_init_common_infrastructure();
@@ -244,9 +301,6 @@ static void __init omap_2430sdp_init(void)
omap2430_mux_init(board_mux, OMAP_PACKAGE_ZAC);
- omap_board_config = sdp2430_config;
- omap_board_config_size = ARRAY_SIZE(sdp2430_config);
-
omap2430_i2c_init();
platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices));
@@ -263,6 +317,8 @@ static void __init omap_2430sdp_init(void)
ret = gpio_request(SECONDARY_LCD_GPIO, "Secondary LCD backlight");
if (ret == 0)
gpio_direction_output(SECONDARY_LCD_GPIO, 0);
+
+ sdp2430_display_init();
}
static void __init omap_2430sdp_map_io(void)
--
1.7.4.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 4/6] OMAP: LDP: Port the display driver to new DSS2
2011-05-09 7:36 [PATCH 0/6] OMAP: board file changes for DSS2 porting Tomi Valkeinen
` (2 preceding siblings ...)
2011-05-09 7:36 ` [PATCH 3/6] OMAP: 2420SDP: Port the display driver to new DSS2 Tomi Valkeinen
@ 2011-05-09 7:36 ` Tomi Valkeinen
2011-05-09 8:08 ` stanley.miao
2011-05-11 4:58 ` Janorkar, Mayuresh
2011-05-09 7:36 ` [PATCH 5/6] OMAP: H4: " Tomi Valkeinen
` (2 subsequent siblings)
6 siblings, 2 replies; 34+ messages in thread
From: Tomi Valkeinen @ 2011-05-09 7:36 UTC (permalink / raw)
To: tony; +Cc: linux-omap, Tomi Valkeinen, Stanley Miao
Port the old omapfb panel driver to DSS2i. This patch changes the board
file only, the driver is ported in separate patch.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Stanley Miao <stanley.miao@windriver.com>
---
arch/arm/mach-omap2/board-ldp.c | 73 +++++++++++++++++++++++++++++++++-----
1 files changed, 63 insertions(+), 10 deletions(-)
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index e2ba779..2fdfd7f 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -43,6 +43,8 @@
#include <asm/delay.h>
#include <plat/usb.h>
+#include <plat/display.h>
+#include <plat/panel-generic-dpi.h>
#include "board-flash.h"
#include "mux.h"
@@ -275,19 +277,71 @@ static inline void __init ldp_init_smsc911x(void)
gpio_direction_input(eth_gpio);
}
-static struct platform_device ldp_lcd_device = {
- .name = "ldp_lcd",
- .id = -1,
+/* LCD */
+
+#define LCD_PANEL_BACKLIGHT_GPIO (15 + OMAP_MAX_GPIO_LINES)
+#define LCD_PANEL_ENABLE_GPIO (7 + OMAP_MAX_GPIO_LINES)
+#define LCD_PANEL_RESET_GPIO 55
+#define LCD_PANEL_QVGA_GPIO 56
+
+static int ldp_panel_enable_lcd(struct omap_dss_device *dssdev)
+{
+ gpio_direction_output(LCD_PANEL_ENABLE_GPIO, 1);
+ gpio_direction_output(LCD_PANEL_BACKLIGHT_GPIO, 1);
+
+ return 0;
+}
+
+static void ldp_panel_disable_lcd(struct omap_dss_device *dssdev)
+{
+ gpio_direction_output(LCD_PANEL_ENABLE_GPIO, 0);
+ gpio_direction_output(LCD_PANEL_BACKLIGHT_GPIO, 0);
+}
+
+static struct panel_generic_dpi_data ldp_panel_data = {
+ .name = "2430sdp",
+ .platform_enable = ldp_panel_enable_lcd,
+ .platform_disable = ldp_panel_disable_lcd,
};
-static struct omap_lcd_config ldp_lcd_config __initdata = {
- .ctrl_name = "internal",
+static struct omap_dss_device ldp_lcd_device = {
+ .name = "lcd",
+ .driver_name = "generic_dpi_panel",
+ .type = OMAP_DISPLAY_TYPE_DPI,
+ .phy.dpi.data_lines = 16,
+ .data = &ldp_panel_data,
};
-static struct omap_board_config_kernel ldp_config[] __initdata = {
- { OMAP_TAG_LCD, &ldp_lcd_config },
+static struct omap_dss_device *ldp_dss_devices[] = {
+ &ldp_lcd_device,
+};
+
+static struct omap_dss_board_info ldp_dss_data = {
+ .num_devices = ARRAY_SIZE(ldp_dss_devices),
+ .devices = ldp_dss_devices,
+ .default_device = &ldp_lcd_device,
};
+static void __init ldp_display_init(void)
+{
+ int r;
+
+ struct gpio gpios[] = {
+ {LCD_PANEL_RESET_GPIO, GPIOF_OUT_INIT_HIGH, "LCD RESET"},
+ {LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, "LCD QVGA"},
+ {LCD_PANEL_ENABLE_GPIO, GPIOF_OUT_INIT_LOW, "LCD ENABLE"},
+ {LCD_PANEL_BACKLIGHT_GPIO, GPIOF_OUT_INIT_LOW, "LCD BACKLIGHT"},
+ };
+
+ r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
+ if (r) {
+ pr_err("Cannot request LCD GPIOs, error %d\n", r);
+ return;
+ }
+
+ omap_display_init(&ldp_dss_data);
+}
+
static void __init omap_ldp_init_early(void)
{
omap2_init_common_infrastructure();
@@ -390,7 +444,6 @@ static struct omap2_hsmmc_info mmc[] __initdata = {
static struct platform_device *ldp_devices[] __initdata = {
&ldp_smsc911x_device,
- &ldp_lcd_device,
&ldp_gpio_keys_device,
};
@@ -441,8 +494,6 @@ static struct mtd_partition ldp_nand_partitions[] = {
static void __init omap_ldp_init(void)
{
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
- omap_board_config = ldp_config;
- omap_board_config_size = ARRAY_SIZE(ldp_config);
ldp_init_smsc911x();
omap_i2c_init();
platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices));
@@ -459,6 +510,8 @@ static void __init omap_ldp_init(void)
omap2_hsmmc_init(mmc);
/* link regulators to MMC adapters */
ldp_vmmc1_supply.dev = mmc[0].dev;
+
+ ldp_display_init();
}
MACHINE_START(OMAP_LDP, "OMAP LDP board")
--
1.7.4.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 5/6] OMAP: H4: Port the display driver to new DSS2
2011-05-09 7:36 [PATCH 0/6] OMAP: board file changes for DSS2 porting Tomi Valkeinen
` (3 preceding siblings ...)
2011-05-09 7:36 ` [PATCH 4/6] OMAP: LDP: " Tomi Valkeinen
@ 2011-05-09 7:36 ` Tomi Valkeinen
2011-05-09 7:36 ` [PATCH 6/6] OMAP: Apollon: " Tomi Valkeinen
2011-05-09 17:01 ` [PATCH 0/6] OMAP: board file changes for DSS2 porting Tomi Valkeinen
6 siblings, 0 replies; 34+ messages in thread
From: Tomi Valkeinen @ 2011-05-09 7:36 UTC (permalink / raw)
To: tony; +Cc: linux-omap, Tomi Valkeinen
Port the old omapfb panel driver to DSS2. This patch changes the board
file only, the driver is ported in separate patch.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
arch/arm/mach-omap2/board-h4.c | 41 ++++++++++++++++++++++++---------------
1 files changed, 25 insertions(+), 16 deletions(-)
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
index bac7933..991e71e 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -39,6 +39,8 @@
#include <plat/menelaus.h>
#include <plat/dma.h>
#include <plat/gpmc.h>
+#include <plat/display.h>
+#include <plat/panel-generic-dpi.h>
#include "mux.h"
#include "control.h"
@@ -157,17 +159,33 @@ static struct platform_device h4_kp_device = {
},
};
-static struct platform_device h4_lcd_device = {
- .name = "lcd_h4",
- .id = -1,
-};
-
static struct platform_device *h4_devices[] __initdata = {
&h4_flash_device,
&h4_kp_device,
+};
+
+static struct panel_generic_dpi_data h4_panel_data = {
+ .name = "h4",
+};
+
+static struct omap_dss_device h4_lcd_device = {
+ .name = "lcd",
+ .driver_name = "generic_dpi_panel",
+ .type = OMAP_DISPLAY_TYPE_DPI,
+ .phy.dpi.data_lines = 16,
+ .data = &h4_panel_data,
+};
+
+static struct omap_dss_device *h4_dss_devices[] = {
&h4_lcd_device,
};
+static struct omap_dss_board_info h4_dss_data = {
+ .num_devices = ARRAY_SIZE(h4_dss_devices),
+ .devices = h4_dss_devices,
+ .default_device = &h4_lcd_device,
+};
+
/* 2420 Sysboot setup (2430 is different) */
static u32 get_sysboot_value(void)
{
@@ -271,10 +289,6 @@ static void __init h4_init_flash(void)
h4_flash_resource.end = base + SZ_64M - 1;
}
-static struct omap_lcd_config h4_lcd_config __initdata = {
- .ctrl_name = "internal",
-};
-
static struct omap_usb_config h4_usb_config __initdata = {
/* S1.10 OFF -- usb "download port"
* usb0 switched to Mini-B port and isp1105 transceiver;
@@ -286,10 +300,6 @@ static struct omap_usb_config h4_usb_config __initdata = {
.hmc_mode = 0x00, /* 0:dev|otg 1:disable 2:disable */
};
-static struct omap_board_config_kernel h4_config[] __initdata = {
- { OMAP_TAG_LCD, &h4_lcd_config },
-};
-
static void __init omap_h4_init_early(void)
{
omap2_init_common_infrastructure();
@@ -331,9 +341,6 @@ static void __init omap_h4_init(void)
{
omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAF);
- omap_board_config = h4_config;
- omap_board_config_size = ARRAY_SIZE(h4_config);
-
/*
* Make sure the serial ports are muxed on at this point.
* You have to mux them off in device drivers later on
@@ -372,6 +379,8 @@ static void __init omap_h4_init(void)
omap2_usbfs_init(&h4_usb_config);
omap_serial_init();
h4_init_flash();
+
+ omap_display_init(&h4_dss_data);
}
static void __init omap_h4_map_io(void)
--
1.7.4.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 6/6] OMAP: Apollon: Port the display driver to new DSS2
2011-05-09 7:36 [PATCH 0/6] OMAP: board file changes for DSS2 porting Tomi Valkeinen
` (4 preceding siblings ...)
2011-05-09 7:36 ` [PATCH 5/6] OMAP: H4: " Tomi Valkeinen
@ 2011-05-09 7:36 ` Tomi Valkeinen
2011-05-09 17:01 ` [PATCH 0/6] OMAP: board file changes for DSS2 porting Tomi Valkeinen
6 siblings, 0 replies; 34+ messages in thread
From: Tomi Valkeinen @ 2011-05-09 7:36 UTC (permalink / raw)
To: tony; +Cc: linux-omap, Tomi Valkeinen, Kyungmin Park
Port the old omapfb panel driver to DSS2. This patch changes the board
file only, the driver is ported in separate patch.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
---
arch/arm/mach-omap2/board-apollon.c | 34 ++++++++++++++++++++++------------
1 files changed, 22 insertions(+), 12 deletions(-)
diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c
index f4f8374..0414c17 100644
--- a/arch/arm/mach-omap2/board-apollon.c
+++ b/arch/arm/mach-omap2/board-apollon.c
@@ -39,6 +39,8 @@
#include <plat/board.h>
#include <plat/common.h>
#include <plat/gpmc.h>
+#include <plat/display.h>
+#include <plat/panel-generic-dpi.h>
#include "mux.h"
#include "control.h"
@@ -149,11 +151,6 @@ static struct platform_device apollon_smc91x_device = {
.resource = apollon_smc91x_resources,
};
-static struct platform_device apollon_lcd_device = {
- .name = "apollon_lcd",
- .id = -1,
-};
-
static struct omap_led_config apollon_led_config[] = {
{
.cdev = {
@@ -191,7 +188,6 @@ static struct platform_device apollon_led_device = {
static struct platform_device *apollon_devices[] __initdata = {
&apollon_onenand_device,
&apollon_smc91x_device,
- &apollon_lcd_device,
&apollon_led_device,
};
@@ -266,12 +262,26 @@ static struct omap_usb_config apollon_usb_config __initdata = {
.pins[0] = 6,
};
-static struct omap_lcd_config apollon_lcd_config __initdata = {
- .ctrl_name = "internal",
+static struct panel_generic_dpi_data apollon_panel_data = {
+ .name = "apollon",
+};
+
+static struct omap_dss_device apollon_lcd_device = {
+ .name = "lcd",
+ .driver_name = "generic_dpi_panel",
+ .type = OMAP_DISPLAY_TYPE_DPI,
+ .phy.dpi.data_lines = 18,
+ .data = &apollon_panel_data,
};
-static struct omap_board_config_kernel apollon_config[] __initdata = {
- { OMAP_TAG_LCD, &apollon_lcd_config },
+static struct omap_dss_device *apollon_dss_devices[] = {
+ &apollon_lcd_device,
+};
+
+static struct omap_dss_board_info apollon_dss_data = {
+ .num_devices = ARRAY_SIZE(apollon_dss_devices),
+ .devices = apollon_dss_devices,
+ .default_device = &apollon_lcd_device,
};
static void __init omap_apollon_init_early(void)
@@ -317,8 +327,6 @@ static void __init omap_apollon_init(void)
u32 v;
omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC);
- omap_board_config = apollon_config;
- omap_board_config_size = ARRAY_SIZE(apollon_config);
apollon_init_smc91x();
apollon_led_init();
@@ -343,6 +351,8 @@ static void __init omap_apollon_init(void)
*/
platform_add_devices(apollon_devices, ARRAY_SIZE(apollon_devices));
omap_serial_init();
+
+ omap_display_init(&apollon_dss_data);
}
static void __init omap_apollon_map_io(void)
--
1.7.4.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* Re: [PATCH 4/6] OMAP: LDP: Port the display driver to new DSS2
2011-05-09 7:36 ` [PATCH 4/6] OMAP: LDP: " Tomi Valkeinen
@ 2011-05-09 8:08 ` stanley.miao
2011-05-11 4:58 ` Janorkar, Mayuresh
1 sibling, 0 replies; 34+ messages in thread
From: stanley.miao @ 2011-05-09 8:08 UTC (permalink / raw)
To: Tomi Valkeinen; +Cc: tony, linux-omap
Acked-by: Stanley Miao <stanley.miao@windriver.com>
Stanley.
Tomi Valkeinen wrote:
> Port the old omapfb panel driver to DSS2i. This patch changes the board
> file only, the driver is ported in separate patch.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> Cc: Stanley Miao <stanley.miao@windriver.com>
> ---
> arch/arm/mach-omap2/board-ldp.c | 73 +++++++++++++++++++++++++++++++++-----
> 1 files changed, 63 insertions(+), 10 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
> index e2ba779..2fdfd7f 100644
> --- a/arch/arm/mach-omap2/board-ldp.c
> +++ b/arch/arm/mach-omap2/board-ldp.c
> @@ -43,6 +43,8 @@
>
> #include <asm/delay.h>
> #include <plat/usb.h>
> +#include <plat/display.h>
> +#include <plat/panel-generic-dpi.h>
>
> #include "board-flash.h"
> #include "mux.h"
> @@ -275,19 +277,71 @@ static inline void __init ldp_init_smsc911x(void)
> gpio_direction_input(eth_gpio);
> }
>
> -static struct platform_device ldp_lcd_device = {
> - .name = "ldp_lcd",
> - .id = -1,
> +/* LCD */
> +
> +#define LCD_PANEL_BACKLIGHT_GPIO (15 + OMAP_MAX_GPIO_LINES)
> +#define LCD_PANEL_ENABLE_GPIO (7 + OMAP_MAX_GPIO_LINES)
> +#define LCD_PANEL_RESET_GPIO 55
> +#define LCD_PANEL_QVGA_GPIO 56
> +
> +static int ldp_panel_enable_lcd(struct omap_dss_device *dssdev)
> +{
> + gpio_direction_output(LCD_PANEL_ENABLE_GPIO, 1);
> + gpio_direction_output(LCD_PANEL_BACKLIGHT_GPIO, 1);
> +
> + return 0;
> +}
> +
> +static void ldp_panel_disable_lcd(struct omap_dss_device *dssdev)
> +{
> + gpio_direction_output(LCD_PANEL_ENABLE_GPIO, 0);
> + gpio_direction_output(LCD_PANEL_BACKLIGHT_GPIO, 0);
> +}
> +
> +static struct panel_generic_dpi_data ldp_panel_data = {
> + .name = "2430sdp",
> + .platform_enable = ldp_panel_enable_lcd,
> + .platform_disable = ldp_panel_disable_lcd,
> };
>
> -static struct omap_lcd_config ldp_lcd_config __initdata = {
> - .ctrl_name = "internal",
> +static struct omap_dss_device ldp_lcd_device = {
> + .name = "lcd",
> + .driver_name = "generic_dpi_panel",
> + .type = OMAP_DISPLAY_TYPE_DPI,
> + .phy.dpi.data_lines = 16,
> + .data = &ldp_panel_data,
> };
>
> -static struct omap_board_config_kernel ldp_config[] __initdata = {
> - { OMAP_TAG_LCD, &ldp_lcd_config },
> +static struct omap_dss_device *ldp_dss_devices[] = {
> + &ldp_lcd_device,
> +};
> +
> +static struct omap_dss_board_info ldp_dss_data = {
> + .num_devices = ARRAY_SIZE(ldp_dss_devices),
> + .devices = ldp_dss_devices,
> + .default_device = &ldp_lcd_device,
> };
>
> +static void __init ldp_display_init(void)
> +{
> + int r;
> +
> + struct gpio gpios[] = {
> + {LCD_PANEL_RESET_GPIO, GPIOF_OUT_INIT_HIGH, "LCD RESET"},
> + {LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, "LCD QVGA"},
> + {LCD_PANEL_ENABLE_GPIO, GPIOF_OUT_INIT_LOW, "LCD ENABLE"},
> + {LCD_PANEL_BACKLIGHT_GPIO, GPIOF_OUT_INIT_LOW, "LCD BACKLIGHT"},
> + };
> +
> + r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
> + if (r) {
> + pr_err("Cannot request LCD GPIOs, error %d\n", r);
> + return;
> + }
> +
> + omap_display_init(&ldp_dss_data);
> +}
> +
> static void __init omap_ldp_init_early(void)
> {
> omap2_init_common_infrastructure();
> @@ -390,7 +444,6 @@ static struct omap2_hsmmc_info mmc[] __initdata = {
>
> static struct platform_device *ldp_devices[] __initdata = {
> &ldp_smsc911x_device,
> - &ldp_lcd_device,
> &ldp_gpio_keys_device,
> };
>
> @@ -441,8 +494,6 @@ static struct mtd_partition ldp_nand_partitions[] = {
> static void __init omap_ldp_init(void)
> {
> omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
> - omap_board_config = ldp_config;
> - omap_board_config_size = ARRAY_SIZE(ldp_config);
> ldp_init_smsc911x();
> omap_i2c_init();
> platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices));
> @@ -459,6 +510,8 @@ static void __init omap_ldp_init(void)
> omap2_hsmmc_init(mmc);
> /* link regulators to MMC adapters */
> ldp_vmmc1_supply.dev = mmc[0].dev;
> +
> + ldp_display_init();
> }
>
> MACHINE_START(OMAP_LDP, "OMAP LDP board")
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 3/6] OMAP: 2420SDP: Port the display driver to new DSS2
2011-05-09 7:36 ` [PATCH 3/6] OMAP: 2420SDP: Port the display driver to new DSS2 Tomi Valkeinen
@ 2011-05-09 8:21 ` Igor Grinberg
2011-05-09 16:57 ` Tomi Valkeinen
0 siblings, 1 reply; 34+ messages in thread
From: Igor Grinberg @ 2011-05-09 8:21 UTC (permalink / raw)
To: Tomi Valkeinen; +Cc: tony, linux-omap, Hunyue Yau
Hi Tomi,
On 05/09/11 10:36, Tomi Valkeinen wrote:
> Port the old omapfb panel driver to DSS2. This patch changes the board
> file only, the driver is ported in separate patch.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> Cc: Hunyue Yau <hyau@mvista.com>
> ---
> arch/arm/mach-omap2/board-2430sdp.c | 84 +++++++++++++++++++++++++++++------
> 1 files changed, 70 insertions(+), 14 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
> index 1fa6bb8..9b6e987 100644
> --- a/arch/arm/mach-omap2/board-2430sdp.c
> +++ b/arch/arm/mach-omap2/board-2430sdp.c
> @@ -38,6 +38,8 @@
> #include <plat/gpmc.h>
> #include <plat/usb.h>
> #include <plat/gpmc-smc91x.h>
> +#include <plat/display.h>
> +#include <plat/panel-generic-dpi.h>
>
> #include "mux.h"
> #include "hsmmc.h"
> @@ -98,20 +100,79 @@ static struct platform_device sdp2430_flash_device = {
> .resource = &sdp2430_flash_resource,
> };
>
> -static struct platform_device sdp2430_lcd_device = {
> - .name = "sdp2430_lcd",
> - .id = -1,
> -};
> -
> static struct platform_device *sdp2430_devices[] __initdata = {
> &sdp2430_flash_device,
> +};
> +
> +/* LCD */
> +#define SDP2430_LCD_PANEL_BACKLIGHT_GPIO 91
> +#define SDP2430_LCD_PANEL_ENABLE_GPIO 154
> +
> +static int sdp2430_panel_enable_lcd(struct omap_dss_device *dssdev)
> +{
> + gpio_direction_output(SDP2430_LCD_PANEL_ENABLE_GPIO, 1);
> + gpio_direction_output(SDP2430_LCD_PANEL_BACKLIGHT_GPIO, 1);
> +
> + return 0;
> +}
> +
> +static void sdp2430_panel_disable_lcd(struct omap_dss_device *dssdev)
> +{
> + gpio_direction_output(SDP2430_LCD_PANEL_ENABLE_GPIO, 0);
> + gpio_direction_output(SDP2430_LCD_PANEL_BACKLIGHT_GPIO, 0);
> +}
> +
> +static struct panel_generic_dpi_data sdp2430_panel_data = {
> + .name = "2430sdp",
> + .platform_enable = sdp2430_panel_enable_lcd,
> + .platform_disable = sdp2430_panel_disable_lcd,
> +};
> +
> +static struct omap_dss_device sdp2430_lcd_device = {
> + .name = "lcd",
> + .driver_name = "generic_dpi_panel",
> + .type = OMAP_DISPLAY_TYPE_DPI,
> + .phy.dpi.data_lines = 16,
> + .data = &sdp2430_panel_data,
> +};
> +
> +static struct omap_dss_device *sdp2430_dss_devices[] = {
> &sdp2430_lcd_device,
> };
>
> -static struct omap_lcd_config sdp2430_lcd_config __initdata = {
> - .ctrl_name = "internal",
> +static struct omap_dss_board_info sdp2430_dss_data = {
> + .num_devices = ARRAY_SIZE(sdp2430_dss_devices),
> + .devices = sdp2430_dss_devices,
> + .default_device = &sdp2430_lcd_device,
> };
>
> +static void __init sdp2430_display_init(void)
> +{
> + int r;
> +
> + r = gpio_request_one(SDP2430_LCD_PANEL_ENABLE_GPIO,
> + GPIOF_OUT_INIT_LOW, "LCD reset");
> + if (r) {
> + printk(KERN_ERR "failed to get LCD reset GPIO\n");
> + goto err0;
> + }
> +
> + r = gpio_request_one(SDP2430_LCD_PANEL_BACKLIGHT_GPIO,
> + GPIOF_OUT_INIT_LOW, "LCD Backlight");
> + if (r) {
> + printk(KERN_ERR "failed to get LCD backlight GPIO\n");
can both printks be pr_err?
> + goto err1;
> + }
> +
> + omap_display_init(&sdp2430_dss_data);
> +
> + return;
> +err1:
> + gpio_free(SDP2430_LCD_PANEL_ENABLE_GPIO);
> +err0:
> + return;
> +}
I think using gpio_request_array() will be much cleaner here...
> +
> #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91x_MODULE)
>
> static struct omap_smc91x_platform_data board_smc91x_data = {
> @@ -136,10 +197,6 @@ static inline void board_smc91x_init(void)
>
> #endif
>
> -static struct omap_board_config_kernel sdp2430_config[] __initdata = {
> - {OMAP_TAG_LCD, &sdp2430_lcd_config},
> -};
> -
> static void __init omap_2430sdp_init_early(void)
> {
> omap2_init_common_infrastructure();
> @@ -244,9 +301,6 @@ static void __init omap_2430sdp_init(void)
>
> omap2430_mux_init(board_mux, OMAP_PACKAGE_ZAC);
>
> - omap_board_config = sdp2430_config;
> - omap_board_config_size = ARRAY_SIZE(sdp2430_config);
> -
> omap2430_i2c_init();
>
> platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices));
> @@ -263,6 +317,8 @@ static void __init omap_2430sdp_init(void)
> ret = gpio_request(SECONDARY_LCD_GPIO, "Secondary LCD backlight");
> if (ret == 0)
> gpio_direction_output(SECONDARY_LCD_GPIO, 0);
> +
> + sdp2430_display_init();
> }
>
> static void __init omap_2430sdp_map_io(void)
--
Regards,
Igor.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 3/6] OMAP: 2420SDP: Port the display driver to new DSS2
2011-05-09 8:21 ` Igor Grinberg
@ 2011-05-09 16:57 ` Tomi Valkeinen
0 siblings, 0 replies; 34+ messages in thread
From: Tomi Valkeinen @ 2011-05-09 16:57 UTC (permalink / raw)
To: Igor Grinberg; +Cc: tony, linux-omap, Hunyue Yau
On Mon, 2011-05-09 at 11:21 +0300, Igor Grinberg wrote:
> Hi Tomi,
>
> On 05/09/11 10:36, Tomi Valkeinen wrote:
>
> > Port the old omapfb panel driver to DSS2. This patch changes the board
> > file only, the driver is ported in separate patch.
> >
> > Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> > Cc: Hunyue Yau <hyau@mvista.com>
<snip>
> > +static void __init sdp2430_display_init(void)
> > +{
> > + int r;
> > +
> > + r = gpio_request_one(SDP2430_LCD_PANEL_ENABLE_GPIO,
> > + GPIOF_OUT_INIT_LOW, "LCD reset");
> > + if (r) {
> > + printk(KERN_ERR "failed to get LCD reset GPIO\n");
> > + goto err0;
> > + }
> > +
> > + r = gpio_request_one(SDP2430_LCD_PANEL_BACKLIGHT_GPIO,
> > + GPIOF_OUT_INIT_LOW, "LCD Backlight");
> > + if (r) {
> > + printk(KERN_ERR "failed to get LCD backlight GPIO\n");
>
> can both printks be pr_err?
>
> > + goto err1;
> > + }
> > +
> > + omap_display_init(&sdp2430_dss_data);
> > +
> > + return;
> > +err1:
> > + gpio_free(SDP2430_LCD_PANEL_ENABLE_GPIO);
> > +err0:
> > + return;
> > +}
>
> I think using gpio_request_array() will be much cleaner here...
Right, thanks. It turned out much cleaner:
+static void __init sdp2430_display_init(void)
+{
+ int r;
+
+ static struct gpio gpios[] __initdata = {
+ { SDP2430_LCD_PANEL_ENABLE_GPIO, GPIOF_OUT_INIT_LOW,
+ "LCD reset" },
+ { SDP2430_LCD_PANEL_BACKLIGHT_GPIO, GPIOF_OUT_INIT_LOW,
+ "LCD Backlight" },
+ };
+
+ r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
+ if (r) {
+ pr_err("Cannot request LCD GPIOs, error %d\n", r);
+ return;
+ }
+
+ omap_display_init(&sdp2430_dss_data);
+}
Tomi
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 0/6] OMAP: board file changes for DSS2 porting
2011-05-09 7:36 [PATCH 0/6] OMAP: board file changes for DSS2 porting Tomi Valkeinen
` (5 preceding siblings ...)
2011-05-09 7:36 ` [PATCH 6/6] OMAP: Apollon: " Tomi Valkeinen
@ 2011-05-09 17:01 ` Tomi Valkeinen
2011-05-10 13:35 ` Tony Lindgren
6 siblings, 1 reply; 34+ messages in thread
From: Tomi Valkeinen @ 2011-05-09 17:01 UTC (permalink / raw)
To: tony; +Cc: linux-omap
On Mon, 2011-05-09 at 10:36 +0300, Tomi Valkeinen wrote:
> Hi Tony,
>
> I posted last week a patch set porting most of the old omapfb OMAP2/3 drivers
> to DSS2 (http://marc.info/?l=linux-fbdev&m=130451207802788&w=2). That patch set
> contains changes to both the drivers and the board files, and it seems there is
> already a minor conflict in them.
>
> So I think it's simpler to divide the set into two parts, this one, which
> contains the board file changes, and another containing the driver changes.
> Merging will probably go easier if you can take this patch set via linux-omap,
> and I'll take the driver changes via dss2 tree.
>
> Applying this set without the driver changes will obviously disable the
> displays of the affected boards until the drivers are also merged.
Tony, I updated the patches, adding one Ack and cleaning up the 2430sdp
a bit. The patches can be found from
git://gitorious.org/linux-omap-dss2/linux.git board-changes-for-tony
should you decide to pull them.
> Tomi
>
>
> Tomi Valkeinen (6):
> OMAP: RX51: Remove unused old omapfb stuff
> OMAP: omap3touchbook: Remove unused lcd stuff
> OMAP: 2420SDP: Port the display driver to new DSS2
> OMAP: LDP: Port the display driver to new DSS2
> OMAP: H4: Port the display driver to new DSS2
> OMAP: Apollon: Port the display driver to new DSS2
>
> arch/arm/mach-omap2/board-2430sdp.c | 84 +++++++++++++++++++++++-----
> arch/arm/mach-omap2/board-apollon.c | 34 +++++++----
> arch/arm/mach-omap2/board-h4.c | 41 ++++++++-----
> arch/arm/mach-omap2/board-ldp.c | 73 +++++++++++++++++++++---
> arch/arm/mach-omap2/board-omap3touchbook.c | 18 ------
> arch/arm/mach-omap2/board-rx51.c | 25 --------
> 6 files changed, 180 insertions(+), 95 deletions(-)
>
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 0/6] OMAP: board file changes for DSS2 porting
2011-05-09 17:01 ` [PATCH 0/6] OMAP: board file changes for DSS2 porting Tomi Valkeinen
@ 2011-05-10 13:35 ` Tony Lindgren
2011-05-10 14:03 ` Tomi Valkeinen
0 siblings, 1 reply; 34+ messages in thread
From: Tony Lindgren @ 2011-05-10 13:35 UTC (permalink / raw)
To: Tomi Valkeinen; +Cc: linux-omap
* Tomi Valkeinen <tomi.valkeinen@ti.com> [110509 19:58]:
> On Mon, 2011-05-09 at 10:36 +0300, Tomi Valkeinen wrote:
> > Hi Tony,
> >
> > I posted last week a patch set porting most of the old omapfb OMAP2/3 drivers
> > to DSS2 (http://marc.info/?l=linux-fbdev&m=130451207802788&w=2). That patch set
> > contains changes to both the drivers and the board files, and it seems there is
> > already a minor conflict in them.
> >
> > So I think it's simpler to divide the set into two parts, this one, which
> > contains the board file changes, and another containing the driver changes.
> > Merging will probably go easier if you can take this patch set via linux-omap,
> > and I'll take the driver changes via dss2 tree.
> >
> > Applying this set without the driver changes will obviously disable the
> > displays of the affected boards until the drivers are also merged.
>
> Tony, I updated the patches, adding one Ack and cleaning up the 2430sdp
> a bit. The patches can be found from
>
> git://gitorious.org/linux-omap-dss2/linux.git board-changes-for-tony
>
> should you decide to pull them.
Do the dss platform data code coalescing patches affect these?
We just hate positive diffstats for arch/arm/*omap*/ for the upcoming
merge window :)
Also, these patches should also be posted to linux-arm-kernel list for
review before I can apply.
Regards,
Tony
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 0/6] OMAP: board file changes for DSS2 porting
2011-05-10 13:35 ` Tony Lindgren
@ 2011-05-10 14:03 ` Tomi Valkeinen
2011-05-11 7:08 ` Tony Lindgren
0 siblings, 1 reply; 34+ messages in thread
From: Tomi Valkeinen @ 2011-05-10 14:03 UTC (permalink / raw)
To: Tony Lindgren; +Cc: linux-omap
On Tue, 2011-05-10 at 16:35 +0300, Tony Lindgren wrote:
> * Tomi Valkeinen <tomi.valkeinen@ti.com> [110509 19:58]:
> > On Mon, 2011-05-09 at 10:36 +0300, Tomi Valkeinen wrote:
> > > Hi Tony,
> > >
> > > I posted last week a patch set porting most of the old omapfb OMAP2/3 drivers
> > > to DSS2 (http://marc.info/?l=linux-fbdev&m=130451207802788&w=2). That patch set
> > > contains changes to both the drivers and the board files, and it seems there is
> > > already a minor conflict in them.
> > >
> > > So I think it's simpler to divide the set into two parts, this one, which
> > > contains the board file changes, and another containing the driver changes.
> > > Merging will probably go easier if you can take this patch set via linux-omap,
> > > and I'll take the driver changes via dss2 tree.
> > >
> > > Applying this set without the driver changes will obviously disable the
> > > displays of the affected boards until the drivers are also merged.
> >
> > Tony, I updated the patches, adding one Ack and cleaning up the 2430sdp
> > a bit. The patches can be found from
> >
> > git://gitorious.org/linux-omap-dss2/linux.git board-changes-for-tony
> >
> > should you decide to pull them.
>
> Do the dss platform data code coalescing patches affect these?
Do you mean the recent discussions about DSS regulator stuff? If so, no.
These patches do not introduce any regulator uses.
> We just hate positive diffstats for arch/arm/*omap*/ for the upcoming
> merge window :)
Well... I know, but if we want to port the old drivers to DSS2 it really
can't be helped. The display device definitions in the board files are
probably a bit more verbose with DSS2 than with old omapfb, due to more
features and better configurability.
That said, if you want to calm down the arch/arm/*omap* changes for this
merge window I can just postpone these (and some other display related
board changes in dss2 tree) to the next one. They are not critical in
any way regarding DSS2 development, they just would help us to clean up
the old omapfb code (which probably won't affect arch/arm/*omap* much).
Speaking of which, the include file for DSS2 currently resides in
arch/arm/plat-omap/include/plat/display.h. I guess this is not right
place for it, as the driver itself is in drivers/, even if the driver is
OMAP-only driver?
> Also, these patches should also be posted to linux-arm-kernel list for
> review before I can apply.
Ok. Should all arch/arm/*omap* code be posted to linux-arm-kernel also?
I feel like spamming if I mail the patches to three different mailing
lists =).
Tomi
^ permalink raw reply [flat|nested] 34+ messages in thread
* RE: [PATCH 4/6] OMAP: LDP: Port the display driver to new DSS2
2011-05-09 7:36 ` [PATCH 4/6] OMAP: LDP: " Tomi Valkeinen
2011-05-09 8:08 ` stanley.miao
@ 2011-05-11 4:58 ` Janorkar, Mayuresh
2011-05-11 6:32 ` Tomi Valkeinen
1 sibling, 1 reply; 34+ messages in thread
From: Janorkar, Mayuresh @ 2011-05-11 4:58 UTC (permalink / raw)
To: Valkeinen, Tomi, tony@atomide.com
Cc: linux-omap@vger.kernel.org, Stanley Miao
> -----Original Message-----
> From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
> owner@vger.kernel.org] On Behalf Of Valkeinen, Tomi
> Sent: Monday, May 09, 2011 1:06 PM
> To: tony@atomide.com
> Cc: linux-omap@vger.kernel.org; Valkeinen, Tomi; Stanley Miao
> Subject: [PATCH 4/6] OMAP: LDP: Port the display driver to new DSS2
>
> Port the old omapfb panel driver to DSS2i. This patch changes the board
> file only, the driver is ported in separate patch.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> Cc: Stanley Miao <stanley.miao@windriver.com>
> ---
> arch/arm/mach-omap2/board-ldp.c | 73 +++++++++++++++++++++++++++++++++-
> ----
> 1 files changed, 63 insertions(+), 10 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-
> ldp.c
> index e2ba779..2fdfd7f 100644
> --- a/arch/arm/mach-omap2/board-ldp.c
> +++ b/arch/arm/mach-omap2/board-ldp.c
> @@ -43,6 +43,8 @@
>
> #include <asm/delay.h>
> #include <plat/usb.h>
> +#include <plat/display.h>
> +#include <plat/panel-generic-dpi.h>
>
> #include "board-flash.h"
> #include "mux.h"
> @@ -275,19 +277,71 @@ static inline void __init ldp_init_smsc911x(void)
> gpio_direction_input(eth_gpio);
> }
>
> -static struct platform_device ldp_lcd_device = {
> - .name = "ldp_lcd",
> - .id = -1,
> +/* LCD */
> +
> +#define LCD_PANEL_BACKLIGHT_GPIO (15 + OMAP_MAX_GPIO_LINES)
> +#define LCD_PANEL_ENABLE_GPIO (7 + OMAP_MAX_GPIO_LINES)
> +#define LCD_PANEL_RESET_GPIO 55
> +#define LCD_PANEL_QVGA_GPIO 56
> +
> +static int ldp_panel_enable_lcd(struct omap_dss_device *dssdev)
> +{
> + gpio_direction_output(LCD_PANEL_ENABLE_GPIO, 1);
> + gpio_direction_output(LCD_PANEL_BACKLIGHT_GPIO, 1);
> +
> + return 0;
> +}
> +
> +static void ldp_panel_disable_lcd(struct omap_dss_device *dssdev)
> +{
> + gpio_direction_output(LCD_PANEL_ENABLE_GPIO, 0);
> + gpio_direction_output(LCD_PANEL_BACKLIGHT_GPIO, 0);
> +}
> +
> +static struct panel_generic_dpi_data ldp_panel_data = {
> + .name = "2430sdp",
LDP is a 3430 board.
> + .platform_enable = ldp_panel_enable_lcd,
> + .platform_disable = ldp_panel_disable_lcd,
> };
>
> -static struct omap_lcd_config ldp_lcd_config __initdata = {
> - .ctrl_name = "internal",
> +static struct omap_dss_device ldp_lcd_device = {
> + .name = "lcd",
> + .driver_name = "generic_dpi_panel",
> + .type = OMAP_DISPLAY_TYPE_DPI,
> + .phy.dpi.data_lines = 16,
> + .data = &ldp_panel_data,
> };
>
> -static struct omap_board_config_kernel ldp_config[] __initdata = {
> - { OMAP_TAG_LCD, &ldp_lcd_config },
> +static struct omap_dss_device *ldp_dss_devices[] = {
> + &ldp_lcd_device,
> +};
> +
> +static struct omap_dss_board_info ldp_dss_data = {
> + .num_devices = ARRAY_SIZE(ldp_dss_devices),
> + .devices = ldp_dss_devices,
> + .default_device = &ldp_lcd_device,
> };
>
> +static void __init ldp_display_init(void)
> +{
> + int r;
> +
> + struct gpio gpios[] = {
> + {LCD_PANEL_RESET_GPIO, GPIOF_OUT_INIT_HIGH, "LCD RESET"},
> + {LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, "LCD QVGA"},
> + {LCD_PANEL_ENABLE_GPIO, GPIOF_OUT_INIT_LOW, "LCD ENABLE"},
> + {LCD_PANEL_BACKLIGHT_GPIO, GPIOF_OUT_INIT_LOW, "LCD
> BACKLIGHT"},
> + };
> +
> + r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
> + if (r) {
> + pr_err("Cannot request LCD GPIOs, error %d\n", r);
> + return;
> + }
If I test with this patch, this request is returning error.
> +
> + omap_display_init(&ldp_dss_data);
> +}
> +
> static void __init omap_ldp_init_early(void)
> {
> omap2_init_common_infrastructure();
> @@ -390,7 +444,6 @@ static struct omap2_hsmmc_info mmc[] __initdata = {
>
> static struct platform_device *ldp_devices[] __initdata = {
> &ldp_smsc911x_device,
> - &ldp_lcd_device,
> &ldp_gpio_keys_device,
> };
>
> @@ -441,8 +494,6 @@ static struct mtd_partition ldp_nand_partitions[] = {
> static void __init omap_ldp_init(void)
> {
> omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
> - omap_board_config = ldp_config;
> - omap_board_config_size = ARRAY_SIZE(ldp_config);
> ldp_init_smsc911x();
> omap_i2c_init();
> platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices));
> @@ -459,6 +510,8 @@ static void __init omap_ldp_init(void)
> omap2_hsmmc_init(mmc);
> /* link regulators to MMC adapters */
> ldp_vmmc1_supply.dev = mmc[0].dev;
> +
> + ldp_display_init();
> }
>
> MACHINE_START(OMAP_LDP, "OMAP LDP board")
> --
> 1.7.4.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 34+ messages in thread
* RE: [PATCH 4/6] OMAP: LDP: Port the display driver to new DSS2
2011-05-11 4:58 ` Janorkar, Mayuresh
@ 2011-05-11 6:32 ` Tomi Valkeinen
2011-05-12 6:40 ` Igor Grinberg
0 siblings, 1 reply; 34+ messages in thread
From: Tomi Valkeinen @ 2011-05-11 6:32 UTC (permalink / raw)
To: Janorkar, Mayuresh
Cc: tony@atomide.com, linux-omap@vger.kernel.org, Stanley Miao
On Wed, 2011-05-11 at 10:28 +0530, Janorkar, Mayuresh wrote:
>
> > -----Original Message-----
> > From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
> > owner@vger.kernel.org] On Behalf Of Valkeinen, Tomi
> > Sent: Monday, May 09, 2011 1:06 PM
> > To: tony@atomide.com
> > Cc: linux-omap@vger.kernel.org; Valkeinen, Tomi; Stanley Miao
> > Subject: [PATCH 4/6] OMAP: LDP: Port the display driver to new DSS2
> >
> > Port the old omapfb panel driver to DSS2i. This patch changes the board
> > file only, the driver is ported in separate patch.
> >
> > Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> > Cc: Stanley Miao <stanley.miao@windriver.com>
> > ---
> > arch/arm/mach-omap2/board-ldp.c | 73 +++++++++++++++++++++++++++++++++-
> > ----
<snip>
> > +static struct panel_generic_dpi_data ldp_panel_data = {
> > + .name = "2430sdp",
>
> LDP is a 3430 board.
That is just the name of the panel, used to find the right timings from
the panel database. I first ported 2430sdp board, and called the panel
that. The timings looked the same on LDP board, so I deduced it's the
same panel, and used the same name.
However, if you do have the board, can you find the name and type of the
panel? It's usually printed in the backside of the panel, which of
course may not be accessible easily.
Or, if you or anyone else knows where to find information about the LDP
board, schematics or datasheets, that could help also.
> > +static void __init ldp_display_init(void)
> > +{
> > + int r;
> > +
> > + struct gpio gpios[] = {
> > + {LCD_PANEL_RESET_GPIO, GPIOF_OUT_INIT_HIGH, "LCD RESET"},
> > + {LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, "LCD QVGA"},
> > + {LCD_PANEL_ENABLE_GPIO, GPIOF_OUT_INIT_LOW, "LCD ENABLE"},
> > + {LCD_PANEL_BACKLIGHT_GPIO, GPIOF_OUT_INIT_LOW, "LCD
> > BACKLIGHT"},
> > + };
> > +
> > + r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
> > + if (r) {
> > + pr_err("Cannot request LCD GPIOs, error %d\n", r);
> > + return;
> > + }
>
> If I test with this patch, this request is returning error.
Hmm. Well, the GPIOs are the same as in the old driver. However, the old
driver doesn't even seem to check if it manages to request the GPIOs, so
it may well be that it was failing also.
Can you check from /sys/class/gpio/ if some of the GPIOs are already
allocated: 207, 199, 55, 56?
The definition of two of those GPIOs look kinda funny to me: (15 +
OMAP_MAX_GPIO_LINES). I don't know what OMAP_MAX_GPIO_LINES means, but
it sure doesn't sound ok to have a GPIO number that is 15 over the
maximum =).
Tomi
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 0/6] OMAP: board file changes for DSS2 porting
2011-05-10 14:03 ` Tomi Valkeinen
@ 2011-05-11 7:08 ` Tony Lindgren
0 siblings, 0 replies; 34+ messages in thread
From: Tony Lindgren @ 2011-05-11 7:08 UTC (permalink / raw)
To: Tomi Valkeinen; +Cc: linux-omap
* Tomi Valkeinen <tomi.valkeinen@ti.com> [110510 17:00]:
> On Tue, 2011-05-10 at 16:35 +0300, Tony Lindgren wrote:
> > * Tomi Valkeinen <tomi.valkeinen@ti.com> [110509 19:58]:
> >
> > Do the dss platform data code coalescing patches affect these?
>
> Do you mean the recent discussions about DSS regulator stuff? If so, no.
> These patches do not introduce any regulator uses.
OK
> > We just hate positive diffstats for arch/arm/*omap*/ for the upcoming
> > merge window :)
>
> Well... I know, but if we want to port the old drivers to DSS2 it really
> can't be helped. The display device definitions in the board files are
> probably a bit more verbose with DSS2 than with old omapfb, due to more
> features and better configurability.
>
> That said, if you want to calm down the arch/arm/*omap* changes for this
> merge window I can just postpone these (and some other display related
> board changes in dss2 tree) to the next one. They are not critical in
> any way regarding DSS2 development, they just would help us to clean up
> the old omapfb code (which probably won't affect arch/arm/*omap* much).
Let's do that, I guess that's your v2 of the set. Then we can have a
separate branch for the new code that we can then merge when we can.
> Speaking of which, the include file for DSS2 currently resides in
> arch/arm/plat-omap/include/plat/display.h. I guess this is not right
> place for it, as the driver itself is in drivers/, even if the driver is
> OMAP-only driver?
Yes it could be moved.
> > Also, these patches should also be posted to linux-arm-kernel list for
> > review before I can apply.
>
> Ok. Should all arch/arm/*omap* code be posted to linux-arm-kernel also?
> I feel like spamming if I mail the patches to three different mailing
> lists =).
Yes, that way people on linux-arm-kernel can also review them.
Regards,
Tony
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 4/6] OMAP: LDP: Port the display driver to new DSS2
2011-05-11 6:32 ` Tomi Valkeinen
@ 2011-05-12 6:40 ` Igor Grinberg
2011-05-12 7:16 ` Igor Grinberg
2011-05-16 8:53 ` Tomi Valkeinen
0 siblings, 2 replies; 34+ messages in thread
From: Igor Grinberg @ 2011-05-12 6:40 UTC (permalink / raw)
To: Tomi Valkeinen
Cc: Janorkar, Mayuresh, tony@atomide.com, linux-omap@vger.kernel.org,
Stanley Miao
On 05/11/11 09:32, Tomi Valkeinen wrote:
> On Wed, 2011-05-11 at 10:28 +0530, Janorkar, Mayuresh wrote:
>
>>> +static void __init ldp_display_init(void)
>>> +{
>>> + int r;
>>> +
>>> + struct gpio gpios[] = {
>>> + {LCD_PANEL_RESET_GPIO, GPIOF_OUT_INIT_HIGH, "LCD RESET"},
>>> + {LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, "LCD QVGA"},
>>> + {LCD_PANEL_ENABLE_GPIO, GPIOF_OUT_INIT_LOW, "LCD ENABLE"},
>>> + {LCD_PANEL_BACKLIGHT_GPIO, GPIOF_OUT_INIT_LOW, "LCD
>>> BACKLIGHT"},
>>> + };
>>> +
>>> + r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
>>> + if (r) {
>>> + pr_err("Cannot request LCD GPIOs, error %d\n", r);
>>> + return;
>>> + }
>> If I test with this patch, this request is returning error.
> Hmm. Well, the GPIOs are the same as in the old driver. However, the old
> driver doesn't even seem to check if it manages to request the GPIOs, so
> it may well be that it was failing also.
>
> Can you check from /sys/class/gpio/ if some of the GPIOs are already
> allocated: 207, 199, 55, 56?
>
> The definition of two of those GPIOs look kinda funny to me: (15 +
> OMAP_MAX_GPIO_LINES). I don't know what OMAP_MAX_GPIO_LINES means, but
> it sure doesn't sound ok to have a GPIO number that is 15 over the
> maximum =).
>
This means that some kind of gpio expander is used.
I bet those are twl gpios (or may be some other discrete chip).
If those are twl gpios then you need to provide the .setup callback
in struct twl4030_gpio_platform_data which will request and setup those gpios.
--
Regards,
Igor.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 4/6] OMAP: LDP: Port the display driver to new DSS2
2011-05-12 6:40 ` Igor Grinberg
@ 2011-05-12 7:16 ` Igor Grinberg
2011-05-12 8:38 ` Igor Grinberg
2011-05-16 8:53 ` Tomi Valkeinen
1 sibling, 1 reply; 34+ messages in thread
From: Igor Grinberg @ 2011-05-12 7:16 UTC (permalink / raw)
To: Tomi Valkeinen
Cc: Janorkar, Mayuresh, tony@atomide.com, linux-omap@vger.kernel.org,
Stanley Miao
[-- Attachment #1: Type: text/plain, Size: 1837 bytes --]
On 05/12/11 09:40, Igor Grinberg wrote:
> On 05/11/11 09:32, Tomi Valkeinen wrote:
>> On Wed, 2011-05-11 at 10:28 +0530, Janorkar, Mayuresh wrote:
>>>> +static void __init ldp_display_init(void)
>>>> +{
>>>> + int r;
>>>> +
>>>> + struct gpio gpios[] = {
>>>> + {LCD_PANEL_RESET_GPIO, GPIOF_OUT_INIT_HIGH, "LCD RESET"},
>>>> + {LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, "LCD QVGA"},
>>>> + {LCD_PANEL_ENABLE_GPIO, GPIOF_OUT_INIT_LOW, "LCD ENABLE"},
>>>> + {LCD_PANEL_BACKLIGHT_GPIO, GPIOF_OUT_INIT_LOW, "LCD
>>>> BACKLIGHT"},
>>>> + };
>>>> +
>>>> + r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
>>>> + if (r) {
>>>> + pr_err("Cannot request LCD GPIOs, error %d\n", r);
>>>> + return;
>>>> + }
>>> If I test with this patch, this request is returning error.
>> Hmm. Well, the GPIOs are the same as in the old driver. However, the old
>> driver doesn't even seem to check if it manages to request the GPIOs, so
>> it may well be that it was failing also.
>>
>> Can you check from /sys/class/gpio/ if some of the GPIOs are already
>> allocated: 207, 199, 55, 56?
>>
>> The definition of two of those GPIOs look kinda funny to me: (15 +
>> OMAP_MAX_GPIO_LINES). I don't know what OMAP_MAX_GPIO_LINES means, but
>> it sure doesn't sound ok to have a GPIO number that is 15 over the
>> maximum =).
>>
> This means that some kind of gpio expander is used.
> I bet those are twl gpios (or may be some other discrete chip).
> If those are twl gpios then you need to provide the .setup callback
> in struct twl4030_gpio_platform_data which will request and setup those gpios.
>
No need to wonder ;)
Mayuresh,
try the attached patch (though some changes to Tomi's patch will be needed)
if it works, then we're good.
Tomi,
Your "ldp" patch does not apply, it would be nice if you rebase on top
of Tony's master.
--
Regards,
Igor.
[-- Attachment #2: ldp-twl-gpios.patch --]
[-- Type: text/x-patch, Size: 1044 bytes --]
arch/arm/mach-omap2/board-ldp.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index f7d6038..ca92e43 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -203,10 +203,27 @@ static struct twl4030_usb_data ldp_usb_data = {
.usb_mode = T2_USB_MODE_ULPI,
};
+static int ldp_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio)
+{
+ int r;
+
+ struct gpio twl_gpios[] = {
+ {gpio + 7 , GPIOF_OUT_INIT_LOW, "LCD ENABLE"},
+ {gpio + 15, GPIOF_OUT_INIT_LOW, "LCD BACKLIGHT"},
+ };
+
+ r = gpio_request_array(twl_gpios, ARRAY_SIZE(gpios));
+ if (r)
+ pr_err("Cannot request LCD GPIOs, error %d\n", r);
+
+ return r;
+}
+
static struct twl4030_gpio_platform_data ldp_gpio_data = {
.gpio_base = OMAP_MAX_GPIO_LINES,
.irq_base = TWL4030_GPIO_IRQ_BASE,
.irq_end = TWL4030_GPIO_IRQ_END,
+ .setup = ldp_twl_gpios_setup,
};
static struct twl4030_madc_platform_data ldp_madc_data = {
^ permalink raw reply related [flat|nested] 34+ messages in thread
* Re: [PATCH 4/6] OMAP: LDP: Port the display driver to new DSS2
2011-05-12 7:16 ` Igor Grinberg
@ 2011-05-12 8:38 ` Igor Grinberg
2011-05-12 8:47 ` Janorkar, Mayuresh
0 siblings, 1 reply; 34+ messages in thread
From: Igor Grinberg @ 2011-05-12 8:38 UTC (permalink / raw)
To: Tomi Valkeinen
Cc: Janorkar, Mayuresh, tony@atomide.com, linux-omap@vger.kernel.org,
Stanley Miao
On 05/12/11 10:16, Igor Grinberg wrote:
> On 05/12/11 09:40, Igor Grinberg wrote:
>> On 05/11/11 09:32, Tomi Valkeinen wrote:
>>> On Wed, 2011-05-11 at 10:28 +0530, Janorkar, Mayuresh wrote:
>>>>> +static void __init ldp_display_init(void)
>>>>> +{
>>>>> + int r;
>>>>> +
>>>>> + struct gpio gpios[] = {
>>>>> + {LCD_PANEL_RESET_GPIO, GPIOF_OUT_INIT_HIGH, "LCD RESET"},
>>>>> + {LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, "LCD QVGA"},
>>>>> + {LCD_PANEL_ENABLE_GPIO, GPIOF_OUT_INIT_LOW, "LCD ENABLE"},
>>>>> + {LCD_PANEL_BACKLIGHT_GPIO, GPIOF_OUT_INIT_LOW, "LCD
>>>>> BACKLIGHT"},
>>>>> + };
>>>>> +
>>>>> + r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
>>>>> + if (r) {
>>>>> + pr_err("Cannot request LCD GPIOs, error %d\n", r);
>>>>> + return;
>>>>> + }
>>>> If I test with this patch, this request is returning error.
>>> Hmm. Well, the GPIOs are the same as in the old driver. However, the old
>>> driver doesn't even seem to check if it manages to request the GPIOs, so
>>> it may well be that it was failing also.
>>>
>>> Can you check from /sys/class/gpio/ if some of the GPIOs are already
>>> allocated: 207, 199, 55, 56?
>>>
>>> The definition of two of those GPIOs look kinda funny to me: (15 +
>>> OMAP_MAX_GPIO_LINES). I don't know what OMAP_MAX_GPIO_LINES means, but
>>> it sure doesn't sound ok to have a GPIO number that is 15 over the
>>> maximum =).
>>>
>> This means that some kind of gpio expander is used.
>> I bet those are twl gpios (or may be some other discrete chip).
>> If those are twl gpios then you need to provide the .setup callback
>> in struct twl4030_gpio_platform_data which will request and setup those gpios.
>>
> No need to wonder ;)
>
> Mayuresh,
> try the attached patch (though some changes to Tomi's patch will be needed)
> if it works, then we're good.
there is a typo in the function name:
s/ldp_twl_gpio_setup/ldp_twl_gpios_setup/
sorry...
--
Regards,
Igor.
^ permalink raw reply [flat|nested] 34+ messages in thread
* RE: [PATCH 4/6] OMAP: LDP: Port the display driver to new DSS2
2011-05-12 8:38 ` Igor Grinberg
@ 2011-05-12 8:47 ` Janorkar, Mayuresh
2011-05-12 11:20 ` Igor Grinberg
0 siblings, 1 reply; 34+ messages in thread
From: Janorkar, Mayuresh @ 2011-05-12 8:47 UTC (permalink / raw)
To: Igor Grinberg, Valkeinen, Tomi
Cc: tony@atomide.com, linux-omap@vger.kernel.org, Stanley Miao
> -----Original Message-----
> From: Igor Grinberg [mailto:grinberg@compulab.co.il]
> Sent: Thursday, May 12, 2011 2:08 PM
> To: Valkeinen, Tomi
> Cc: Janorkar, Mayuresh; tony@atomide.com; linux-omap@vger.kernel.org;
> Stanley Miao
> Subject: Re: [PATCH 4/6] OMAP: LDP: Port the display driver to new DSS2
>
> On 05/12/11 10:16, Igor Grinberg wrote:
>
> > On 05/12/11 09:40, Igor Grinberg wrote:
> >> On 05/11/11 09:32, Tomi Valkeinen wrote:
> >>> On Wed, 2011-05-11 at 10:28 +0530, Janorkar, Mayuresh wrote:
> >>>>> +static void __init ldp_display_init(void)
> >>>>> +{
> >>>>> + int r;
> >>>>> +
> >>>>> + struct gpio gpios[] = {
> >>>>> + {LCD_PANEL_RESET_GPIO, GPIOF_OUT_INIT_HIGH, "LCD
> RESET"},
> >>>>> + {LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, "LCD QVGA"},
> >>>>> + {LCD_PANEL_ENABLE_GPIO, GPIOF_OUT_INIT_LOW, "LCD
> ENABLE"},
> >>>>> + {LCD_PANEL_BACKLIGHT_GPIO, GPIOF_OUT_INIT_LOW, "LCD
> >>>>> BACKLIGHT"},
> >>>>> + };
> >>>>> +
> >>>>> + r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
> >>>>> + if (r) {
> >>>>> + pr_err("Cannot request LCD GPIOs, error %d\n", r);
> >>>>> + return;
> >>>>> + }
> >>>> If I test with this patch, this request is returning error.
> >>> Hmm. Well, the GPIOs are the same as in the old driver. However, the
> old
> >>> driver doesn't even seem to check if it manages to request the GPIOs,
> so
> >>> it may well be that it was failing also.
> >>>
> >>> Can you check from /sys/class/gpio/ if some of the GPIOs are already
> >>> allocated: 207, 199, 55, 56?
> >>>
> >>> The definition of two of those GPIOs look kinda funny to me: (15 +
> >>> OMAP_MAX_GPIO_LINES). I don't know what OMAP_MAX_GPIO_LINES means, but
> >>> it sure doesn't sound ok to have a GPIO number that is 15 over the
> >>> maximum =).
> >>>
> >> This means that some kind of gpio expander is used.
> >> I bet those are twl gpios (or may be some other discrete chip).
> >> If those are twl gpios then you need to provide the .setup callback
> >> in struct twl4030_gpio_platform_data which will request and setup those
> gpios.
> >>
> > No need to wonder ;)
> >
> > Mayuresh,
> > try the attached patch (though some changes to Tomi's patch will be
> needed)
> > if it works, then we're good.
>
> there is a typo in the function name:
>
> s/ldp_twl_gpio_setup/ldp_twl_gpios_setup/
Also,
> + };
> +
> + r = gpio_request_array(twl_gpios, ARRAY_SIZE(gpios));
This should be ARRAY_SIZE(twl_gpios));
And one more thing:
We need to use regulator for OMAP3430.
Something like this:
+/* VPLL2 for digital video outputs */
+static struct regulator_consumer_supply ldp_vpll2_supplies[] = {
+ REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
+ REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"),
+};
+
+static struct regulator_init_data ldp_vpll2 = {
+ .constraints = {
+ .name = "VDVI",
+ .min_uV = 1800000,
+ .max_uV = 1800000,
+ .apply_uV = true,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(ldp_vpll2_supplies),
+ .consumer_supplies = ldp_vpll2_supplies,
+};
@@ -340,6 +514,7 @@ static struct twl4030_platform_data ldp_twldata = {
.vmmc1 = &ldp_vmmc1,
.gpio = &ldp_gpio_data,
.keypad = &ldp_kp_twl4030_data,
+ .vpll2 = &ldp_vpll2,
>
> sorry...
>
>
> --
> Regards,
> Igor.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 4/6] OMAP: LDP: Port the display driver to new DSS2
2011-05-12 8:47 ` Janorkar, Mayuresh
@ 2011-05-12 11:20 ` Igor Grinberg
2011-05-12 11:47 ` Tomi Valkeinen
0 siblings, 1 reply; 34+ messages in thread
From: Igor Grinberg @ 2011-05-12 11:20 UTC (permalink / raw)
To: Janorkar, Mayuresh
Cc: Valkeinen, Tomi, tony@atomide.com, linux-omap@vger.kernel.org,
Stanley Miao
On 05/12/11 11:47, Janorkar, Mayuresh wrote:
>> On 05/12/11 10:16, Igor Grinberg wrote:
>> there is a typo in the function name:
>> s/ldp_twl_gpio_setup/ldp_twl_gpios_setup/
> Also,
>> + };
>> +
>> + r = gpio_request_array(twl_gpios, ARRAY_SIZE(gpios));
> This should be ARRAY_SIZE(twl_gpios));
yeah, sorry for that
that is what happening when making patches in a hurry and no checks done
> And one more thing:
> We need to use regulator for OMAP3430.
>
>
> Something like this:
> +/* VPLL2 for digital video outputs */
> +static struct regulator_consumer_supply ldp_vpll2_supplies[] = {
> + REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
> + REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"),
> +};
> +
> +static struct regulator_init_data ldp_vpll2 = {
> + .constraints = {
> + .name = "VDVI",
> + .min_uV = 1800000,
> + .max_uV = 1800000,
> + .apply_uV = true,
> + .valid_modes_mask = REGULATOR_MODE_NORMAL
> + | REGULATOR_MODE_STANDBY,
> + .valid_ops_mask = REGULATOR_CHANGE_MODE
> + | REGULATOR_CHANGE_STATUS,
> + },
> + .num_consumer_supplies = ARRAY_SIZE(ldp_vpll2_supplies),
> + .consumer_supplies = ldp_vpll2_supplies,
> +};
>
> @@ -340,6 +514,7 @@ static struct twl4030_platform_data ldp_twldata = {
> .vmmc1 = &ldp_vmmc1,
> .gpio = &ldp_gpio_data,
> .keypad = &ldp_kp_twl4030_data,
> + .vpll2 = &ldp_vpll2,
>
Right. Do both fixes make it work?
If it is, then Tomi,
will you add both fixes to the patch set with our SOBs?
or do you want this to be sent properly as a follow up?
--
Regards,
Igor.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 4/6] OMAP: LDP: Port the display driver to new DSS2
2011-05-12 11:20 ` Igor Grinberg
@ 2011-05-12 11:47 ` Tomi Valkeinen
2011-05-12 14:36 ` Janorkar, Mayuresh
0 siblings, 1 reply; 34+ messages in thread
From: Tomi Valkeinen @ 2011-05-12 11:47 UTC (permalink / raw)
To: Igor Grinberg
Cc: Janorkar, Mayuresh, tony@atomide.com, linux-omap@vger.kernel.org,
Stanley Miao
On Thu, 2011-05-12 at 14:20 +0300, Igor Grinberg wrote:
> Right. Do both fixes make it work?
>
> If it is, then Tomi,
> will you add both fixes to the patch set with our SOBs?
> or do you want this to be sent properly as a follow up?
Yes, I can add these all to the same patch and handle it through DSS
tree. Although due to the reluctance to make changes to arch/arm/*omap*,
I guess we'll pass these patches in this merge window.
Mayuresh, if you're able to test this and it works, can you send me the
full diff so that I don't make any mistakes combining the code?
Tomi
^ permalink raw reply [flat|nested] 34+ messages in thread
* RE: [PATCH 4/6] OMAP: LDP: Port the display driver to new DSS2
2011-05-12 11:47 ` Tomi Valkeinen
@ 2011-05-12 14:36 ` Janorkar, Mayuresh
2011-05-12 14:47 ` Tomi Valkeinen
0 siblings, 1 reply; 34+ messages in thread
From: Janorkar, Mayuresh @ 2011-05-12 14:36 UTC (permalink / raw)
To: Valkeinen, Tomi, Igor Grinberg
Cc: tony@atomide.com, linux-omap@vger.kernel.org, Stanley Miao
[-- Attachment #1: Type: text/plain, Size: 13896 bytes --]
> -----Original Message-----
> From: Valkeinen, Tomi
> Sent: Thursday, May 12, 2011 5:18 PM
> To: Igor Grinberg
> Cc: Janorkar, Mayuresh; tony@atomide.com; linux-omap@vger.kernel.org;
> Stanley Miao
> Subject: Re: [PATCH 4/6] OMAP: LDP: Port the display driver to new DSS2
>
> On Thu, 2011-05-12 at 14:20 +0300, Igor Grinberg wrote:
>
> > Right. Do both fixes make it work?
> >
> > If it is, then Tomi,
> > will you add both fixes to the patch set with our SOBs?
> > or do you want this to be sent properly as a follow up?
>
> Yes, I can add these all to the same patch and handle it through DSS
> tree. Although due to the reluctance to make changes to arch/arm/*omap*,
> I guess we'll pass these patches in this merge window.
>
> Mayuresh, if you're able to test this and it works, can you send me the
> full diff so that I don't make any mistakes combining the code?
>
> Tomi
>
Please find the patch below.
I have also attached the same.
There are formatting problems with this patch. But this can be used as a reference.
I have verified bootup with Penguins on LDP board.
>From 1f3470d3d792721bf5aa4d060c1cf79f5a587497 Mon Sep 17 00:00:00 2001
From: Mayuresh Janorkar <mayur@ti.com>
Date: Thu, 12 May 2011 18:53:46 +0530
Subject: [PATCH] LDP Tomi patch
---
arch/arm/mach-omap2/board-ldp.c | 87 ++++++++++--
drivers/video/omap2/displays/Kconfig | 5 +
drivers/video/omap2/displays/Makefile | 1 +
drivers/video/omap2/displays/panel-ldp.c | 223 ++++++++++++++++++++++++++++++
4 files changed, 305 insertions(+), 11 deletions(-)
mode change 100644 => 100755 arch/arm/mach-omap2/board-ldp.c
create mode 100755 drivers/video/omap2/displays/panel-ldp.c
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
old mode 100644
new mode 100755
index e2ba779..fa6327a
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -43,6 +43,7 @@
#include <asm/delay.h>
#include <plat/usb.h>
+#include <plat/display.h>
#include "board-flash.h"
#include "mux.h"
@@ -53,6 +54,11 @@
#define LDP_SMSC911X_GPIO 152
#define DEBUG_BASE 0x08000000
#define LDP_ETHR_START DEBUG_BASE
+#define LCD_PANEL_BACKLIGHT_GPIO (15 + OMAP_MAX_GPIO_LINES)
+#define LCD_PANEL_ENABLE_GPIO (7 + OMAP_MAX_GPIO_LINES)
+
+#define LCD_PANEL_RESET_GPIO 55
+#define LCD_PANEL_QVGA_GPIO 56
static struct resource ldp_smsc911x_resources[] = {
[0] = {
@@ -275,19 +281,78 @@ static inline void __init ldp_init_smsc911x(void)
gpio_direction_input(eth_gpio);
}
-static struct platform_device ldp_lcd_device = {
- .name = "ldp_lcd",
- .id = -1,
+#define SDP3430_LCD_PANEL_BACKLIGHT_GPIO 8
+#define SDP3430_LCD_PANEL_ENABLE_GPIO 5
+
+static unsigned backlight_gpio;
+static unsigned enable_gpio;
+static int lcd_enabled;
+
+static void __init sdp3430_display_init(void)
+{
+ printk(KERN_INFO "\n LDP:: sdp3430_display_init ");
+ return;
+}
+
+static int sdp3430_panel_enable_lcd(struct omap_dss_device *dssdev)
+{
+ int status;
+ return 0;
+}
+
+static void sdp3430_panel_disable_lcd(struct omap_dss_device *dssdev)
+{
+ lcd_enabled = 0;
+
+ gpio_direction_output(enable_gpio, 0);
+ gpio_direction_output(backlight_gpio, 0);
+
+ gpio_direction_output(LCD_PANEL_ENABLE_GPIO, 0);
+ gpio_direction_output(LCD_PANEL_BACKLIGHT_GPIO, 0);
+
+}
+
+static struct omap_dss_device sdp3430_lcd_device = {
+ .name = "lcd",
+ .driver_name = "ldp_panel",
+ .type = OMAP_DISPLAY_TYPE_DPI,
+ .phy.dpi.data_lines = 16,
+ .platform_enable = sdp3430_panel_enable_lcd,
+ .platform_disable = sdp3430_panel_disable_lcd,
};
-static struct omap_lcd_config ldp_lcd_config __initdata = {
- .ctrl_name = "internal",
+static struct omap_dss_device *sdp3430_dss_devices[] = {
+ &sdp3430_lcd_device,
};
-static struct omap_board_config_kernel ldp_config[] __initdata = {
- { OMAP_TAG_LCD, &ldp_lcd_config },
+static struct omap_dss_board_info sdp3430_dss_data = {
+ .num_devices = ARRAY_SIZE(sdp3430_dss_devices),
+ .devices = sdp3430_dss_devices,
+ .default_device = &sdp3430_lcd_device,
};
+/* VPLL2 for digital video outputs */
+static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = {
+ REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
+ REGULATOR_SUPPLY("vdds_dsi", "omap_dsi1"),
+};
+
+static struct regulator_init_data sdp3430_vpll2 = {
+ .constraints = {
+ .name = "VDVI",
+ .min_uV = 1800000,
+ .max_uV = 1800000,
+ .apply_uV = true,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(sdp3430_vpll2_supplies),
+ .consumer_supplies = sdp3430_vpll2_supplies,
+};
+
+
static void __init omap_ldp_init_early(void)
{
omap2_init_common_infrastructure();
@@ -358,6 +423,7 @@ static struct twl4030_platform_data ldp_twldata = {
.vaux1 = &ldp_vaux1,
.gpio = &ldp_gpio_data,
.keypad = &ldp_kp_twl4030_data,
+ .vpll2 = &sdp3430_vpll2,
};
static struct i2c_board_info __initdata ldp_i2c_boardinfo[] = {
@@ -390,7 +456,6 @@ static struct omap2_hsmmc_info mmc[] __initdata = {
static struct platform_device *ldp_devices[] __initdata = {
&ldp_smsc911x_device,
- &ldp_lcd_device,
&ldp_gpio_keys_device,
};
@@ -441,10 +506,8 @@ static struct mtd_partition ldp_nand_partitions[] = {
static void __init omap_ldp_init(void)
{
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
- omap_board_config = ldp_config;
- omap_board_config_size = ARRAY_SIZE(ldp_config);
- ldp_init_smsc911x();
omap_i2c_init();
+// sdp3430_display_init();
platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices));
ts_gpio = 54;
ldp_spi_board_info[0].irq = gpio_to_irq(ts_gpio);
@@ -459,6 +522,8 @@ static void __init omap_ldp_init(void)
omap2_hsmmc_init(mmc);
/* link regulators to MMC adapters */
ldp_vmmc1_supply.dev = mmc[0].dev;
+ sdp3430_display_init();
+ omap_display_init(&sdp3430_dss_data);
}
MACHINE_START(OMAP_LDP, "OMAP LDP board")
diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig
index 0b05593..3f4488b 100644
--- a/drivers/video/omap2/displays/Kconfig
+++ b/drivers/video/omap2/displays/Kconfig
@@ -55,4 +55,9 @@ config PANEL_ACX565AKM
select BACKLIGHT_CLASS_DEVICE
help
This is the LCD panel used on Nokia N900
+config PANEL_LDP
+ tristate "LDP PANEL"
+ help
+ This is the LCD panel used on LDP
+
endmenu
diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile
index d90f73c..9d7235c 100644
--- a/drivers/video/omap2/displays/Makefile
+++ b/drivers/video/omap2/displays/Makefile
@@ -7,3 +7,4 @@ obj-$(CONFIG_PANEL_TAAL) += panel-taal.o
obj-$(CONFIG_PANEL_PICODLP) += panel-picodlp.o
obj-$(CONFIG_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o
obj-$(CONFIG_PANEL_ACX565AKM) += panel-acx565akm.o
+obj-$(CONFIG_PANEL_LDP) += panel-ldp.o
diff --git a/drivers/video/omap2/displays/panel-ldp.c b/drivers/video/omap2/displays/panel-ldp.c
new file mode 100755
index 0000000..3f9bfd1
--- /dev/null
+++ b/drivers/video/omap2/displays/panel-ldp.c
@@ -0,0 +1,223 @@
+/*
+ * Generic DPI Panels support
+ *
+ * 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/platform_device.h>
+#include <linux/delay.h>
+#include <linux/i2c/twl.h>
+#include <mach/gpio.h>
+#include <plat/mux.h>
+#include <asm/mach-types.h>
+#include <linux/slab.h>
+#include <linux/delay.h>
+
+#include <plat/panel-generic-dpi.h>
+#define LCD_PANEL_BACKLIGHT_GPIO (15 + OMAP_MAX_GPIO_LINES)
+#define LCD_PANEL_ENABLE_GPIO (7 + OMAP_MAX_GPIO_LINES)
+
+#define LCD_PANEL_RESET_GPIO 55
+#define LCD_PANEL_QVGA_GPIO 56
+
+#ifdef CONFIG_FB_OMAP_LCD_VGA
+#define LCD_XRES 480
+#define LCD_YRES 640
+#define LCD_PIXCLOCK_MAX 41700
+#else
+#define LCD_XRES 240
+#define LCD_YRES 320
+#define LCD_PIXCLOCK_MAX 185186
+#endif
+
+#define PM_RECEIVER TWL4030_MODULE_PM_RECEIVER
+#define ENABLE_VAUX2_DEDICATED 0x09
+#define ENABLE_VAUX2_DEV_GRP 0x20
+#define ENABLE_VAUX3_DEDICATED 0x03
+#define ENABLE_VAUX3_DEV_GRP 0x20
+
+#define ENABLE_VPLL2_DEDICATED 0x05
+#define ENABLE_VPLL2_DEV_GRP 0xE0
+#define TWL4030_VPLL2_DEV_GRP 0x33
+#define TWL4030_VPLL2_DEDICATED 0x36
+
+#define t2_out(c, r, v) twl_i2c_write_u8(c, r, v)
+
+static struct omap_video_timings ldp_timings = {
+ .x_res = 480,
+ .y_res = 640,
+
+ .hsw = 3,
+ .hfp = 3,
+ .hbp = 39,
+
+ .vsw = 1,
+ .vfp = 2,
+ .vbp = 7,
+ .pixel_clock = 41700,
+};
+
+static void ldp_panel_cleanup(void)
+{
+ gpio_free(LCD_PANEL_BACKLIGHT_GPIO);
+ gpio_free(LCD_PANEL_ENABLE_GPIO);
+ gpio_free(LCD_PANEL_QVGA_GPIO);
+ gpio_free(LCD_PANEL_RESET_GPIO);
+}
+
+static int panel_ldp_probe(struct omap_dss_device *dssdev)
+{
+ dssdev->panel.timings = ldp_timings;
+ dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |
+ OMAP_DSS_LCD_IHS;
+ dssdev->panel.acb = 0x28;
+
+ return 0;
+}
+
+static void panel_ldp_remove(struct omap_dss_device *dssdev)
+{
+ return;
+}
+
+static int panel_ldp_power_on(struct omap_dss_device *dssdev)
+{
+ int r = 0;
+
+ 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 panel_ldp_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 panel_ldp_enable(struct omap_dss_device *dssdev)
+{
+ gpio_request(LCD_PANEL_RESET_GPIO, "lcd reset");
+ gpio_request(LCD_PANEL_QVGA_GPIO, "lcd qvga");
+ gpio_request(LCD_PANEL_ENABLE_GPIO, "lcd panel");
+ gpio_request(LCD_PANEL_BACKLIGHT_GPIO, "lcd backlight");
+
+ gpio_direction_output(LCD_PANEL_QVGA_GPIO, 0);
+ gpio_direction_output(LCD_PANEL_RESET_GPIO, 0);
+ gpio_direction_output(LCD_PANEL_ENABLE_GPIO, 0);
+ gpio_direction_output(LCD_PANEL_BACKLIGHT_GPIO, 0);
+
+#ifdef CONFIG_FB_OMAP_LCD_VGA
+ gpio_set_value(LCD_PANEL_QVGA_GPIO, 0);
+#else
+ gpio_set_value(LCD_PANEL_QVGA_GPIO, 1);
+#endif
+ gpio_set_value(LCD_PANEL_RESET_GPIO, 1);
+
+ if (0 != t2_out(PM_RECEIVER, ENABLE_VPLL2_DEDICATED,
+ TWL4030_VPLL2_DEDICATED))
+ return -EIO;
+
+ if (0 != t2_out(PM_RECEIVER, ENABLE_VPLL2_DEV_GRP,
+ TWL4030_VPLL2_DEV_GRP))
+ return -EIO;
+
+ gpio_direction_output(LCD_PANEL_ENABLE_GPIO, 1);
+ gpio_direction_output(LCD_PANEL_BACKLIGHT_GPIO, 1);
+
+ int r = panel_ldp_power_on(dssdev);
+
+ dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
+ if (0 != t2_out(PM_RECEIVER, ENABLE_VAUX3_DEDICATED,
+ TWL4030_VAUX3_DEDICATED))
+ return -EIO;
+
+ if (0 != t2_out(PM_RECEIVER, ENABLE_VAUX3_DEV_GRP,
+ TWL4030_VAUX3_DEV_GRP))
+ return -EIO;
+
+ return r;
+}
+
+static void panel_ldp_disable(struct omap_dss_device *dssdev)
+{
+ gpio_direction_output(LCD_PANEL_ENABLE_GPIO, 0);
+ gpio_direction_output(LCD_PANEL_BACKLIGHT_GPIO, 0);
+
+ t2_out(PM_RECEIVER, 0x0, TWL4030_VPLL2_DEDICATED);
+ t2_out(PM_RECEIVER, 0x0, TWL4030_VPLL2_DEV_GRP);
+ msleep(4);
+ panel_ldp_power_off(dssdev);
+ dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
+}
+
+static void panel_ldp_get_resolution(struct omap_dss_device *dssdev, int *w, int *h)
+{
+ *w = ldp_timings.x_res;
+ *h = ldp_timings.y_res;
+ if (*w == 0)
+ *w = 320;
+}
+
+static struct omap_dss_driver ldp_panel = {
+ .probe = panel_ldp_probe,
+ .remove = panel_ldp_remove,
+
+ .enable = panel_ldp_enable,
+ .disable = panel_ldp_disable,
+
+ .get_resolution = panel_ldp_get_resolution,
+
+ .driver = {
+ .name = "ldp_panel",
+ .owner = THIS_MODULE,
+ },
+};
+
+static int __init panel_ldp_drv_init(void)
+{
+ return omap_dss_register_driver(&ldp_panel);
+}
+
+static void __exit panel_ldp_drv_exit(void)
+{
+ omap_dss_unregister_driver(&ldp_panel);
+}
+
+module_init(panel_ldp_drv_init);
+module_exit(panel_ldp_drv_exit);
+MODULE_LICENSE("GPL");
--
1.7.1
[-- Attachment #2: 0001-LDP-Tomi-patch.patch --]
[-- Type: application/octet-stream, Size: 12355 bytes --]
From 1f3470d3d792721bf5aa4d060c1cf79f5a587497 Mon Sep 17 00:00:00 2001
From: Mayuresh Janorkar <mayur@ti.com>
Date: Thu, 12 May 2011 18:53:46 +0530
Subject: [PATCH] LDP Tomi patch
---
arch/arm/mach-omap2/board-ldp.c | 87 ++++++++++--
drivers/video/omap2/displays/Kconfig | 5 +
drivers/video/omap2/displays/Makefile | 1 +
drivers/video/omap2/displays/panel-ldp.c | 223 ++++++++++++++++++++++++++++++
4 files changed, 305 insertions(+), 11 deletions(-)
mode change 100644 => 100755 arch/arm/mach-omap2/board-ldp.c
create mode 100755 drivers/video/omap2/displays/panel-ldp.c
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
old mode 100644
new mode 100755
index e2ba779..fa6327a
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -43,6 +43,7 @@
#include <asm/delay.h>
#include <plat/usb.h>
+#include <plat/display.h>
#include "board-flash.h"
#include "mux.h"
@@ -53,6 +54,11 @@
#define LDP_SMSC911X_GPIO 152
#define DEBUG_BASE 0x08000000
#define LDP_ETHR_START DEBUG_BASE
+#define LCD_PANEL_BACKLIGHT_GPIO (15 + OMAP_MAX_GPIO_LINES)
+#define LCD_PANEL_ENABLE_GPIO (7 + OMAP_MAX_GPIO_LINES)
+
+#define LCD_PANEL_RESET_GPIO 55
+#define LCD_PANEL_QVGA_GPIO 56
static struct resource ldp_smsc911x_resources[] = {
[0] = {
@@ -275,19 +281,78 @@ static inline void __init ldp_init_smsc911x(void)
gpio_direction_input(eth_gpio);
}
-static struct platform_device ldp_lcd_device = {
- .name = "ldp_lcd",
- .id = -1,
+#define SDP3430_LCD_PANEL_BACKLIGHT_GPIO 8
+#define SDP3430_LCD_PANEL_ENABLE_GPIO 5
+
+static unsigned backlight_gpio;
+static unsigned enable_gpio;
+static int lcd_enabled;
+
+static void __init sdp3430_display_init(void)
+{
+ printk(KERN_INFO "\n LDP:: sdp3430_display_init ");
+ return;
+}
+
+static int sdp3430_panel_enable_lcd(struct omap_dss_device *dssdev)
+{
+ int status;
+ return 0;
+}
+
+static void sdp3430_panel_disable_lcd(struct omap_dss_device *dssdev)
+{
+ lcd_enabled = 0;
+
+ gpio_direction_output(enable_gpio, 0);
+ gpio_direction_output(backlight_gpio, 0);
+
+ gpio_direction_output(LCD_PANEL_ENABLE_GPIO, 0);
+ gpio_direction_output(LCD_PANEL_BACKLIGHT_GPIO, 0);
+
+}
+
+static struct omap_dss_device sdp3430_lcd_device = {
+ .name = "lcd",
+ .driver_name = "ldp_panel",
+ .type = OMAP_DISPLAY_TYPE_DPI,
+ .phy.dpi.data_lines = 16,
+ .platform_enable = sdp3430_panel_enable_lcd,
+ .platform_disable = sdp3430_panel_disable_lcd,
};
-static struct omap_lcd_config ldp_lcd_config __initdata = {
- .ctrl_name = "internal",
+static struct omap_dss_device *sdp3430_dss_devices[] = {
+ &sdp3430_lcd_device,
};
-static struct omap_board_config_kernel ldp_config[] __initdata = {
- { OMAP_TAG_LCD, &ldp_lcd_config },
+static struct omap_dss_board_info sdp3430_dss_data = {
+ .num_devices = ARRAY_SIZE(sdp3430_dss_devices),
+ .devices = sdp3430_dss_devices,
+ .default_device = &sdp3430_lcd_device,
};
+/* VPLL2 for digital video outputs */
+static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = {
+ REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
+ REGULATOR_SUPPLY("vdds_dsi", "omap_dsi1"),
+};
+
+static struct regulator_init_data sdp3430_vpll2 = {
+ .constraints = {
+ .name = "VDVI",
+ .min_uV = 1800000,
+ .max_uV = 1800000,
+ .apply_uV = true,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(sdp3430_vpll2_supplies),
+ .consumer_supplies = sdp3430_vpll2_supplies,
+};
+
+
static void __init omap_ldp_init_early(void)
{
omap2_init_common_infrastructure();
@@ -358,6 +423,7 @@ static struct twl4030_platform_data ldp_twldata = {
.vaux1 = &ldp_vaux1,
.gpio = &ldp_gpio_data,
.keypad = &ldp_kp_twl4030_data,
+ .vpll2 = &sdp3430_vpll2,
};
static struct i2c_board_info __initdata ldp_i2c_boardinfo[] = {
@@ -390,7 +456,6 @@ static struct omap2_hsmmc_info mmc[] __initdata = {
static struct platform_device *ldp_devices[] __initdata = {
&ldp_smsc911x_device,
- &ldp_lcd_device,
&ldp_gpio_keys_device,
};
@@ -441,10 +506,8 @@ static struct mtd_partition ldp_nand_partitions[] = {
static void __init omap_ldp_init(void)
{
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
- omap_board_config = ldp_config;
- omap_board_config_size = ARRAY_SIZE(ldp_config);
- ldp_init_smsc911x();
omap_i2c_init();
+// sdp3430_display_init();
platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices));
ts_gpio = 54;
ldp_spi_board_info[0].irq = gpio_to_irq(ts_gpio);
@@ -459,6 +522,8 @@ static void __init omap_ldp_init(void)
omap2_hsmmc_init(mmc);
/* link regulators to MMC adapters */
ldp_vmmc1_supply.dev = mmc[0].dev;
+ sdp3430_display_init();
+ omap_display_init(&sdp3430_dss_data);
}
MACHINE_START(OMAP_LDP, "OMAP LDP board")
diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig
index 0b05593..3f4488b 100644
--- a/drivers/video/omap2/displays/Kconfig
+++ b/drivers/video/omap2/displays/Kconfig
@@ -55,4 +55,9 @@ config PANEL_ACX565AKM
select BACKLIGHT_CLASS_DEVICE
help
This is the LCD panel used on Nokia N900
+config PANEL_LDP
+ tristate "LDP PANEL"
+ help
+ This is the LCD panel used on LDP
+
endmenu
diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile
index d90f73c..9d7235c 100644
--- a/drivers/video/omap2/displays/Makefile
+++ b/drivers/video/omap2/displays/Makefile
@@ -7,3 +7,4 @@ obj-$(CONFIG_PANEL_TAAL) += panel-taal.o
obj-$(CONFIG_PANEL_PICODLP) += panel-picodlp.o
obj-$(CONFIG_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o
obj-$(CONFIG_PANEL_ACX565AKM) += panel-acx565akm.o
+obj-$(CONFIG_PANEL_LDP) += panel-ldp.o
diff --git a/drivers/video/omap2/displays/panel-ldp.c b/drivers/video/omap2/displays/panel-ldp.c
new file mode 100755
index 0000000..3f9bfd1
--- /dev/null
+++ b/drivers/video/omap2/displays/panel-ldp.c
@@ -0,0 +1,223 @@
+/*
+ * Generic DPI Panels support
+ *
+ * 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/platform_device.h>
+#include <linux/delay.h>
+#include <linux/i2c/twl.h>
+#include <mach/gpio.h>
+#include <plat/mux.h>
+#include <asm/mach-types.h>
+#include <linux/slab.h>
+#include <linux/delay.h>
+
+#include <plat/panel-generic-dpi.h>
+#define LCD_PANEL_BACKLIGHT_GPIO (15 + OMAP_MAX_GPIO_LINES)
+#define LCD_PANEL_ENABLE_GPIO (7 + OMAP_MAX_GPIO_LINES)
+
+#define LCD_PANEL_RESET_GPIO 55
+#define LCD_PANEL_QVGA_GPIO 56
+
+#ifdef CONFIG_FB_OMAP_LCD_VGA
+#define LCD_XRES 480
+#define LCD_YRES 640
+#define LCD_PIXCLOCK_MAX 41700
+#else
+#define LCD_XRES 240
+#define LCD_YRES 320
+#define LCD_PIXCLOCK_MAX 185186
+#endif
+
+#define PM_RECEIVER TWL4030_MODULE_PM_RECEIVER
+#define ENABLE_VAUX2_DEDICATED 0x09
+#define ENABLE_VAUX2_DEV_GRP 0x20
+#define ENABLE_VAUX3_DEDICATED 0x03
+#define ENABLE_VAUX3_DEV_GRP 0x20
+
+#define ENABLE_VPLL2_DEDICATED 0x05
+#define ENABLE_VPLL2_DEV_GRP 0xE0
+#define TWL4030_VPLL2_DEV_GRP 0x33
+#define TWL4030_VPLL2_DEDICATED 0x36
+
+#define t2_out(c, r, v) twl_i2c_write_u8(c, r, v)
+
+static struct omap_video_timings ldp_timings = {
+ .x_res = 480,
+ .y_res = 640,
+
+ .hsw = 3,
+ .hfp = 3,
+ .hbp = 39,
+
+ .vsw = 1,
+ .vfp = 2,
+ .vbp = 7,
+ .pixel_clock = 41700,
+};
+
+static void ldp_panel_cleanup(void)
+{
+ gpio_free(LCD_PANEL_BACKLIGHT_GPIO);
+ gpio_free(LCD_PANEL_ENABLE_GPIO);
+ gpio_free(LCD_PANEL_QVGA_GPIO);
+ gpio_free(LCD_PANEL_RESET_GPIO);
+}
+
+static int panel_ldp_probe(struct omap_dss_device *dssdev)
+{
+ dssdev->panel.timings = ldp_timings;
+ dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |
+ OMAP_DSS_LCD_IHS;
+ dssdev->panel.acb = 0x28;
+
+ return 0;
+}
+
+static void panel_ldp_remove(struct omap_dss_device *dssdev)
+{
+ return;
+}
+
+static int panel_ldp_power_on(struct omap_dss_device *dssdev)
+{
+ int r = 0;
+
+ 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 panel_ldp_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 panel_ldp_enable(struct omap_dss_device *dssdev)
+{
+ gpio_request(LCD_PANEL_RESET_GPIO, "lcd reset");
+ gpio_request(LCD_PANEL_QVGA_GPIO, "lcd qvga");
+ gpio_request(LCD_PANEL_ENABLE_GPIO, "lcd panel");
+ gpio_request(LCD_PANEL_BACKLIGHT_GPIO, "lcd backlight");
+
+ gpio_direction_output(LCD_PANEL_QVGA_GPIO, 0);
+ gpio_direction_output(LCD_PANEL_RESET_GPIO, 0);
+ gpio_direction_output(LCD_PANEL_ENABLE_GPIO, 0);
+ gpio_direction_output(LCD_PANEL_BACKLIGHT_GPIO, 0);
+
+#ifdef CONFIG_FB_OMAP_LCD_VGA
+ gpio_set_value(LCD_PANEL_QVGA_GPIO, 0);
+#else
+ gpio_set_value(LCD_PANEL_QVGA_GPIO, 1);
+#endif
+ gpio_set_value(LCD_PANEL_RESET_GPIO, 1);
+
+ if (0 != t2_out(PM_RECEIVER, ENABLE_VPLL2_DEDICATED,
+ TWL4030_VPLL2_DEDICATED))
+ return -EIO;
+
+ if (0 != t2_out(PM_RECEIVER, ENABLE_VPLL2_DEV_GRP,
+ TWL4030_VPLL2_DEV_GRP))
+ return -EIO;
+
+ gpio_direction_output(LCD_PANEL_ENABLE_GPIO, 1);
+ gpio_direction_output(LCD_PANEL_BACKLIGHT_GPIO, 1);
+
+ int r = panel_ldp_power_on(dssdev);
+
+ dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
+ if (0 != t2_out(PM_RECEIVER, ENABLE_VAUX3_DEDICATED,
+ TWL4030_VAUX3_DEDICATED))
+ return -EIO;
+
+ if (0 != t2_out(PM_RECEIVER, ENABLE_VAUX3_DEV_GRP,
+ TWL4030_VAUX3_DEV_GRP))
+ return -EIO;
+
+ return r;
+}
+
+static void panel_ldp_disable(struct omap_dss_device *dssdev)
+{
+ gpio_direction_output(LCD_PANEL_ENABLE_GPIO, 0);
+ gpio_direction_output(LCD_PANEL_BACKLIGHT_GPIO, 0);
+
+ t2_out(PM_RECEIVER, 0x0, TWL4030_VPLL2_DEDICATED);
+ t2_out(PM_RECEIVER, 0x0, TWL4030_VPLL2_DEV_GRP);
+ msleep(4);
+ panel_ldp_power_off(dssdev);
+ dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
+}
+
+static void panel_ldp_get_resolution(struct omap_dss_device *dssdev, int *w, int *h)
+{
+ *w = ldp_timings.x_res;
+ *h = ldp_timings.y_res;
+ if (*w == 0)
+ *w = 320;
+}
+
+static struct omap_dss_driver ldp_panel = {
+ .probe = panel_ldp_probe,
+ .remove = panel_ldp_remove,
+
+ .enable = panel_ldp_enable,
+ .disable = panel_ldp_disable,
+
+ .get_resolution = panel_ldp_get_resolution,
+
+ .driver = {
+ .name = "ldp_panel",
+ .owner = THIS_MODULE,
+ },
+};
+
+static int __init panel_ldp_drv_init(void)
+{
+ return omap_dss_register_driver(&ldp_panel);
+}
+
+static void __exit panel_ldp_drv_exit(void)
+{
+ omap_dss_unregister_driver(&ldp_panel);
+}
+
+module_init(panel_ldp_drv_init);
+module_exit(panel_ldp_drv_exit);
+MODULE_LICENSE("GPL");
--
1.7.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* RE: [PATCH 4/6] OMAP: LDP: Port the display driver to new DSS2
2011-05-12 14:36 ` Janorkar, Mayuresh
@ 2011-05-12 14:47 ` Tomi Valkeinen
2011-05-12 14:50 ` Janorkar, Mayuresh
0 siblings, 1 reply; 34+ messages in thread
From: Tomi Valkeinen @ 2011-05-12 14:47 UTC (permalink / raw)
To: Janorkar, Mayuresh
Cc: Igor Grinberg, linux-omap@vger.kernel.org, Stanley Miao
On Thu, 2011-05-12 at 20:06 +0530, Janorkar, Mayuresh wrote:
> > -----Original Message-----
> > From: Valkeinen, Tomi
> > Sent: Thursday, May 12, 2011 5:18 PM
> > To: Igor Grinberg
> > Cc: Janorkar, Mayuresh; tony@atomide.com; linux-omap@vger.kernel.org;
> > Stanley Miao
> > Subject: Re: [PATCH 4/6] OMAP: LDP: Port the display driver to new DSS2
> >
> > On Thu, 2011-05-12 at 14:20 +0300, Igor Grinberg wrote:
> >
> > > Right. Do both fixes make it work?
> > >
> > > If it is, then Tomi,
> > > will you add both fixes to the patch set with our SOBs?
> > > or do you want this to be sent properly as a follow up?
> >
> > Yes, I can add these all to the same patch and handle it through DSS
> > tree. Although due to the reluctance to make changes to arch/arm/*omap*,
> > I guess we'll pass these patches in this merge window.
> >
> > Mayuresh, if you're able to test this and it works, can you send me the
> > full diff so that I don't make any mistakes combining the code?
> >
> > Tomi
> >
>
> Please find the patch below.
> I have also attached the same.
>
> There are formatting problems with this patch. But this can be used as a reference.
>
> I have verified bootup with Penguins on LDP board.
Why did you create a new panel for LDP? The generic panel driver should
handle it well enough.
The attached panel driver is also quite messed up. It does things that
belong to the board file, and the timings are a bit high, giving refresh
rate of 120MHz. Does LDP have a 120MHz panel?
Tomi
^ permalink raw reply [flat|nested] 34+ messages in thread
* RE: [PATCH 4/6] OMAP: LDP: Port the display driver to new DSS2
2011-05-12 14:47 ` Tomi Valkeinen
@ 2011-05-12 14:50 ` Janorkar, Mayuresh
2011-05-12 14:59 ` Tomi Valkeinen
0 siblings, 1 reply; 34+ messages in thread
From: Janorkar, Mayuresh @ 2011-05-12 14:50 UTC (permalink / raw)
To: Valkeinen, Tomi; +Cc: Igor Grinberg, linux-omap@vger.kernel.org, Stanley Miao
> -----Original Message-----
> From: Valkeinen, Tomi
> Sent: Thursday, May 12, 2011 8:17 PM
> To: Janorkar, Mayuresh
> Cc: Igor Grinberg; linux-omap@vger.kernel.org; Stanley Miao
> Subject: RE: [PATCH 4/6] OMAP: LDP: Port the display driver to new DSS2
>
> On Thu, 2011-05-12 at 20:06 +0530, Janorkar, Mayuresh wrote:
> > > -----Original Message-----
> > > From: Valkeinen, Tomi
> > > Sent: Thursday, May 12, 2011 5:18 PM
> > > To: Igor Grinberg
> > > Cc: Janorkar, Mayuresh; tony@atomide.com; linux-omap@vger.kernel.org;
> > > Stanley Miao
> > > Subject: Re: [PATCH 4/6] OMAP: LDP: Port the display driver to new
> DSS2
> > >
> > > On Thu, 2011-05-12 at 14:20 +0300, Igor Grinberg wrote:
> > >
> > > > Right. Do both fixes make it work?
> > > >
> > > > If it is, then Tomi,
> > > > will you add both fixes to the patch set with our SOBs?
> > > > or do you want this to be sent properly as a follow up?
> > >
> > > Yes, I can add these all to the same patch and handle it through DSS
> > > tree. Although due to the reluctance to make changes to
> arch/arm/*omap*,
> > > I guess we'll pass these patches in this merge window.
> > >
> > > Mayuresh, if you're able to test this and it works, can you send me
> the
> > > full diff so that I don't make any mistakes combining the code?
> > >
> > > Tomi
> > >
> >
> > Please find the patch below.
> > I have also attached the same.
> >
> > There are formatting problems with this patch. But this can be used as a
> reference.
> >
> > I have verified bootup with Penguins on LDP board.
>
> Why did you create a new panel for LDP? The generic panel driver should
> handle it well enough.
>
> The attached panel driver is also quite messed up. It does things that
> belong to the board file, and the timings are a bit high, giving refresh
> rate of 120MHz. Does LDP have a 120MHz panel?
You can use that code as reference and not as a patch.
Please take a look at changes in board file.
There is no need to create a new panel. It can be added as a part of generic panel.
I have taken timings info from: drivers/video/omap/lcd_ldp.c
#ifdef CONFIG_FB_OMAP_LCD_VGA
#define LCD_XRES 480
#define LCD_YRES 640
#define LCD_PIXCLOCK_MAX 41700
#else
#define LCD_XRES 240
#define LCD_YRES 320
#define LCD_PIXCLOCK_MAX 185186
#endif
>
> Tomi
>
^ permalink raw reply [flat|nested] 34+ messages in thread
* RE: [PATCH 4/6] OMAP: LDP: Port the display driver to new DSS2
2011-05-12 14:50 ` Janorkar, Mayuresh
@ 2011-05-12 14:59 ` Tomi Valkeinen
0 siblings, 0 replies; 34+ messages in thread
From: Tomi Valkeinen @ 2011-05-12 14:59 UTC (permalink / raw)
To: Janorkar, Mayuresh
Cc: Igor Grinberg, linux-omap@vger.kernel.org, Stanley Miao
On Thu, 2011-05-12 at 20:20 +0530, Janorkar, Mayuresh wrote:
>
> > -----Original Message-----
> > From: Valkeinen, Tomi
> > Sent: Thursday, May 12, 2011 8:17 PM
> > To: Janorkar, Mayuresh
> > Cc: Igor Grinberg; linux-omap@vger.kernel.org; Stanley Miao
> > Subject: RE: [PATCH 4/6] OMAP: LDP: Port the display driver to new DSS2
> >
> > On Thu, 2011-05-12 at 20:06 +0530, Janorkar, Mayuresh wrote:
> > > > -----Original Message-----
> > > > From: Valkeinen, Tomi
> > > > Sent: Thursday, May 12, 2011 5:18 PM
> > > > To: Igor Grinberg
> > > > Cc: Janorkar, Mayuresh; tony@atomide.com; linux-omap@vger.kernel.org;
> > > > Stanley Miao
> > > > Subject: Re: [PATCH 4/6] OMAP: LDP: Port the display driver to new
> > DSS2
> > > >
> > > > On Thu, 2011-05-12 at 14:20 +0300, Igor Grinberg wrote:
> > > >
> > > > > Right. Do both fixes make it work?
> > > > >
> > > > > If it is, then Tomi,
> > > > > will you add both fixes to the patch set with our SOBs?
> > > > > or do you want this to be sent properly as a follow up?
> > > >
> > > > Yes, I can add these all to the same patch and handle it through DSS
> > > > tree. Although due to the reluctance to make changes to
> > arch/arm/*omap*,
> > > > I guess we'll pass these patches in this merge window.
> > > >
> > > > Mayuresh, if you're able to test this and it works, can you send me
> > the
> > > > full diff so that I don't make any mistakes combining the code?
> > > >
> > > > Tomi
> > > >
> > >
> > > Please find the patch below.
> > > I have also attached the same.
> > >
> > > There are formatting problems with this patch. But this can be used as a
> > reference.
> > >
> > > I have verified bootup with Penguins on LDP board.
> >
> > Why did you create a new panel for LDP? The generic panel driver should
> > handle it well enough.
> >
> > The attached panel driver is also quite messed up. It does things that
> > belong to the board file, and the timings are a bit high, giving refresh
> > rate of 120MHz. Does LDP have a 120MHz panel?
>
> You can use that code as reference and not as a patch.
> Please take a look at changes in board file.
> There is no need to create a new panel. It can be added as a part of generic panel.
Well, the board file is also rather messed up. The board file is using
gpios that are not reserved anywhere, it's missing Igor's TWL GPIO setup
code, the panel driver requests some of the GPIOs but doesn't check
error values, so we don't know if it succeeds or not. etc.
So the patch doesn't tell us much even if LDP display seems to work with
it.
But I'll try to cook up with a proper patch at some point.
Tomi
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 4/6] OMAP: LDP: Port the display driver to new DSS2
2011-05-12 6:40 ` Igor Grinberg
2011-05-12 7:16 ` Igor Grinberg
@ 2011-05-16 8:53 ` Tomi Valkeinen
2011-05-16 11:13 ` Igor Grinberg
2011-05-16 11:26 ` Janorkar, Mayuresh
1 sibling, 2 replies; 34+ messages in thread
From: Tomi Valkeinen @ 2011-05-16 8:53 UTC (permalink / raw)
To: Igor Grinberg
Cc: Janorkar, Mayuresh, tony@atomide.com, linux-omap@vger.kernel.org,
Stanley Miao
On Thu, 2011-05-12 at 09:40 +0300, Igor Grinberg wrote:
>
> On 05/11/11 09:32, Tomi Valkeinen wrote:
>
> > On Wed, 2011-05-11 at 10:28 +0530, Janorkar, Mayuresh wrote:
> >
> >>> +static void __init ldp_display_init(void)
> >>> +{
> >>> + int r;
> >>> +
> >>> + struct gpio gpios[] = {
> >>> + {LCD_PANEL_RESET_GPIO, GPIOF_OUT_INIT_HIGH, "LCD RESET"},
> >>> + {LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, "LCD QVGA"},
> >>> + {LCD_PANEL_ENABLE_GPIO, GPIOF_OUT_INIT_LOW, "LCD ENABLE"},
> >>> + {LCD_PANEL_BACKLIGHT_GPIO, GPIOF_OUT_INIT_LOW, "LCD
> >>> BACKLIGHT"},
> >>> + };
> >>> +
> >>> + r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
> >>> + if (r) {
> >>> + pr_err("Cannot request LCD GPIOs, error %d\n", r);
> >>> + return;
> >>> + }
> >> If I test with this patch, this request is returning error.
> > Hmm. Well, the GPIOs are the same as in the old driver. However, the old
> > driver doesn't even seem to check if it manages to request the GPIOs, so
> > it may well be that it was failing also.
> >
> > Can you check from /sys/class/gpio/ if some of the GPIOs are already
> > allocated: 207, 199, 55, 56?
> >
> > The definition of two of those GPIOs look kinda funny to me: (15 +
> > OMAP_MAX_GPIO_LINES). I don't know what OMAP_MAX_GPIO_LINES means, but
> > it sure doesn't sound ok to have a GPIO number that is 15 over the
> > maximum =).
> >
>
> This means that some kind of gpio expander is used.
> I bet those are twl gpios (or may be some other discrete chip).
> If those are twl gpios then you need to provide the .setup callback
> in struct twl4030_gpio_platform_data which will request and setup those gpios.
Here's an updated patch with the twl gpio code.
All the old omapfb porting patches, including new drivers for DSS2, can
be found from
git://gitorious.org/linux-omap-dss2/linux.git old-omapfb-port
Tomi
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index e2ba779..ed78b9a 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -44,6 +44,9 @@
#include <asm/delay.h>
#include <plat/usb.h>
+#include <video/omapdss.h>
+#include <video/omap-panel-generic-dpi.h>
+
#include "board-flash.h"
#include "mux.h"
#include "hsmmc.h"
@@ -275,19 +278,70 @@ static inline void __init ldp_init_smsc911x(void)
gpio_direction_input(eth_gpio);
}
-static struct platform_device ldp_lcd_device = {
- .name = "ldp_lcd",
- .id = -1,
+/* LCD */
+
+static int ldp_backlight_gpio;
+static int ldp_lcd_enable_gpio;
+
+#define LCD_PANEL_RESET_GPIO 55
+#define LCD_PANEL_QVGA_GPIO 56
+
+static int ldp_panel_enable_lcd(struct omap_dss_device *dssdev)
+{
+ gpio_direction_output(ldp_lcd_enable_gpio, 1);
+ gpio_direction_output(ldp_backlight_gpio, 1);
+
+ return 0;
+}
+
+static void ldp_panel_disable_lcd(struct omap_dss_device *dssdev)
+{
+ gpio_direction_output(ldp_lcd_enable_gpio, 0);
+ gpio_direction_output(ldp_backlight_gpio, 0);
+}
+
+static struct panel_generic_dpi_data ldp_panel_data = {
+ .name = "2430sdp",
+ .platform_enable = ldp_panel_enable_lcd,
+ .platform_disable = ldp_panel_disable_lcd,
+};
+
+static struct omap_dss_device ldp_lcd_device = {
+ .name = "lcd",
+ .driver_name = "generic_dpi_panel",
+ .type = OMAP_DISPLAY_TYPE_DPI,
+ .phy.dpi.data_lines = 16,
+ .data = &ldp_panel_data,
};
-static struct omap_lcd_config ldp_lcd_config __initdata = {
- .ctrl_name = "internal",
+static struct omap_dss_device *ldp_dss_devices[] = {
+ &ldp_lcd_device,
};
-static struct omap_board_config_kernel ldp_config[] __initdata = {
- { OMAP_TAG_LCD, &ldp_lcd_config },
+static struct omap_dss_board_info ldp_dss_data = {
+ .num_devices = ARRAY_SIZE(ldp_dss_devices),
+ .devices = ldp_dss_devices,
+ .default_device = &ldp_lcd_device,
};
+static void __init ldp_display_init(void)
+{
+ int r;
+
+ static struct gpio gpios[] __initdata = {
+ {LCD_PANEL_RESET_GPIO, GPIOF_OUT_INIT_HIGH, "LCD RESET"},
+ {LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, "LCD QVGA"},
+ };
+
+ r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
+ if (r) {
+ pr_err("Cannot request LCD GPIOs, error %d\n", r);
+ return;
+ }
+
+ omap_display_init(&ldp_dss_data);
+}
+
static void __init omap_ldp_init_early(void)
{
omap2_init_common_infrastructure();
@@ -298,10 +352,30 @@ static struct twl4030_usb_data ldp_usb_data = {
.usb_mode = T2_USB_MODE_ULPI,
};
+static int ldp_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio)
+{
+ int r;
+
+ struct gpio gpios[] = {
+ {gpio + 7 , GPIOF_OUT_INIT_LOW, "LCD ENABLE"},
+ {gpio + 15, GPIOF_OUT_INIT_LOW, "LCD BACKLIGHT"},
+ };
+
+ r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
+ if (r)
+ pr_err("Cannot request LCD GPIOs, error %d\n", r);
+
+ ldp_backlight_gpio = gpio + 15;
+ ldp_lcd_enable_gpio = gpio + 7;
+
+ return r;
+}
+
static struct twl4030_gpio_platform_data ldp_gpio_data = {
.gpio_base = OMAP_MAX_GPIO_LINES,
.irq_base = TWL4030_GPIO_IRQ_BASE,
.irq_end = TWL4030_GPIO_IRQ_END,
+ .setup = ldp_twl_gpio_setup,
};
static struct twl4030_madc_platform_data ldp_madc_data = {
@@ -347,6 +421,26 @@ static struct regulator_init_data ldp_vaux1 = {
.consumer_supplies = ldp_vaux1_supplies,
};
+static struct regulator_consumer_supply ldp_vpll2_supplies[] = {
+ REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
+ REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"),
+};
+
+static struct regulator_init_data ldp_vpll2 = {
+ .constraints = {
+ .name = "VDVI",
+ .min_uV = 1800000,
+ .max_uV = 1800000,
+ .apply_uV = true,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(ldp_vpll2_supplies),
+ .consumer_supplies = ldp_vpll2_supplies,
+};
+
static struct twl4030_platform_data ldp_twldata = {
.irq_base = TWL4030_IRQ_BASE,
.irq_end = TWL4030_IRQ_END,
@@ -356,6 +450,7 @@ static struct twl4030_platform_data ldp_twldata = {
.usb = &ldp_usb_data,
.vmmc1 = &ldp_vmmc1,
.vaux1 = &ldp_vaux1,
+ .vpll2 = &ldp_vpll2,
.gpio = &ldp_gpio_data,
.keypad = &ldp_kp_twl4030_data,
};
@@ -390,7 +485,6 @@ static struct omap2_hsmmc_info mmc[] __initdata = {
static struct platform_device *ldp_devices[] __initdata = {
&ldp_smsc911x_device,
- &ldp_lcd_device,
&ldp_gpio_keys_device,
};
@@ -441,8 +535,6 @@ static struct mtd_partition ldp_nand_partitions[] = {
static void __init omap_ldp_init(void)
{
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
- omap_board_config = ldp_config;
- omap_board_config_size = ARRAY_SIZE(ldp_config);
ldp_init_smsc911x();
omap_i2c_init();
platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices));
@@ -459,6 +551,8 @@ static void __init omap_ldp_init(void)
omap2_hsmmc_init(mmc);
/* link regulators to MMC adapters */
ldp_vmmc1_supply.dev = mmc[0].dev;
+
+ ldp_display_init();
}
MACHINE_START(OMAP_LDP, "OMAP LDP board")
^ permalink raw reply related [flat|nested] 34+ messages in thread
* Re: [PATCH 4/6] OMAP: LDP: Port the display driver to new DSS2
2011-05-16 8:53 ` Tomi Valkeinen
@ 2011-05-16 11:13 ` Igor Grinberg
2011-05-17 11:49 ` Tomi Valkeinen
2011-05-16 11:26 ` Janorkar, Mayuresh
1 sibling, 1 reply; 34+ messages in thread
From: Igor Grinberg @ 2011-05-16 11:13 UTC (permalink / raw)
To: Tomi Valkeinen
Cc: Janorkar, Mayuresh, tony@atomide.com, linux-omap@vger.kernel.org,
Stanley Miao
On 05/16/11 11:53, Tomi Valkeinen wrote:
> Here's an updated patch with the twl gpio code.
Looks good, though one minor issue below
> All the old omapfb porting patches, including new drivers for DSS2, can
> be found from
>
> git://gitorious.org/linux-omap-dss2/linux.git old-omapfb-port
>
> Tomi
>
> diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
> index e2ba779..ed78b9a 100644
> --- a/arch/arm/mach-omap2/board-ldp.c
> +++ b/arch/arm/mach-omap2/board-ldp.c
> @@ -44,6 +44,9 @@
> #include <asm/delay.h>
> #include <plat/usb.h>
>
> +#include <video/omapdss.h>
> +#include <video/omap-panel-generic-dpi.h>
> +
> #include "board-flash.h"
> #include "mux.h"
> #include "hsmmc.h"
> @@ -275,19 +278,70 @@ static inline void __init ldp_init_smsc911x(void)
> gpio_direction_input(eth_gpio);
> }
>
> -static struct platform_device ldp_lcd_device = {
> - .name = "ldp_lcd",
> - .id = -1,
> +/* LCD */
> +
> +static int ldp_backlight_gpio;
> +static int ldp_lcd_enable_gpio;
> +
> +#define LCD_PANEL_RESET_GPIO 55
> +#define LCD_PANEL_QVGA_GPIO 56
> +
> +static int ldp_panel_enable_lcd(struct omap_dss_device *dssdev)
> +{
> + gpio_direction_output(ldp_lcd_enable_gpio, 1);
> + gpio_direction_output(ldp_backlight_gpio, 1);
> +
> + return 0;
> +}
> +
> +static void ldp_panel_disable_lcd(struct omap_dss_device *dssdev)
> +{
> + gpio_direction_output(ldp_lcd_enable_gpio, 0);
> + gpio_direction_output(ldp_backlight_gpio, 0);
> +}
> +
> +static struct panel_generic_dpi_data ldp_panel_data = {
> + .name = "2430sdp",
> + .platform_enable = ldp_panel_enable_lcd,
> + .platform_disable = ldp_panel_disable_lcd,
> +};
> +
> +static struct omap_dss_device ldp_lcd_device = {
> + .name = "lcd",
> + .driver_name = "generic_dpi_panel",
> + .type = OMAP_DISPLAY_TYPE_DPI,
> + .phy.dpi.data_lines = 16,
> + .data = &ldp_panel_data,
> };
>
> -static struct omap_lcd_config ldp_lcd_config __initdata = {
> - .ctrl_name = "internal",
> +static struct omap_dss_device *ldp_dss_devices[] = {
> + &ldp_lcd_device,
> };
>
> -static struct omap_board_config_kernel ldp_config[] __initdata = {
> - { OMAP_TAG_LCD, &ldp_lcd_config },
> +static struct omap_dss_board_info ldp_dss_data = {
> + .num_devices = ARRAY_SIZE(ldp_dss_devices),
> + .devices = ldp_dss_devices,
> + .default_device = &ldp_lcd_device,
> };
>
> +static void __init ldp_display_init(void)
> +{
> + int r;
> +
> + static struct gpio gpios[] __initdata = {
> + {LCD_PANEL_RESET_GPIO, GPIOF_OUT_INIT_HIGH, "LCD RESET"},
> + {LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, "LCD QVGA"},
> + };
> +
> + r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
> + if (r) {
> + pr_err("Cannot request LCD GPIOs, error %d\n", r);
> + return;
> + }
> +
> + omap_display_init(&ldp_dss_data);
> +}
> +
> static void __init omap_ldp_init_early(void)
> {
> omap2_init_common_infrastructure();
> @@ -298,10 +352,30 @@ static struct twl4030_usb_data ldp_usb_data = {
> .usb_mode = T2_USB_MODE_ULPI,
> };
>
> +static int ldp_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio)
> +{
> + int r;
> +
> + struct gpio gpios[] = {
> + {gpio + 7 , GPIOF_OUT_INIT_LOW, "LCD ENABLE"},
> + {gpio + 15, GPIOF_OUT_INIT_LOW, "LCD BACKLIGHT"},
> + };
> +
> + r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
> + if (r)
> + pr_err("Cannot request LCD GPIOs, error %d\n", r);
> +
> + ldp_backlight_gpio = gpio + 15;
> + ldp_lcd_enable_gpio = gpio + 7;
If the gpio_request_array() fails (though it shouldn't),
won't it be right to set both variables to -EINVAL?
Other then that, you can have my
Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Thanks for bringing this all together.
--
Regards,
Igor.
^ permalink raw reply [flat|nested] 34+ messages in thread
* RE: [PATCH 4/6] OMAP: LDP: Port the display driver to new DSS2
2011-05-16 8:53 ` Tomi Valkeinen
2011-05-16 11:13 ` Igor Grinberg
@ 2011-05-16 11:26 ` Janorkar, Mayuresh
2011-05-17 11:44 ` Tomi Valkeinen
1 sibling, 1 reply; 34+ messages in thread
From: Janorkar, Mayuresh @ 2011-05-16 11:26 UTC (permalink / raw)
To: Valkeinen, Tomi, Igor Grinberg
Cc: tony@atomide.com, linux-omap@vger.kernel.org, Stanley Miao
> -----Original Message-----
> From: Valkeinen, Tomi
> Sent: Monday, May 16, 2011 2:23 PM
> To: Igor Grinberg
> Cc: Janorkar, Mayuresh; tony@atomide.com; linux-omap@vger.kernel.org;
> Stanley Miao
> Subject: Re: [PATCH 4/6] OMAP: LDP: Port the display driver to new DSS2
>
> On Thu, 2011-05-12 at 09:40 +0300, Igor Grinberg wrote:
> >
> > On 05/11/11 09:32, Tomi Valkeinen wrote:
> >
> > > On Wed, 2011-05-11 at 10:28 +0530, Janorkar, Mayuresh wrote:
> > >
> > >>> +static void __init ldp_display_init(void)
> > >>> +{
> > >>> + int r;
> > >>> +
> > >>> + struct gpio gpios[] = {
> > >>> + {LCD_PANEL_RESET_GPIO, GPIOF_OUT_INIT_HIGH, "LCD
> RESET"},
> > >>> + {LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, "LCD QVGA"},
> > >>> + {LCD_PANEL_ENABLE_GPIO, GPIOF_OUT_INIT_LOW, "LCD
> ENABLE"},
> > >>> + {LCD_PANEL_BACKLIGHT_GPIO, GPIOF_OUT_INIT_LOW, "LCD
> > >>> BACKLIGHT"},
> > >>> + };
> > >>> +
> > >>> + r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
> > >>> + if (r) {
> > >>> + pr_err("Cannot request LCD GPIOs, error %d\n", r);
> > >>> + return;
> > >>> + }
> > >> If I test with this patch, this request is returning error.
> > > Hmm. Well, the GPIOs are the same as in the old driver. However, the
> old
> > > driver doesn't even seem to check if it manages to request the GPIOs,
> so
> > > it may well be that it was failing also.
> > >
> > > Can you check from /sys/class/gpio/ if some of the GPIOs are already
> > > allocated: 207, 199, 55, 56?
> > >
> > > The definition of two of those GPIOs look kinda funny to me: (15 +
> > > OMAP_MAX_GPIO_LINES). I don't know what OMAP_MAX_GPIO_LINES means, but
> > > it sure doesn't sound ok to have a GPIO number that is 15 over the
> > > maximum =).
> > >
> >
> > This means that some kind of gpio expander is used.
> > I bet those are twl gpios (or may be some other discrete chip).
> > If those are twl gpios then you need to provide the .setup callback
> > in struct twl4030_gpio_platform_data which will request and setup those
> gpios.
>
> Here's an updated patch with the twl gpio code.
>
> All the old omapfb porting patches, including new drivers for DSS2, can
> be found from
>
> git://gitorious.org/linux-omap-dss2/linux.git old-omapfb-port
>
> Tomi
>
> diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-
> ldp.c
> index e2ba779..ed78b9a 100644
> --- a/arch/arm/mach-omap2/board-ldp.c
> +++ b/arch/arm/mach-omap2/board-ldp.c
> @@ -44,6 +44,9 @@
> #include <asm/delay.h>
> #include <plat/usb.h>
>
> +#include <video/omapdss.h>
> +#include <video/omap-panel-generic-dpi.h>
> +
> #include "board-flash.h"
> #include "mux.h"
> #include "hsmmc.h"
> @@ -275,19 +278,70 @@ static inline void __init ldp_init_smsc911x(void)
> gpio_direction_input(eth_gpio);
> }
>
> -static struct platform_device ldp_lcd_device = {
> - .name = "ldp_lcd",
> - .id = -1,
> +/* LCD */
> +
> +static int ldp_backlight_gpio;
> +static int ldp_lcd_enable_gpio;
> +
> +#define LCD_PANEL_RESET_GPIO 55
> +#define LCD_PANEL_QVGA_GPIO 56
> +
> +static int ldp_panel_enable_lcd(struct omap_dss_device *dssdev)
> +{
> + gpio_direction_output(ldp_lcd_enable_gpio, 1);
> + gpio_direction_output(ldp_backlight_gpio, 1);
> +
> + return 0;
> +}
> +
> +static void ldp_panel_disable_lcd(struct omap_dss_device *dssdev)
> +{
> + gpio_direction_output(ldp_lcd_enable_gpio, 0);
> + gpio_direction_output(ldp_backlight_gpio, 0);
> +}
> +
> +static struct panel_generic_dpi_data ldp_panel_data = {
> + .name = "2430sdp",
> + .platform_enable = ldp_panel_enable_lcd,
> + .platform_disable = ldp_panel_disable_lcd,
> +};
> +
> +static struct omap_dss_device ldp_lcd_device = {
> + .name = "lcd",
> + .driver_name = "generic_dpi_panel",
> + .type = OMAP_DISPLAY_TYPE_DPI,
> + .phy.dpi.data_lines = 16,
>From a working DSS code at:
http://lxr.linux.no/#linux+v2.6.38/drivers/video/omap/lcd_ldp.c
.data_lines should be 18
> + .data = &ldp_panel_data,
> };
>
> -static struct omap_lcd_config ldp_lcd_config __initdata = {
> - .ctrl_name = "internal",
> +static struct omap_dss_device *ldp_dss_devices[] = {
> + &ldp_lcd_device,
> };
>
> -static struct omap_board_config_kernel ldp_config[] __initdata = {
> - { OMAP_TAG_LCD, &ldp_lcd_config },
> +static struct omap_dss_board_info ldp_dss_data = {
> + .num_devices = ARRAY_SIZE(ldp_dss_devices),
> + .devices = ldp_dss_devices,
> + .default_device = &ldp_lcd_device,
> };
>
> +static void __init ldp_display_init(void)
> +{
> + int r;
> +
> + static struct gpio gpios[] __initdata = {
> + {LCD_PANEL_RESET_GPIO, GPIOF_OUT_INIT_HIGH, "LCD RESET"},
> + {LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, "LCD QVGA"},
> + };
> +
> + r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
> + if (r) {
> + pr_err("Cannot request LCD GPIOs, error %d\n", r);
> + return;
> + }
> +
> + omap_display_init(&ldp_dss_data);
> +}
> +
> static void __init omap_ldp_init_early(void)
> {
> omap2_init_common_infrastructure();
> @@ -298,10 +352,30 @@ static struct twl4030_usb_data ldp_usb_data = {
> .usb_mode = T2_USB_MODE_ULPI,
> };
>
> +static int ldp_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned
> ngpio)
> +{
> + int r;
> +
> + struct gpio gpios[] = {
> + {gpio + 7 , GPIOF_OUT_INIT_LOW, "LCD ENABLE"},
> + {gpio + 15, GPIOF_OUT_INIT_LOW, "LCD BACKLIGHT"},
> + };
> +
> + r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
> + if (r)
> + pr_err("Cannot request LCD GPIOs, error %d\n", r);
> +
> + ldp_backlight_gpio = gpio + 15;
> + ldp_lcd_enable_gpio = gpio + 7;
> +
> + return r;
> +}
> +
> static struct twl4030_gpio_platform_data ldp_gpio_data = {
> .gpio_base = OMAP_MAX_GPIO_LINES,
> .irq_base = TWL4030_GPIO_IRQ_BASE,
> .irq_end = TWL4030_GPIO_IRQ_END,
> + .setup = ldp_twl_gpio_setup,
> };
>
> static struct twl4030_madc_platform_data ldp_madc_data = {
> @@ -347,6 +421,26 @@ static struct regulator_init_data ldp_vaux1 = {
> .consumer_supplies = ldp_vaux1_supplies,
> };
>
> +static struct regulator_consumer_supply ldp_vpll2_supplies[] = {
> + REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
> + REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"),
> +};
> +
> +static struct regulator_init_data ldp_vpll2 = {
> + .constraints = {
> + .name = "VDVI",
> + .min_uV = 1800000,
> + .max_uV = 1800000,
> + .apply_uV = true,
> + .valid_modes_mask = REGULATOR_MODE_NORMAL
> + | REGULATOR_MODE_STANDBY,
> + .valid_ops_mask = REGULATOR_CHANGE_MODE
> + | REGULATOR_CHANGE_STATUS,
> + },
> + .num_consumer_supplies = ARRAY_SIZE(ldp_vpll2_supplies),
> + .consumer_supplies = ldp_vpll2_supplies,
> +};
> +
> static struct twl4030_platform_data ldp_twldata = {
> .irq_base = TWL4030_IRQ_BASE,
> .irq_end = TWL4030_IRQ_END,
> @@ -356,6 +450,7 @@ static struct twl4030_platform_data ldp_twldata = {
> .usb = &ldp_usb_data,
> .vmmc1 = &ldp_vmmc1,
> .vaux1 = &ldp_vaux1,
> + .vpll2 = &ldp_vpll2,
> .gpio = &ldp_gpio_data,
> .keypad = &ldp_kp_twl4030_data,
> };
> @@ -390,7 +485,6 @@ static struct omap2_hsmmc_info mmc[] __initdata = {
>
> static struct platform_device *ldp_devices[] __initdata = {
> &ldp_smsc911x_device,
> - &ldp_lcd_device,
> &ldp_gpio_keys_device,
> };
>
> @@ -441,8 +535,6 @@ static struct mtd_partition ldp_nand_partitions[] = {
> static void __init omap_ldp_init(void)
> {
> omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
> - omap_board_config = ldp_config;
> - omap_board_config_size = ARRAY_SIZE(ldp_config);
> ldp_init_smsc911x();
> omap_i2c_init();
> platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices));
> @@ -459,6 +551,8 @@ static void __init omap_ldp_init(void)
> omap2_hsmmc_init(mmc);
> /* link regulators to MMC adapters */
> ldp_vmmc1_supply.dev = mmc[0].dev;
> +
> + ldp_display_init();
> }
>
> MACHINE_START(OMAP_LDP, "OMAP LDP board")
>
>
>
^ permalink raw reply [flat|nested] 34+ messages in thread
* RE: [PATCH 4/6] OMAP: LDP: Port the display driver to new DSS2
2011-05-16 11:26 ` Janorkar, Mayuresh
@ 2011-05-17 11:44 ` Tomi Valkeinen
0 siblings, 0 replies; 34+ messages in thread
From: Tomi Valkeinen @ 2011-05-17 11:44 UTC (permalink / raw)
To: Janorkar, Mayuresh
Cc: Igor Grinberg, tony@atomide.com, linux-omap@vger.kernel.org,
Stanley Miao
On Mon, 2011-05-16 at 16:56 +0530, Janorkar, Mayuresh wrote:
>
> > -----Original Message-----
> > From: Valkeinen, Tomi
> > Sent: Monday, May 16, 2011 2:23 PM
> > To: Igor Grinberg
> > Cc: Janorkar, Mayuresh; tony@atomide.com; linux-omap@vger.kernel.org;
> > Stanley Miao
> > Subject: Re: [PATCH 4/6] OMAP: LDP: Port the display driver to new DSS2
> > +static struct omap_dss_device ldp_lcd_device = {
> > + .name = "lcd",
> > + .driver_name = "generic_dpi_panel",
> > + .type = OMAP_DISPLAY_TYPE_DPI,
> > + .phy.dpi.data_lines = 16,
>
> From a working DSS code at:
> http://lxr.linux.no/#linux+v2.6.38/drivers/video/omap/lcd_ldp.c
> .data_lines should be 18
Right, I missed that. Thanks.
Tomi
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 4/6] OMAP: LDP: Port the display driver to new DSS2
2011-05-16 11:13 ` Igor Grinberg
@ 2011-05-17 11:49 ` Tomi Valkeinen
2011-05-17 11:56 ` Tomi Valkeinen
0 siblings, 1 reply; 34+ messages in thread
From: Tomi Valkeinen @ 2011-05-17 11:49 UTC (permalink / raw)
To: Igor Grinberg
Cc: Janorkar, Mayuresh, tony@atomide.com, linux-omap@vger.kernel.org,
Stanley Miao
On Mon, 2011-05-16 at 14:13 +0300, Igor Grinberg wrote:
> On 05/16/11 11:53, Tomi Valkeinen wrote:
>
> > Here's an updated patch with the twl gpio code.
>
> Looks good, though one minor issue below
>
> > All the old omapfb porting patches, including new drivers for DSS2, can
> > be found from
> >
> > git://gitorious.org/linux-omap-dss2/linux.git old-omapfb-port
> >
> > Tomi
> >
> > diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
> > index e2ba779..ed78b9a 100644
> > --- a/arch/arm/mach-omap2/board-ldp.c
> > +++ b/arch/arm/mach-omap2/board-ldp.c
> > @@ -44,6 +44,9 @@
> > #include <asm/delay.h>
> > #include <plat/usb.h>
> >
> > +#include <video/omapdss.h>
> > +#include <video/omap-panel-generic-dpi.h>
> > +
> > #include "board-flash.h"
> > #include "mux.h"
> > #include "hsmmc.h"
> > @@ -275,19 +278,70 @@ static inline void __init ldp_init_smsc911x(void)
> > gpio_direction_input(eth_gpio);
> > }
> >
> > -static struct platform_device ldp_lcd_device = {
> > - .name = "ldp_lcd",
> > - .id = -1,
> > +/* LCD */
> > +
> > +static int ldp_backlight_gpio;
> > +static int ldp_lcd_enable_gpio;
> > +
> > +#define LCD_PANEL_RESET_GPIO 55
> > +#define LCD_PANEL_QVGA_GPIO 56
> > +
> > +static int ldp_panel_enable_lcd(struct omap_dss_device *dssdev)
> > +{
> > + gpio_direction_output(ldp_lcd_enable_gpio, 1);
> > + gpio_direction_output(ldp_backlight_gpio, 1);
> > +
> > + return 0;
> > +}
> > +
> > +static void ldp_panel_disable_lcd(struct omap_dss_device *dssdev)
> > +{
> > + gpio_direction_output(ldp_lcd_enable_gpio, 0);
> > + gpio_direction_output(ldp_backlight_gpio, 0);
> > +}
> > +
> > +static struct panel_generic_dpi_data ldp_panel_data = {
> > + .name = "2430sdp",
> > + .platform_enable = ldp_panel_enable_lcd,
> > + .platform_disable = ldp_panel_disable_lcd,
> > +};
> > +
> > +static struct omap_dss_device ldp_lcd_device = {
> > + .name = "lcd",
> > + .driver_name = "generic_dpi_panel",
> > + .type = OMAP_DISPLAY_TYPE_DPI,
> > + .phy.dpi.data_lines = 16,
> > + .data = &ldp_panel_data,
> > };
> >
> > -static struct omap_lcd_config ldp_lcd_config __initdata = {
> > - .ctrl_name = "internal",
> > +static struct omap_dss_device *ldp_dss_devices[] = {
> > + &ldp_lcd_device,
> > };
> >
> > -static struct omap_board_config_kernel ldp_config[] __initdata = {
> > - { OMAP_TAG_LCD, &ldp_lcd_config },
> > +static struct omap_dss_board_info ldp_dss_data = {
> > + .num_devices = ARRAY_SIZE(ldp_dss_devices),
> > + .devices = ldp_dss_devices,
> > + .default_device = &ldp_lcd_device,
> > };
> >
> > +static void __init ldp_display_init(void)
> > +{
> > + int r;
> > +
> > + static struct gpio gpios[] __initdata = {
> > + {LCD_PANEL_RESET_GPIO, GPIOF_OUT_INIT_HIGH, "LCD RESET"},
> > + {LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, "LCD QVGA"},
> > + };
> > +
> > + r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
> > + if (r) {
> > + pr_err("Cannot request LCD GPIOs, error %d\n", r);
> > + return;
> > + }
> > +
> > + omap_display_init(&ldp_dss_data);
> > +}
> > +
> > static void __init omap_ldp_init_early(void)
> > {
> > omap2_init_common_infrastructure();
> > @@ -298,10 +352,30 @@ static struct twl4030_usb_data ldp_usb_data = {
> > .usb_mode = T2_USB_MODE_ULPI,
> > };
> >
> > +static int ldp_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio)
> > +{
> > + int r;
> > +
> > + struct gpio gpios[] = {
> > + {gpio + 7 , GPIOF_OUT_INIT_LOW, "LCD ENABLE"},
> > + {gpio + 15, GPIOF_OUT_INIT_LOW, "LCD BACKLIGHT"},
> > + };
> > +
> > + r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
> > + if (r)
> > + pr_err("Cannot request LCD GPIOs, error %d\n", r);
> > +
> > + ldp_backlight_gpio = gpio + 15;
> > + ldp_lcd_enable_gpio = gpio + 7;
>
> If the gpio_request_array() fails (though it shouldn't),
> won't it be right to set both variables to -EINVAL?
Ah, yes. I'll fix that.
Do you know what will happen if twl_gpio_setup fails? Just an error
print, or will TWL driver fail?
> Thanks for bringing this all together.
We still don't know if it works or not =).
Tomi
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 4/6] OMAP: LDP: Port the display driver to new DSS2
2011-05-17 11:49 ` Tomi Valkeinen
@ 2011-05-17 11:56 ` Tomi Valkeinen
2011-05-17 12:28 ` Igor Grinberg
0 siblings, 1 reply; 34+ messages in thread
From: Tomi Valkeinen @ 2011-05-17 11:56 UTC (permalink / raw)
To: Igor Grinberg
Cc: Janorkar, Mayuresh, tony@atomide.com, linux-omap@vger.kernel.org,
Stanley Miao
On Tue, 2011-05-17 at 14:49 +0300, Tomi Valkeinen wrote:
> On Mon, 2011-05-16 at 14:13 +0300, Igor Grinberg wrote:
> > On 05/16/11 11:53, Tomi Valkeinen wrote:
> > > +static int ldp_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio)
> > > +{
> > > + int r;
> > > +
> > > + struct gpio gpios[] = {
> > > + {gpio + 7 , GPIOF_OUT_INIT_LOW, "LCD ENABLE"},
> > > + {gpio + 15, GPIOF_OUT_INIT_LOW, "LCD BACKLIGHT"},
> > > + };
> > > +
> > > + r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
> > > + if (r)
> > > + pr_err("Cannot request LCD GPIOs, error %d\n", r);
> > > +
> > > + ldp_backlight_gpio = gpio + 15;
> > > + ldp_lcd_enable_gpio = gpio + 7;
> >
> > If the gpio_request_array() fails (though it shouldn't),
> > won't it be right to set both variables to -EINVAL?
>
> Ah, yes. I'll fix that.
>
> Do you know what will happen if twl_gpio_setup fails? Just an error
> print, or will TWL driver fail?
And I wonder if gpio_is_valid() works correctly for GPIOs from an gpio
expander? With a quick search, gpio_is_valid returns true if gpio is
between [0, 256[, and doesn't care if there are gpio expanders or not...
Tomi
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 4/6] OMAP: LDP: Port the display driver to new DSS2
2011-05-17 11:56 ` Tomi Valkeinen
@ 2011-05-17 12:28 ` Igor Grinberg
2011-05-17 13:16 ` Tomi Valkeinen
0 siblings, 1 reply; 34+ messages in thread
From: Igor Grinberg @ 2011-05-17 12:28 UTC (permalink / raw)
To: Tomi Valkeinen
Cc: Janorkar, Mayuresh, tony@atomide.com, linux-omap@vger.kernel.org,
Stanley Miao
On 05/17/11 14:56, Tomi Valkeinen wrote:
> On Tue, 2011-05-17 at 14:49 +0300, Tomi Valkeinen wrote:
>> On Mon, 2011-05-16 at 14:13 +0300, Igor Grinberg wrote:
>>> On 05/16/11 11:53, Tomi Valkeinen wrote:
>>>> +static int ldp_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio)
>>>> +{
>>>> + int r;
>>>> +
>>>> + struct gpio gpios[] = {
>>>> + {gpio + 7 , GPIOF_OUT_INIT_LOW, "LCD ENABLE"},
>>>> + {gpio + 15, GPIOF_OUT_INIT_LOW, "LCD BACKLIGHT"},
>>>> + };
>>>> +
>>>> + r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
>>>> + if (r)
>>>> + pr_err("Cannot request LCD GPIOs, error %d\n", r);
>>>> +
>>>> + ldp_backlight_gpio = gpio + 15;
>>>> + ldp_lcd_enable_gpio = gpio + 7;
>>> If the gpio_request_array() fails (though it shouldn't),
>>> won't it be right to set both variables to -EINVAL?
>> Ah, yes. I'll fix that.
>>
>> Do you know what will happen if twl_gpio_setup fails? Just an error
>> print, or will TWL driver fail?
I'm currently based on Tony's devel-cleanup branch (which is v2.6.39-rc4-...)
this is what twl4030-gpio.c does:
status = pdata->setup(&pdev->dev,
pdata->gpio_base, TWL4030_GPIO_MAX);
if (status)
dev_dbg(&pdev->dev, "setup --> %d\n", status);
so yes it is just an error print.
> And I wonder if gpio_is_valid() works correctly for GPIOs from an gpio
> expander? With a quick search, gpio_is_valid returns true if gpio is
> between [0, 256[, and doesn't care if there are gpio expanders or not...
Right, a sanity check only...
I guess each time 256 is not enough it just gets bumped up...
This can be a problem some day...
May be it should be a part of struct gpio_chip so the responsibility for
gpio validity will be on the driver in charge of that gpio?
But that is totally different discussion.
Regarding:
> We still don't know if it works or not =).
I thought Mayuresh checked this and confirmed, no?
--
Regards,
Igor.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 4/6] OMAP: LDP: Port the display driver to new DSS2
2011-05-17 12:28 ` Igor Grinberg
@ 2011-05-17 13:16 ` Tomi Valkeinen
0 siblings, 0 replies; 34+ messages in thread
From: Tomi Valkeinen @ 2011-05-17 13:16 UTC (permalink / raw)
To: Igor Grinberg
Cc: Janorkar, Mayuresh, tony@atomide.com, linux-omap@vger.kernel.org,
Stanley Miao
On Tue, 2011-05-17 at 15:28 +0300, Igor Grinberg wrote:
> On 05/17/11 14:56, Tomi Valkeinen wrote:
> > We still don't know if it works or not =).
>
> I thought Mayuresh checked this and confirmed, no?
No, as far as I understood he tried with the patch he attached, which
was something very different than this patch.
Tomi
^ permalink raw reply [flat|nested] 34+ messages in thread
end of thread, other threads:[~2011-05-17 13:16 UTC | newest]
Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-09 7:36 [PATCH 0/6] OMAP: board file changes for DSS2 porting Tomi Valkeinen
2011-05-09 7:36 ` [PATCH 1/6] OMAP: RX51: Remove unused old omapfb stuff Tomi Valkeinen
2011-05-09 7:36 ` [PATCH 2/6] OMAP: omap3touchbook: Remove unused lcd stuff Tomi Valkeinen
2011-05-09 7:36 ` [PATCH 3/6] OMAP: 2420SDP: Port the display driver to new DSS2 Tomi Valkeinen
2011-05-09 8:21 ` Igor Grinberg
2011-05-09 16:57 ` Tomi Valkeinen
2011-05-09 7:36 ` [PATCH 4/6] OMAP: LDP: " Tomi Valkeinen
2011-05-09 8:08 ` stanley.miao
2011-05-11 4:58 ` Janorkar, Mayuresh
2011-05-11 6:32 ` Tomi Valkeinen
2011-05-12 6:40 ` Igor Grinberg
2011-05-12 7:16 ` Igor Grinberg
2011-05-12 8:38 ` Igor Grinberg
2011-05-12 8:47 ` Janorkar, Mayuresh
2011-05-12 11:20 ` Igor Grinberg
2011-05-12 11:47 ` Tomi Valkeinen
2011-05-12 14:36 ` Janorkar, Mayuresh
2011-05-12 14:47 ` Tomi Valkeinen
2011-05-12 14:50 ` Janorkar, Mayuresh
2011-05-12 14:59 ` Tomi Valkeinen
2011-05-16 8:53 ` Tomi Valkeinen
2011-05-16 11:13 ` Igor Grinberg
2011-05-17 11:49 ` Tomi Valkeinen
2011-05-17 11:56 ` Tomi Valkeinen
2011-05-17 12:28 ` Igor Grinberg
2011-05-17 13:16 ` Tomi Valkeinen
2011-05-16 11:26 ` Janorkar, Mayuresh
2011-05-17 11:44 ` Tomi Valkeinen
2011-05-09 7:36 ` [PATCH 5/6] OMAP: H4: " Tomi Valkeinen
2011-05-09 7:36 ` [PATCH 6/6] OMAP: Apollon: " Tomi Valkeinen
2011-05-09 17:01 ` [PATCH 0/6] OMAP: board file changes for DSS2 porting Tomi Valkeinen
2011-05-10 13:35 ` Tony Lindgren
2011-05-10 14:03 ` Tomi Valkeinen
2011-05-11 7:08 ` Tony Lindgren
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).