aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/board-3430sdp.c
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@nokia.com>2009-12-09 11:25:18 -0500
committerTomi Valkeinen <tomi.valkeinen@nokia.com>2009-12-09 11:29:38 -0500
commitd9056ce2af7ed1329b39cebd2a1c52e68d60115a (patch)
treeac9c7b9f8d7897d1a4ea79150d73a01193c8a220 /arch/arm/mach-omap2/board-3430sdp.c
parentf133a9d7f27ebde5c11bb5d7d89ff66576682e65 (diff)
OMAP: SDP: Enable DSS2 for OMAP3 SDP board
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com> Acked-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/board-3430sdp.c')
-rw-r--r--arch/arm/mach-omap2/board-3430sdp.c167
1 files changed, 151 insertions, 16 deletions
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index 491364e44c7d..5bda9fdbee9e 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -37,6 +37,7 @@
37#include <plat/common.h> 37#include <plat/common.h>
38#include <plat/dma.h> 38#include <plat/dma.h>
39#include <plat/gpmc.h> 39#include <plat/gpmc.h>
40#include <plat/display.h>
40 41
41#include <plat/control.h> 42#include <plat/control.h>
42#include <plat/gpmc-smc91x.h> 43#include <plat/gpmc-smc91x.h>
@@ -152,31 +153,152 @@ static struct spi_board_info sdp3430_spi_board_info[] __initdata = {
152 }, 153 },
153}; 154};
154 155
155static struct platform_device sdp3430_lcd_device = { 156
156 .name = "sdp2430_lcd", 157#define SDP3430_LCD_PANEL_BACKLIGHT_GPIO 8
157 .id = -1, 158#define SDP3430_LCD_PANEL_ENABLE_GPIO 5
159
160static unsigned backlight_gpio;
161static unsigned enable_gpio;
162static int lcd_enabled;
163static int dvi_enabled;
164
165static void __init sdp3430_display_init(void)
166{
167 int r;
168
169 enable_gpio = SDP3430_LCD_PANEL_ENABLE_GPIO;
170 backlight_gpio = SDP3430_LCD_PANEL_BACKLIGHT_GPIO;
171
172 r = gpio_request(enable_gpio, "LCD reset");
173 if (r) {
174 printk(KERN_ERR "failed to get LCD reset GPIO\n");
175 goto err0;
176 }
177
178 r = gpio_request(backlight_gpio, "LCD Backlight");
179 if (r) {
180 printk(KERN_ERR "failed to get LCD backlight GPIO\n");
181 goto err1;
182 }
183
184 gpio_direction_output(enable_gpio, 0);
185 gpio_direction_output(backlight_gpio, 0);
186
187 return;
188err1:
189 gpio_free(enable_gpio);
190err0:
191 return;
192}
193
194static int sdp3430_panel_enable_lcd(struct omap_dss_device *dssdev)
195{
196 if (dvi_enabled) {
197 printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
198 return -EINVAL;
199 }
200
201 gpio_direction_output(enable_gpio, 1);
202 gpio_direction_output(backlight_gpio, 1);
203
204 lcd_enabled = 1;
205
206 return 0;
207}
208
209static void sdp3430_panel_disable_lcd(struct omap_dss_device *dssdev)
210{
211 lcd_enabled = 0;
212
213 gpio_direction_output(enable_gpio, 0);
214 gpio_direction_output(backlight_gpio, 0);
215}
216
217static int sdp3430_panel_enable_dvi(struct omap_dss_device *dssdev)
218{
219 if (lcd_enabled) {
220 printk(KERN_ERR "cannot enable DVI, LCD is enabled\n");
221 return -EINVAL;
222 }
223
224 dvi_enabled = 1;
225
226 return 0;
227}
228
229static void sdp3430_panel_disable_dvi(struct omap_dss_device *dssdev)
230{
231 dvi_enabled = 0;
232}
233
234static int sdp3430_panel_enable_tv(struct omap_dss_device *dssdev)
235{
236 return 0;
237}
238
239static void sdp3430_panel_disable_tv(struct omap_dss_device *dssdev)
240{
241}
242
243
244static struct omap_dss_device sdp3430_lcd_device = {
245 .name = "lcd",
246 .driver_name = "sharp_ls_panel",
247 .type = OMAP_DISPLAY_TYPE_DPI,
248 .phy.dpi.data_lines = 16,
249 .platform_enable = sdp3430_panel_enable_lcd,
250 .platform_disable = sdp3430_panel_disable_lcd,
158}; 251};
159 252
160static struct regulator_consumer_supply sdp3430_vdac_supply = { 253static struct omap_dss_device sdp3430_dvi_device = {
161 .supply = "vdac", 254 .name = "dvi",
162 .dev = &sdp3430_lcd_device.dev, 255 .driver_name = "generic_panel",
256 .type = OMAP_DISPLAY_TYPE_DPI,
257 .phy.dpi.data_lines = 24,
258 .platform_enable = sdp3430_panel_enable_dvi,
259 .platform_disable = sdp3430_panel_disable_dvi,
163}; 260};
164 261
165static struct regulator_consumer_supply sdp3430_vdvi_supply = { 262static struct omap_dss_device sdp3430_tv_device = {
166 .supply = "vdvi", 263 .name = "tv",
167 .dev = &sdp3430_lcd_device.dev, 264 .driver_name = "venc",
265 .type = OMAP_DISPLAY_TYPE_VENC,
266 .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
267 .platform_enable = sdp3430_panel_enable_tv,
268 .platform_disable = sdp3430_panel_disable_tv,
168}; 269};
169 270
170static struct platform_device *sdp3430_devices[] __initdata = { 271
272static struct omap_dss_device *sdp3430_dss_devices[] = {
171 &sdp3430_lcd_device, 273 &sdp3430_lcd_device,
274 &sdp3430_dvi_device,
275 &sdp3430_tv_device,
172}; 276};
173 277
174static struct omap_lcd_config sdp3430_lcd_config __initdata = { 278static struct omap_dss_board_info sdp3430_dss_data = {
175 .ctrl_name = "internal", 279 .num_devices = ARRAY_SIZE(sdp3430_dss_devices),
280 .devices = sdp3430_dss_devices,
281 .default_device = &sdp3430_lcd_device,
282};
283
284static struct platform_device sdp3430_dss_device = {
285 .name = "omapdss",
286 .id = -1,
287 .dev = {
288 .platform_data = &sdp3430_dss_data,
289 },
290};
291
292static struct regulator_consumer_supply sdp3430_vdda_dac_supply = {
293 .supply = "vdda_dac",
294 .dev = &sdp3430_dss_device.dev,
295};
296
297static struct platform_device *sdp3430_devices[] __initdata = {
298 &sdp3430_dss_device,
176}; 299};
177 300
178static struct omap_board_config_kernel sdp3430_config[] __initdata = { 301static struct omap_board_config_kernel sdp3430_config[] __initdata = {
179 { OMAP_TAG_LCD, &sdp3430_lcd_config },
180}; 302};
181 303
182static void __init omap_3430sdp_init_irq(void) 304static void __init omap_3430sdp_init_irq(void)
@@ -392,22 +514,34 @@ static struct regulator_init_data sdp3430_vdac = {
392 | REGULATOR_CHANGE_STATUS, 514 | REGULATOR_CHANGE_STATUS,
393 }, 515 },
394 .num_consumer_supplies = 1, 516 .num_consumer_supplies = 1,
395 .consumer_supplies = &sdp3430_vdac_supply, 517 .consumer_supplies = &sdp3430_vdda_dac_supply,
396}; 518};
397 519
398/* VPLL2 for digital video outputs */ 520/* VPLL2 for digital video outputs */
521static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = {
522 {
523 .supply = "vdvi",
524 .dev = &sdp3430_lcd_device.dev,
525 },
526 {
527 .supply = "vdds_dsi",
528 .dev = &sdp3430_dss_device.dev,
529 }
530};
531
399static struct regulator_init_data sdp3430_vpll2 = { 532static struct regulator_init_data sdp3430_vpll2 = {
400 .constraints = { 533 .constraints = {
401 .name = "VDVI", 534 .name = "VDVI",
402 .min_uV = 1800000, 535 .min_uV = 1800000,
403 .max_uV = 1800000, 536 .max_uV = 1800000,
537 .apply_uV = true,
404 .valid_modes_mask = REGULATOR_MODE_NORMAL 538 .valid_modes_mask = REGULATOR_MODE_NORMAL
405 | REGULATOR_MODE_STANDBY, 539 | REGULATOR_MODE_STANDBY,
406 .valid_ops_mask = REGULATOR_CHANGE_MODE 540 .valid_ops_mask = REGULATOR_CHANGE_MODE
407 | REGULATOR_CHANGE_STATUS, 541 | REGULATOR_CHANGE_STATUS,
408 }, 542 },
409 .num_consumer_supplies = 1, 543 .num_consumer_supplies = ARRAY_SIZE(sdp3430_vpll2_supplies),
410 .consumer_supplies = &sdp3430_vdvi_supply, 544 .consumer_supplies = sdp3430_vpll2_supplies,
411}; 545};
412 546
413static struct twl4030_codec_audio_data sdp3430_audio = { 547static struct twl4030_codec_audio_data sdp3430_audio = {
@@ -521,6 +655,7 @@ static void __init omap_3430sdp_init(void)
521 omap_serial_init(); 655 omap_serial_init();
522 usb_musb_init(); 656 usb_musb_init();
523 board_smc91x_init(); 657 board_smc91x_init();
658 sdp3430_display_init();
524 enable_board_wakeup_source(); 659 enable_board_wakeup_source();
525 usb_ehci_init(&ehci_pdata); 660 usb_ehci_init(&ehci_pdata);
526} 661}