aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/board-ldp.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/board-ldp.c')
-rw-r--r--arch/arm/mach-omap2/board-ldp.c122
1 files changed, 112 insertions, 10 deletions
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index abe8c7e496a2..f8f8a68a4899 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -27,6 +27,7 @@
27#include <linux/io.h> 27#include <linux/io.h>
28#include <linux/smsc911x.h> 28#include <linux/smsc911x.h>
29#include <linux/mmc/host.h> 29#include <linux/mmc/host.h>
30#include <linux/gpio.h>
30 31
31#include <mach/hardware.h> 32#include <mach/hardware.h>
32#include <asm/mach-types.h> 33#include <asm/mach-types.h>
@@ -43,6 +44,9 @@
43#include <plat/usb.h> 44#include <plat/usb.h>
44#include <plat/gpmc-smsc911x.h> 45#include <plat/gpmc-smsc911x.h>
45 46
47#include <video/omapdss.h>
48#include <video/omap-panel-generic-dpi.h>
49
46#include "board-flash.h" 50#include "board-flash.h"
47#include "mux.h" 51#include "mux.h"
48#include "hsmmc.h" 52#include "hsmmc.h"
@@ -179,29 +183,108 @@ static inline void __init ldp_init_smsc911x(void)
179 gpmc_smsc911x_init(&smsc911x_cfg); 183 gpmc_smsc911x_init(&smsc911x_cfg);
180} 184}
181 185
182static struct platform_device ldp_lcd_device = { 186/* LCD */
183 .name = "ldp_lcd", 187
184 .id = -1, 188static int ldp_backlight_gpio;
189static int ldp_lcd_enable_gpio;
190
191#define LCD_PANEL_RESET_GPIO 55
192#define LCD_PANEL_QVGA_GPIO 56
193
194static int ldp_panel_enable_lcd(struct omap_dss_device *dssdev)
195{
196 if (gpio_is_valid(ldp_lcd_enable_gpio))
197 gpio_direction_output(ldp_lcd_enable_gpio, 1);
198 if (gpio_is_valid(ldp_backlight_gpio))
199 gpio_direction_output(ldp_backlight_gpio, 1);
200
201 return 0;
202}
203
204static void ldp_panel_disable_lcd(struct omap_dss_device *dssdev)
205{
206 if (gpio_is_valid(ldp_lcd_enable_gpio))
207 gpio_direction_output(ldp_lcd_enable_gpio, 0);
208 if (gpio_is_valid(ldp_backlight_gpio))
209 gpio_direction_output(ldp_backlight_gpio, 0);
210}
211
212static struct panel_generic_dpi_data ldp_panel_data = {
213 .name = "nec_nl2432dr22-11b",
214 .platform_enable = ldp_panel_enable_lcd,
215 .platform_disable = ldp_panel_disable_lcd,
185}; 216};
186 217
187static struct omap_lcd_config ldp_lcd_config __initdata = { 218static struct omap_dss_device ldp_lcd_device = {
188 .ctrl_name = "internal", 219 .name = "lcd",
220 .driver_name = "generic_dpi_panel",
221 .type = OMAP_DISPLAY_TYPE_DPI,
222 .phy.dpi.data_lines = 18,
223 .data = &ldp_panel_data,
224};
225
226static struct omap_dss_device *ldp_dss_devices[] = {
227 &ldp_lcd_device,
189}; 228};
190 229
191static struct omap_board_config_kernel ldp_config[] __initdata = { 230static struct omap_dss_board_info ldp_dss_data = {
192 { OMAP_TAG_LCD, &ldp_lcd_config }, 231 .num_devices = ARRAY_SIZE(ldp_dss_devices),
232 .devices = ldp_dss_devices,
233 .default_device = &ldp_lcd_device,
193}; 234};
194 235
236static void __init ldp_display_init(void)
237{
238 int r;
239
240 static struct gpio gpios[] __initdata = {
241 {LCD_PANEL_RESET_GPIO, GPIOF_OUT_INIT_HIGH, "LCD RESET"},
242 {LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, "LCD QVGA"},
243 };
244
245 r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
246 if (r) {
247 pr_err("Cannot request LCD GPIOs, error %d\n", r);
248 return;
249 }
250
251 omap_display_init(&ldp_dss_data);
252}
253
195static void __init omap_ldp_init_early(void) 254static void __init omap_ldp_init_early(void)
196{ 255{
197 omap2_init_common_infrastructure(); 256 omap2_init_common_infrastructure();
198 omap2_init_common_devices(NULL, NULL); 257 omap2_init_common_devices(NULL, NULL);
199} 258}
200 259
260static int ldp_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio)
261{
262 int r;
263
264 struct gpio gpios[] = {
265 {gpio + 7 , GPIOF_OUT_INIT_LOW, "LCD ENABLE"},
266 {gpio + 15, GPIOF_OUT_INIT_LOW, "LCD BACKLIGHT"},
267 };
268
269 r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
270 if (r) {
271 pr_err("Cannot request LCD GPIOs, error %d\n", r);
272 ldp_backlight_gpio = -EINVAL;
273 ldp_lcd_enable_gpio = -EINVAL;
274 return r;
275 }
276
277 ldp_backlight_gpio = gpio + 15;
278 ldp_lcd_enable_gpio = gpio + 7;
279
280 return 0;
281}
282
201static struct twl4030_gpio_platform_data ldp_gpio_data = { 283static struct twl4030_gpio_platform_data ldp_gpio_data = {
202 .gpio_base = OMAP_MAX_GPIO_LINES, 284 .gpio_base = OMAP_MAX_GPIO_LINES,
203 .irq_base = TWL4030_GPIO_IRQ_BASE, 285 .irq_base = TWL4030_GPIO_IRQ_BASE,
204 .irq_end = TWL4030_GPIO_IRQ_END, 286 .irq_end = TWL4030_GPIO_IRQ_END,
287 .setup = ldp_twl_gpio_setup,
205}; 288};
206 289
207static struct regulator_consumer_supply ldp_vmmc1_supply[] = { 290static struct regulator_consumer_supply ldp_vmmc1_supply[] = {
@@ -243,10 +326,31 @@ static struct regulator_init_data ldp_vaux1 = {
243 .consumer_supplies = ldp_vaux1_supplies, 326 .consumer_supplies = ldp_vaux1_supplies,
244}; 327};
245 328
329static struct regulator_consumer_supply ldp_vpll2_supplies[] = {
330 REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
331 REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"),
332};
333
334static struct regulator_init_data ldp_vpll2 = {
335 .constraints = {
336 .name = "VDVI",
337 .min_uV = 1800000,
338 .max_uV = 1800000,
339 .apply_uV = true,
340 .valid_modes_mask = REGULATOR_MODE_NORMAL
341 | REGULATOR_MODE_STANDBY,
342 .valid_ops_mask = REGULATOR_CHANGE_MODE
343 | REGULATOR_CHANGE_STATUS,
344 },
345 .num_consumer_supplies = ARRAY_SIZE(ldp_vpll2_supplies),
346 .consumer_supplies = ldp_vpll2_supplies,
347};
348
246static struct twl4030_platform_data ldp_twldata = { 349static struct twl4030_platform_data ldp_twldata = {
247 /* platform_data for children goes here */ 350 /* platform_data for children goes here */
248 .vmmc1 = &ldp_vmmc1, 351 .vmmc1 = &ldp_vmmc1,
249 .vaux1 = &ldp_vaux1, 352 .vaux1 = &ldp_vaux1,
353 .vpll2 = &ldp_vpll2,
250 .gpio = &ldp_gpio_data, 354 .gpio = &ldp_gpio_data,
251 .keypad = &ldp_kp_twl4030_data, 355 .keypad = &ldp_kp_twl4030_data,
252}; 356};
@@ -272,7 +376,6 @@ static struct omap2_hsmmc_info mmc[] __initdata = {
272}; 376};
273 377
274static struct platform_device *ldp_devices[] __initdata = { 378static struct platform_device *ldp_devices[] __initdata = {
275 &ldp_lcd_device,
276 &ldp_gpio_keys_device, 379 &ldp_gpio_keys_device,
277}; 380};
278 381
@@ -317,8 +420,6 @@ static struct mtd_partition ldp_nand_partitions[] = {
317static void __init omap_ldp_init(void) 420static void __init omap_ldp_init(void)
318{ 421{
319 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 422 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
320 omap_board_config = ldp_config;
321 omap_board_config_size = ARRAY_SIZE(ldp_config);
322 ldp_init_smsc911x(); 423 ldp_init_smsc911x();
323 omap_i2c_init(); 424 omap_i2c_init();
324 platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices)); 425 platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices));
@@ -329,6 +430,7 @@ static void __init omap_ldp_init(void)
329 ARRAY_SIZE(ldp_nand_partitions), ZOOM_NAND_CS, 0); 430 ARRAY_SIZE(ldp_nand_partitions), ZOOM_NAND_CS, 0);
330 431
331 omap2_hsmmc_init(mmc); 432 omap2_hsmmc_init(mmc);
433 ldp_display_init();
332} 434}
333 435
334MACHINE_START(OMAP_LDP, "OMAP LDP board") 436MACHINE_START(OMAP_LDP, "OMAP LDP board")