aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/board-2430sdp.c')
-rw-r--r--arch/arm/mach-omap2/board-2430sdp.c102
1 files changed, 72 insertions, 30 deletions
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index 2028464cf5b9..7370983f809f 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -34,11 +34,14 @@
34#include <asm/mach/map.h> 34#include <asm/mach/map.h>
35 35
36#include <plat/board.h> 36#include <plat/board.h>
37#include <plat/common.h> 37#include "common.h"
38#include <plat/gpmc.h> 38#include <plat/gpmc.h>
39#include <plat/usb.h> 39#include <plat/usb.h>
40#include <plat/gpmc-smc91x.h> 40#include <plat/gpmc-smc91x.h>
41 41
42#include <video/omapdss.h>
43#include <video/omap-panel-generic-dpi.h>
44
42#include "mux.h" 45#include "mux.h"
43#include "hsmmc.h" 46#include "hsmmc.h"
44#include "common-board-devices.h" 47#include "common-board-devices.h"
@@ -99,20 +102,72 @@ static struct platform_device sdp2430_flash_device = {
99 .resource = &sdp2430_flash_resource, 102 .resource = &sdp2430_flash_resource,
100}; 103};
101 104
102static struct platform_device sdp2430_lcd_device = {
103 .name = "sdp2430_lcd",
104 .id = -1,
105};
106
107static struct platform_device *sdp2430_devices[] __initdata = { 105static struct platform_device *sdp2430_devices[] __initdata = {
108 &sdp2430_flash_device, 106 &sdp2430_flash_device,
107};
108
109/* LCD */
110#define SDP2430_LCD_PANEL_BACKLIGHT_GPIO 91
111#define SDP2430_LCD_PANEL_ENABLE_GPIO 154
112
113static int sdp2430_panel_enable_lcd(struct omap_dss_device *dssdev)
114{
115 gpio_direction_output(SDP2430_LCD_PANEL_ENABLE_GPIO, 1);
116 gpio_direction_output(SDP2430_LCD_PANEL_BACKLIGHT_GPIO, 1);
117
118 return 0;
119}
120
121static void sdp2430_panel_disable_lcd(struct omap_dss_device *dssdev)
122{
123 gpio_direction_output(SDP2430_LCD_PANEL_ENABLE_GPIO, 0);
124 gpio_direction_output(SDP2430_LCD_PANEL_BACKLIGHT_GPIO, 0);
125}
126
127static struct panel_generic_dpi_data sdp2430_panel_data = {
128 .name = "nec_nl2432dr22-11b",
129 .platform_enable = sdp2430_panel_enable_lcd,
130 .platform_disable = sdp2430_panel_disable_lcd,
131};
132
133static struct omap_dss_device sdp2430_lcd_device = {
134 .name = "lcd",
135 .driver_name = "generic_dpi_panel",
136 .type = OMAP_DISPLAY_TYPE_DPI,
137 .phy.dpi.data_lines = 16,
138 .data = &sdp2430_panel_data,
139};
140
141static struct omap_dss_device *sdp2430_dss_devices[] = {
109 &sdp2430_lcd_device, 142 &sdp2430_lcd_device,
110}; 143};
111 144
112static struct omap_lcd_config sdp2430_lcd_config __initdata = { 145static struct omap_dss_board_info sdp2430_dss_data = {
113 .ctrl_name = "internal", 146 .num_devices = ARRAY_SIZE(sdp2430_dss_devices),
147 .devices = sdp2430_dss_devices,
148 .default_device = &sdp2430_lcd_device,
114}; 149};
115 150
151static void __init sdp2430_display_init(void)
152{
153 int r;
154
155 static struct gpio gpios[] __initdata = {
156 { SDP2430_LCD_PANEL_ENABLE_GPIO, GPIOF_OUT_INIT_LOW,
157 "LCD reset" },
158 { SDP2430_LCD_PANEL_BACKLIGHT_GPIO, GPIOF_OUT_INIT_LOW,
159 "LCD Backlight" },
160 };
161
162 r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
163 if (r) {
164 pr_err("Cannot request LCD GPIOs, error %d\n", r);
165 return;
166 }
167
168 omap_display_init(&sdp2430_dss_data);
169}
170
116#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91x_MODULE) 171#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91x_MODULE)
117 172
118static struct omap_smc91x_platform_data board_smc91x_data = { 173static struct omap_smc91x_platform_data board_smc91x_data = {
@@ -137,16 +192,6 @@ static inline void board_smc91x_init(void)
137 192
138#endif 193#endif
139 194
140static struct omap_board_config_kernel sdp2430_config[] __initdata = {
141 {OMAP_TAG_LCD, &sdp2430_lcd_config},
142};
143
144static void __init omap_2430sdp_init_early(void)
145{
146 omap2_init_common_infrastructure();
147 omap2_init_common_devices(NULL, NULL);
148}
149
150static struct regulator_consumer_supply sdp2430_vmmc1_supplies[] = { 195static struct regulator_consumer_supply sdp2430_vmmc1_supplies[] = {
151 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), 196 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
152}; 197};
@@ -193,7 +238,8 @@ static int __init omap2430_i2c_init(void)
193{ 238{
194 omap_register_i2c_bus(1, 100, sdp2430_i2c1_boardinfo, 239 omap_register_i2c_bus(1, 100, sdp2430_i2c1_boardinfo,
195 ARRAY_SIZE(sdp2430_i2c1_boardinfo)); 240 ARRAY_SIZE(sdp2430_i2c1_boardinfo));
196 omap2_pmic_init("twl4030", &sdp2430_twldata); 241 omap_pmic_init(2, 100, "twl4030", INT_24XX_SYS_NIRQ,
242 &sdp2430_twldata);
197 return 0; 243 return 0;
198} 244}
199 245
@@ -228,13 +274,11 @@ static void __init omap_2430sdp_init(void)
228{ 274{
229 omap2430_mux_init(board_mux, OMAP_PACKAGE_ZAC); 275 omap2430_mux_init(board_mux, OMAP_PACKAGE_ZAC);
230 276
231 omap_board_config = sdp2430_config;
232 omap_board_config_size = ARRAY_SIZE(sdp2430_config);
233
234 omap2430_i2c_init(); 277 omap2430_i2c_init();
235 278
236 platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices)); 279 platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices));
237 omap_serial_init(); 280 omap_serial_init();
281 omap_sdrc_init(NULL, NULL);
238 omap2_hsmmc_init(mmc); 282 omap2_hsmmc_init(mmc);
239 omap2_usbfs_init(&sdp2430_usb_config); 283 omap2_usbfs_init(&sdp2430_usb_config);
240 284
@@ -246,21 +290,19 @@ static void __init omap_2430sdp_init(void)
246 /* Turn off secondary LCD backlight */ 290 /* Turn off secondary LCD backlight */
247 gpio_request_one(SECONDARY_LCD_GPIO, GPIOF_OUT_INIT_LOW, 291 gpio_request_one(SECONDARY_LCD_GPIO, GPIOF_OUT_INIT_LOW,
248 "Secondary LCD backlight"); 292 "Secondary LCD backlight");
249}
250 293
251static void __init omap_2430sdp_map_io(void) 294 sdp2430_display_init();
252{
253 omap2_set_globals_243x();
254 omap243x_map_common_io();
255} 295}
256 296
257MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board") 297MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board")
258 /* Maintainer: Syed Khasim - Texas Instruments Inc */ 298 /* Maintainer: Syed Khasim - Texas Instruments Inc */
259 .boot_params = 0x80000100, 299 .atag_offset = 0x100,
260 .reserve = omap_reserve, 300 .reserve = omap_reserve,
261 .map_io = omap_2430sdp_map_io, 301 .map_io = omap243x_map_io,
262 .init_early = omap_2430sdp_init_early, 302 .init_early = omap2430_init_early,
263 .init_irq = omap2_init_irq, 303 .init_irq = omap2_init_irq,
304 .handle_irq = omap2_intc_handle_irq,
264 .init_machine = omap_2430sdp_init, 305 .init_machine = omap_2430sdp_init,
265 .timer = &omap2_timer, 306 .timer = &omap2_timer,
307 .restart = omap_prcm_restart,
266MACHINE_END 308MACHINE_END