aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2012-09-17 04:01:35 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-04-04 04:50:44 -0400
commit5c4e599510cd519cfb0e172cc5ff139677d9f909 (patch)
tree345651b17472935e534eacda119214a9c7043c69 /arch/arm/mach-omap2
parentfa2a02f26e76a01351b6a51e9152ae2efd088f48 (diff)
arm: omap: board-overo: use lb035q02 dpi panel's gpio handling
The overo board file currently requests gpios required by the lb035q02 panel, and provides platform_enable/disable callbacks to configure them. These tasks have been moved to the lb035q02 dpi panel driver itself and should be removed from the board files. The lb035q02 panel driver uses generic dpi panel's platform data struct internally. Remove the gpio requests and the platform callbacks from the board file. Add the gpio information to the generic dpi panel platform data struct so that it's passed to the panel driver. Signed-off-by: Archit Taneja <archit@ti.com> Cc: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/board-overo.c58
1 files changed, 14 insertions, 44 deletions
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index 630833235cbc..f790ce5aaa34 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -145,28 +145,9 @@ static inline void __init overo_init_smsc911x(void) { return; }
145#endif 145#endif
146 146
147/* DSS */ 147/* DSS */
148static int lcd_enabled;
149static int dvi_enabled;
150
151#define OVERO_GPIO_LCD_EN 144 148#define OVERO_GPIO_LCD_EN 144
152#define OVERO_GPIO_LCD_BL 145 149#define OVERO_GPIO_LCD_BL 145
153 150
154static struct gpio overo_dss_gpios[] __initdata = {
155 { OVERO_GPIO_LCD_EN, GPIOF_OUT_INIT_HIGH, "OVERO_GPIO_LCD_EN" },
156 { OVERO_GPIO_LCD_BL, GPIOF_OUT_INIT_HIGH, "OVERO_GPIO_LCD_BL" },
157};
158
159static void __init overo_display_init(void)
160{
161 if (gpio_request_array(overo_dss_gpios, ARRAY_SIZE(overo_dss_gpios))) {
162 printk(KERN_ERR "could not obtain DSS control GPIOs\n");
163 return;
164 }
165
166 gpio_export(OVERO_GPIO_LCD_EN, 0);
167 gpio_export(OVERO_GPIO_LCD_BL, 0);
168}
169
170static struct tfp410_platform_data dvi_panel = { 151static struct tfp410_platform_data dvi_panel = {
171 .i2c_bus_num = 3, 152 .i2c_bus_num = 3,
172 .power_down_gpio = -1, 153 .power_down_gpio = -1,
@@ -187,30 +168,13 @@ static struct omap_dss_device overo_tv_device = {
187 .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO, 168 .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
188}; 169};
189 170
190static int overo_panel_enable_lcd(struct omap_dss_device *dssdev)
191{
192 if (dvi_enabled) {
193 printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
194 return -EINVAL;
195 }
196
197 gpio_set_value(OVERO_GPIO_LCD_EN, 1);
198 gpio_set_value(OVERO_GPIO_LCD_BL, 1);
199 lcd_enabled = 1;
200 return 0;
201}
202
203static void overo_panel_disable_lcd(struct omap_dss_device *dssdev)
204{
205 gpio_set_value(OVERO_GPIO_LCD_EN, 0);
206 gpio_set_value(OVERO_GPIO_LCD_BL, 0);
207 lcd_enabled = 0;
208}
209
210static struct panel_generic_dpi_data lcd43_panel = { 171static struct panel_generic_dpi_data lcd43_panel = {
211 .name = "samsung_lte430wq_f0c", 172 .name = "samsung_lte430wq_f0c",
212 .platform_enable = overo_panel_enable_lcd, 173 .num_gpios = 2,
213 .platform_disable = overo_panel_disable_lcd, 174 .gpios = {
175 OVERO_GPIO_LCD_EN,
176 OVERO_GPIO_LCD_BL
177 },
214}; 178};
215 179
216static struct omap_dss_device overo_lcd43_device = { 180static struct omap_dss_device overo_lcd43_device = {
@@ -223,13 +187,20 @@ static struct omap_dss_device overo_lcd43_device = {
223 187
224#if defined(CONFIG_PANEL_LGPHILIPS_LB035Q02) || \ 188#if defined(CONFIG_PANEL_LGPHILIPS_LB035Q02) || \
225 defined(CONFIG_PANEL_LGPHILIPS_LB035Q02_MODULE) 189 defined(CONFIG_PANEL_LGPHILIPS_LB035Q02_MODULE)
190static struct panel_generic_dpi_data lcd35_panel = {
191 .num_gpios = 2,
192 .gpios = {
193 OVERO_GPIO_LCD_EN,
194 OVERO_GPIO_LCD_BL
195 },
196};
197
226static struct omap_dss_device overo_lcd35_device = { 198static struct omap_dss_device overo_lcd35_device = {
227 .type = OMAP_DISPLAY_TYPE_DPI, 199 .type = OMAP_DISPLAY_TYPE_DPI,
228 .name = "lcd35", 200 .name = "lcd35",
229 .driver_name = "lgphilips_lb035q02_panel", 201 .driver_name = "lgphilips_lb035q02_panel",
230 .phy.dpi.data_lines = 24, 202 .phy.dpi.data_lines = 24,
231 .platform_enable = overo_panel_enable_lcd, 203 .data = &lcd35_panel,
232 .platform_disable = overo_panel_disable_lcd,
233}; 204};
234#endif 205#endif
235 206
@@ -504,7 +475,6 @@ static void __init overo_init(void)
504 usbhs_init(&usbhs_bdata); 475 usbhs_init(&usbhs_bdata);
505 overo_spi_init(); 476 overo_spi_init();
506 overo_init_smsc911x(); 477 overo_init_smsc911x();
507 overo_display_init();
508 overo_init_led(); 478 overo_init_led();
509 overo_init_keys(); 479 overo_init_keys();
510 omap_twl4030_audio_init("overo", NULL); 480 omap_twl4030_audio_init("overo", NULL);