aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/board-omap3evm.c
diff options
context:
space:
mode:
authorVaibhav Hiremath <hvaibhav@ti.com>2010-01-04 09:34:16 -0500
committerTomi Valkeinen <tomi.valkeinen@nokia.com>2010-02-12 05:28:09 -0500
commit703e3061a043a7b87df2460044666d68394bdb69 (patch)
tree85b53a7bf50f253d915d0af631cea36f69120247 /arch/arm/mach-omap2/board-omap3evm.c
parent29275254caedfedce960cfe6df24b90cb04fe431 (diff)
OMAP: Enable DSS2 for OMAP3EVM board
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com> [tomi.valkeinen@nokia.com: removed evm defconfig changes] Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Diffstat (limited to 'arch/arm/mach-omap2/board-omap3evm.c')
-rw-r--r--arch/arm/mach-omap2/board-omap3evm.c246
1 files changed, 235 insertions, 11 deletions
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index 34de17851572..822df79ce891 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -41,6 +41,7 @@
41#include <plat/usb.h> 41#include <plat/usb.h>
42#include <plat/common.h> 42#include <plat/common.h>
43#include <plat/mcspi.h> 43#include <plat/mcspi.h>
44#include <plat/display.h>
44 45
45#include "mux.h" 46#include "mux.h"
46#include "sdram-micron-mt46h32m32lf-6.h" 47#include "sdram-micron-mt46h32m32lf-6.h"
@@ -147,6 +148,187 @@ static inline void __init omap3evm_init_smsc911x(void)
147static inline void __init omap3evm_init_smsc911x(void) { return; } 148static inline void __init omap3evm_init_smsc911x(void) { return; }
148#endif 149#endif
149 150
151/*
152 * OMAP3EVM LCD Panel control signals
153 */
154#define OMAP3EVM_LCD_PANEL_LR 2
155#define OMAP3EVM_LCD_PANEL_UD 3
156#define OMAP3EVM_LCD_PANEL_INI 152
157#define OMAP3EVM_LCD_PANEL_ENVDD 153
158#define OMAP3EVM_LCD_PANEL_QVGA 154
159#define OMAP3EVM_LCD_PANEL_RESB 155
160#define OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO 210
161#define OMAP3EVM_DVI_PANEL_EN_GPIO 199
162
163static int lcd_enabled;
164static int dvi_enabled;
165
166static void __init omap3_evm_display_init(void)
167{
168 int r;
169
170 r = gpio_request(OMAP3EVM_LCD_PANEL_RESB, "lcd_panel_resb");
171 if (r) {
172 printk(KERN_ERR "failed to get lcd_panel_resb\n");
173 return;
174 }
175 gpio_direction_output(OMAP3EVM_LCD_PANEL_RESB, 1);
176
177 r = gpio_request(OMAP3EVM_LCD_PANEL_INI, "lcd_panel_ini");
178 if (r) {
179 printk(KERN_ERR "failed to get lcd_panel_ini\n");
180 goto err_1;
181 }
182 gpio_direction_output(OMAP3EVM_LCD_PANEL_INI, 1);
183
184 r = gpio_request(OMAP3EVM_LCD_PANEL_QVGA, "lcd_panel_qvga");
185 if (r) {
186 printk(KERN_ERR "failed to get lcd_panel_qvga\n");
187 goto err_2;
188 }
189 gpio_direction_output(OMAP3EVM_LCD_PANEL_QVGA, 0);
190
191 r = gpio_request(OMAP3EVM_LCD_PANEL_LR, "lcd_panel_lr");
192 if (r) {
193 printk(KERN_ERR "failed to get lcd_panel_lr\n");
194 goto err_3;
195 }
196 gpio_direction_output(OMAP3EVM_LCD_PANEL_LR, 1);
197
198 r = gpio_request(OMAP3EVM_LCD_PANEL_UD, "lcd_panel_ud");
199 if (r) {
200 printk(KERN_ERR "failed to get lcd_panel_ud\n");
201 goto err_4;
202 }
203 gpio_direction_output(OMAP3EVM_LCD_PANEL_UD, 1);
204
205 r = gpio_request(OMAP3EVM_LCD_PANEL_ENVDD, "lcd_panel_envdd");
206 if (r) {
207 printk(KERN_ERR "failed to get lcd_panel_envdd\n");
208 goto err_5;
209 }
210 gpio_direction_output(OMAP3EVM_LCD_PANEL_ENVDD, 0);
211
212 return;
213
214err_5:
215 gpio_free(OMAP3EVM_LCD_PANEL_UD);
216err_4:
217 gpio_free(OMAP3EVM_LCD_PANEL_LR);
218err_3:
219 gpio_free(OMAP3EVM_LCD_PANEL_QVGA);
220err_2:
221 gpio_free(OMAP3EVM_LCD_PANEL_INI);
222err_1:
223 gpio_free(OMAP3EVM_LCD_PANEL_RESB);
224
225}
226
227static int omap3_evm_enable_lcd(struct omap_dss_device *dssdev)
228{
229 if (dvi_enabled) {
230 printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
231 return -EINVAL;
232 }
233 gpio_set_value(OMAP3EVM_LCD_PANEL_ENVDD, 0);
234
235 if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2)
236 gpio_set_value(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0);
237 else
238 gpio_set_value(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1);
239
240 lcd_enabled = 1;
241 return 0;
242}
243
244static void omap3_evm_disable_lcd(struct omap_dss_device *dssdev)
245{
246 gpio_set_value(OMAP3EVM_LCD_PANEL_ENVDD, 1);
247
248 if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2)
249 gpio_set_value(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1);
250 else
251 gpio_set_value(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0);
252
253 lcd_enabled = 0;
254}
255
256static struct omap_dss_device omap3_evm_lcd_device = {
257 .name = "lcd",
258 .driver_name = "sharp_ls_panel",
259 .type = OMAP_DISPLAY_TYPE_DPI,
260 .phy.dpi.data_lines = 18,
261 .platform_enable = omap3_evm_enable_lcd,
262 .platform_disable = omap3_evm_disable_lcd,
263};
264
265static int omap3_evm_enable_tv(struct omap_dss_device *dssdev)
266{
267 return 0;
268}
269
270static void omap3_evm_disable_tv(struct omap_dss_device *dssdev)
271{
272}
273
274static struct omap_dss_device omap3_evm_tv_device = {
275 .name = "tv",
276 .driver_name = "venc",
277 .type = OMAP_DISPLAY_TYPE_VENC,
278 .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
279 .platform_enable = omap3_evm_enable_tv,
280 .platform_disable = omap3_evm_disable_tv,
281};
282
283static int omap3_evm_enable_dvi(struct omap_dss_device *dssdev)
284{
285 if (lcd_enabled) {
286 printk(KERN_ERR "cannot enable DVI, LCD is enabled\n");
287 return -EINVAL;
288 }
289
290 gpio_set_value(OMAP3EVM_DVI_PANEL_EN_GPIO, 1);
291
292 dvi_enabled = 1;
293 return 0;
294}
295
296static void omap3_evm_disable_dvi(struct omap_dss_device *dssdev)
297{
298 gpio_set_value(OMAP3EVM_DVI_PANEL_EN_GPIO, 0);
299
300 dvi_enabled = 0;
301}
302
303static struct omap_dss_device omap3_evm_dvi_device = {
304 .name = "dvi",
305 .driver_name = "generic_panel",
306 .type = OMAP_DISPLAY_TYPE_DPI,
307 .phy.dpi.data_lines = 24,
308 .platform_enable = omap3_evm_enable_dvi,
309 .platform_disable = omap3_evm_disable_dvi,
310};
311
312static struct omap_dss_device *omap3_evm_dss_devices[] = {
313 &omap3_evm_lcd_device,
314 &omap3_evm_tv_device,
315 &omap3_evm_dvi_device,
316};
317
318static struct omap_dss_board_info omap3_evm_dss_data = {
319 .num_devices = ARRAY_SIZE(omap3_evm_dss_devices),
320 .devices = omap3_evm_dss_devices,
321 .default_device = &omap3_evm_lcd_device,
322};
323
324static struct platform_device omap3_evm_dss_device = {
325 .name = "omapdss",
326 .id = -1,
327 .dev = {
328 .platform_data = &omap3_evm_dss_data,
329 },
330};
331
150static struct regulator_consumer_supply omap3evm_vmmc1_supply = { 332static struct regulator_consumer_supply omap3evm_vmmc1_supply = {
151 .supply = "vmmc", 333 .supply = "vmmc",
152}; 334};
@@ -236,6 +418,14 @@ static int omap3evm_twl_gpio_setup(struct device *dev,
236 * the P2 connector; notably LEDA for the LCD backlight. 418 * the P2 connector; notably LEDA for the LCD backlight.
237 */ 419 */
238 420
421 /* TWL4030_GPIO_MAX + 0 == ledA, LCD Backlight control */
422 gpio_request(gpio + TWL4030_GPIO_MAX, "EN_LCD_BKL");
423 gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0);
424
425 /* gpio + 7 == DVI Enable */
426 gpio_request(gpio + 7, "EN_DVI");
427 gpio_direction_output(gpio + 7, 0);
428
239 /* TWL4030_GPIO_MAX + 1 == ledB (out, active low LED) */ 429 /* TWL4030_GPIO_MAX + 1 == ledB (out, active low LED) */
240 gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; 430 gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
241 431
@@ -300,6 +490,47 @@ static struct twl4030_codec_data omap3evm_codec_data = {
300 .audio = &omap3evm_audio_data, 490 .audio = &omap3evm_audio_data,
301}; 491};
302 492
493static struct regulator_consumer_supply omap3_evm_vdda_dac_supply = {
494 .supply = "vdda_dac",
495 .dev = &omap3_evm_dss_device.dev,
496};
497
498/* VDAC for DSS driving S-Video */
499static struct regulator_init_data omap3_evm_vdac = {
500 .constraints = {
501 .min_uV = 1800000,
502 .max_uV = 1800000,
503 .apply_uV = true,
504 .valid_modes_mask = REGULATOR_MODE_NORMAL
505 | REGULATOR_MODE_STANDBY,
506 .valid_ops_mask = REGULATOR_CHANGE_MODE
507 | REGULATOR_CHANGE_STATUS,
508 },
509 .num_consumer_supplies = 1,
510 .consumer_supplies = &omap3_evm_vdda_dac_supply,
511};
512
513/* VPLL2 for digital video outputs */
514static struct regulator_consumer_supply omap3_evm_vpll2_supply = {
515 .supply = "vdvi",
516 .dev = &omap3_evm_lcd_device.dev,
517};
518
519static struct regulator_init_data omap3_evm_vpll2 = {
520 .constraints = {
521 .name = "VDVI",
522 .min_uV = 1800000,
523 .max_uV = 1800000,
524 .apply_uV = true,
525 .valid_modes_mask = REGULATOR_MODE_NORMAL
526 | REGULATOR_MODE_STANDBY,
527 .valid_ops_mask = REGULATOR_CHANGE_MODE
528 | REGULATOR_CHANGE_STATUS,
529 },
530 .num_consumer_supplies = 1,
531 .consumer_supplies = &omap3_evm_vpll2_supply,
532};
533
303static struct twl4030_platform_data omap3evm_twldata = { 534static struct twl4030_platform_data omap3evm_twldata = {
304 .irq_base = TWL4030_IRQ_BASE, 535 .irq_base = TWL4030_IRQ_BASE,
305 .irq_end = TWL4030_IRQ_END, 536 .irq_end = TWL4030_IRQ_END,
@@ -310,6 +541,8 @@ static struct twl4030_platform_data omap3evm_twldata = {
310 .usb = &omap3evm_usb_data, 541 .usb = &omap3evm_usb_data,
311 .gpio = &omap3evm_gpio_data, 542 .gpio = &omap3evm_gpio_data,
312 .codec = &omap3evm_codec_data, 543 .codec = &omap3evm_codec_data,
544 .vdac = &omap3_evm_vdac,
545 .vpll2 = &omap3_evm_vpll2,
313}; 546};
314 547
315static struct i2c_board_info __initdata omap3evm_i2c_boardinfo[] = { 548static struct i2c_board_info __initdata omap3evm_i2c_boardinfo[] = {
@@ -337,15 +570,6 @@ static int __init omap3_evm_i2c_init(void)
337 return 0; 570 return 0;
338} 571}
339 572
340static struct platform_device omap3_evm_lcd_device = {
341 .name = "omap3evm_lcd",
342 .id = -1,
343};
344
345static struct omap_lcd_config omap3_evm_lcd_config __initdata = {
346 .ctrl_name = "internal",
347};
348
349static void ads7846_dev_init(void) 573static void ads7846_dev_init(void)
350{ 574{
351 if (gpio_request(OMAP3_EVM_TS_GPIO, "ADS7846 pendown") < 0) 575 if (gpio_request(OMAP3_EVM_TS_GPIO, "ADS7846 pendown") < 0)
@@ -393,7 +617,6 @@ struct spi_board_info omap3evm_spi_board_info[] = {
393}; 617};
394 618
395static struct omap_board_config_kernel omap3_evm_config[] __initdata = { 619static struct omap_board_config_kernel omap3_evm_config[] __initdata = {
396 { OMAP_TAG_LCD, &omap3_evm_lcd_config },
397}; 620};
398 621
399static void __init omap3_evm_init_irq(void) 622static void __init omap3_evm_init_irq(void)
@@ -406,7 +629,7 @@ static void __init omap3_evm_init_irq(void)
406} 629}
407 630
408static struct platform_device *omap3_evm_devices[] __initdata = { 631static struct platform_device *omap3_evm_devices[] __initdata = {
409 &omap3_evm_lcd_device, 632 &omap3_evm_dss_device,
410}; 633};
411 634
412static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { 635static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
@@ -473,6 +696,7 @@ static void __init omap3_evm_init(void)
473 usb_ehci_init(&ehci_pdata); 696 usb_ehci_init(&ehci_pdata);
474 ads7846_dev_init(); 697 ads7846_dev_init();
475 omap3evm_init_smsc911x(); 698 omap3evm_init_smsc911x();
699 omap3_evm_display_init();
476} 700}
477 701
478static void __init omap3_evm_map_io(void) 702static void __init omap3_evm_map_io(void)