aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVaibhav Hiremath <hvaibhav@ti.com>2010-01-13 06:47:10 -0500
committerTomi Valkeinen <tomi.valkeinen@nokia.com>2010-02-12 05:29:31 -0500
commitc3d33329f400587976613c0224ffa2e266677cfb (patch)
treef2b6e4b990d75fcba1f214f1f669cba20abe6ea0
parent703e3061a043a7b87df2460044666d68394bdb69 (diff)
OMAP: AM3517: Enable DSS2 for AM3517EVM board
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com> [tomi.valkeinen@nokia.com: removed defconfig changes] Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
-rw-r--r--arch/arm/mach-omap2/board-am3517evm.c145
1 files changed, 145 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index b4e6eca0e8a9..54af5f8d8184 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -29,9 +29,151 @@
29#include <plat/board.h> 29#include <plat/board.h>
30#include <plat/common.h> 30#include <plat/common.h>
31#include <plat/usb.h> 31#include <plat/usb.h>
32#include <plat/display.h>
32 33
33#include "mux.h" 34#include "mux.h"
34 35
36#define LCD_PANEL_PWR 176
37#define LCD_PANEL_BKLIGHT_PWR 182
38#define LCD_PANEL_PWM 181
39
40static int lcd_enabled;
41static int dvi_enabled;
42
43static void __init am3517_evm_display_init(void)
44{
45 int r;
46
47 omap_mux_init_gpio(LCD_PANEL_PWR, OMAP_PIN_INPUT_PULLUP);
48 omap_mux_init_gpio(LCD_PANEL_BKLIGHT_PWR, OMAP_PIN_INPUT_PULLDOWN);
49 omap_mux_init_gpio(LCD_PANEL_PWM, OMAP_PIN_INPUT_PULLDOWN);
50 /*
51 * Enable GPIO 182 = LCD Backlight Power
52 */
53 r = gpio_request(LCD_PANEL_BKLIGHT_PWR, "lcd_backlight_pwr");
54 if (r) {
55 printk(KERN_ERR "failed to get lcd_backlight_pwr\n");
56 return;
57 }
58 gpio_direction_output(LCD_PANEL_BKLIGHT_PWR, 1);
59 /*
60 * Enable GPIO 181 = LCD Panel PWM
61 */
62 r = gpio_request(LCD_PANEL_PWM, "lcd_pwm");
63 if (r) {
64 printk(KERN_ERR "failed to get lcd_pwm\n");
65 goto err_1;
66 }
67 gpio_direction_output(LCD_PANEL_PWM, 1);
68 /*
69 * Enable GPIO 176 = LCD Panel Power enable pin
70 */
71 r = gpio_request(LCD_PANEL_PWR, "lcd_panel_pwr");
72 if (r) {
73 printk(KERN_ERR "failed to get lcd_panel_pwr\n");
74 goto err_2;
75 }
76 gpio_direction_output(LCD_PANEL_PWR, 1);
77
78 printk(KERN_INFO "Display initialized successfully\n");
79 return;
80
81err_2:
82 gpio_free(LCD_PANEL_PWM);
83err_1:
84 gpio_free(LCD_PANEL_BKLIGHT_PWR);
85}
86
87static int am3517_evm_panel_enable_lcd(struct omap_dss_device *dssdev)
88{
89 if (dvi_enabled) {
90 printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
91 return -EINVAL;
92 }
93 gpio_set_value(LCD_PANEL_PWR, 1);
94 lcd_enabled = 1;
95
96 return 0;
97}
98
99static void am3517_evm_panel_disable_lcd(struct omap_dss_device *dssdev)
100{
101 gpio_set_value(LCD_PANEL_PWR, 0);
102 lcd_enabled = 0;
103}
104
105static struct omap_dss_device am3517_evm_lcd_device = {
106 .type = OMAP_DISPLAY_TYPE_DPI,
107 .name = "lcd",
108 .driver_name = "sharp_lq_panel",
109 .phy.dpi.data_lines = 16,
110 .platform_enable = am3517_evm_panel_enable_lcd,
111 .platform_disable = am3517_evm_panel_disable_lcd,
112};
113
114static int am3517_evm_panel_enable_tv(struct omap_dss_device *dssdev)
115{
116 return 0;
117}
118
119static void am3517_evm_panel_disable_tv(struct omap_dss_device *dssdev)
120{
121}
122
123static struct omap_dss_device am3517_evm_tv_device = {
124 .type = OMAP_DISPLAY_TYPE_VENC,
125 .name = "tv",
126 .driver_name = "venc",
127 .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
128 .platform_enable = am3517_evm_panel_enable_tv,
129 .platform_disable = am3517_evm_panel_disable_tv,
130};
131
132static int am3517_evm_panel_enable_dvi(struct omap_dss_device *dssdev)
133{
134 if (lcd_enabled) {
135 printk(KERN_ERR "cannot enable DVI, LCD is enabled\n");
136 return -EINVAL;
137 }
138 dvi_enabled = 1;
139
140 return 0;
141}
142
143static void am3517_evm_panel_disable_dvi(struct omap_dss_device *dssdev)
144{
145 dvi_enabled = 0;
146}
147
148static struct omap_dss_device am3517_evm_dvi_device = {
149 .type = OMAP_DISPLAY_TYPE_DPI,
150 .name = "dvi",
151 .driver_name = "generic_panel",
152 .phy.dpi.data_lines = 24,
153 .platform_enable = am3517_evm_panel_enable_dvi,
154 .platform_disable = am3517_evm_panel_disable_dvi,
155};
156
157static struct omap_dss_device *am3517_evm_dss_devices[] = {
158 &am3517_evm_lcd_device,
159 &am3517_evm_tv_device,
160 &am3517_evm_dvi_device,
161};
162
163static struct omap_dss_board_info am3517_evm_dss_data = {
164 .num_devices = ARRAY_SIZE(am3517_evm_dss_devices),
165 .devices = am3517_evm_dss_devices,
166 .default_device = &am3517_evm_lcd_device,
167};
168
169struct platform_device am3517_evm_dss_device = {
170 .name = "omapdss",
171 .id = -1,
172 .dev = {
173 .platform_data = &am3517_evm_dss_data,
174 },
175};
176
35/* 177/*
36 * Board initialization 178 * Board initialization
37 */ 179 */
@@ -39,6 +181,7 @@ static struct omap_board_config_kernel am3517_evm_config[] __initdata = {
39}; 181};
40 182
41static struct platform_device *am3517_evm_devices[] __initdata = { 183static struct platform_device *am3517_evm_devices[] __initdata = {
184 &am3517_evm_dss_device,
42}; 185};
43 186
44static void __init am3517_evm_init_irq(void) 187static void __init am3517_evm_init_irq(void)
@@ -78,6 +221,8 @@ static void __init am3517_evm_init(void)
78 221
79 omap_serial_init(); 222 omap_serial_init();
80 usb_ehci_init(&ehci_pdata); 223 usb_ehci_init(&ehci_pdata);
224 /* DSS */
225 am3517_evm_display_init();
81} 226}
82 227
83static void __init am3517_evm_map_io(void) 228static void __init am3517_evm_map_io(void)