diff options
Diffstat (limited to 'arch/arm/mach-omap2/board-2430sdp.c')
-rw-r--r-- | arch/arm/mach-omap2/board-2430sdp.c | 78 |
1 files changed, 64 insertions, 14 deletions
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c index 87f43ade4405..f8ce84b69eb1 100644 --- a/arch/arm/mach-omap2/board-2430sdp.c +++ b/arch/arm/mach-omap2/board-2430sdp.c | |||
@@ -39,6 +39,9 @@ | |||
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 | ||
102 | static struct platform_device sdp2430_lcd_device = { | ||
103 | .name = "sdp2430_lcd", | ||
104 | .id = -1, | ||
105 | }; | ||
106 | |||
107 | static struct platform_device *sdp2430_devices[] __initdata = { | 105 | static 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 | |||
113 | static 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 | |||
121 | static 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 | |||
127 | static 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 | |||
133 | static 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 | |||
141 | static struct omap_dss_device *sdp2430_dss_devices[] = { | ||
109 | &sdp2430_lcd_device, | 142 | &sdp2430_lcd_device, |
110 | }; | 143 | }; |
111 | 144 | ||
112 | static struct omap_lcd_config sdp2430_lcd_config __initdata = { | 145 | static 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 | ||
151 | static 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 | ||
118 | static struct omap_smc91x_platform_data board_smc91x_data = { | 173 | static struct omap_smc91x_platform_data board_smc91x_data = { |
@@ -137,10 +192,6 @@ static inline void board_smc91x_init(void) | |||
137 | 192 | ||
138 | #endif | 193 | #endif |
139 | 194 | ||
140 | static struct omap_board_config_kernel sdp2430_config[] __initdata = { | ||
141 | {OMAP_TAG_LCD, &sdp2430_lcd_config}, | ||
142 | }; | ||
143 | |||
144 | static void __init omap_2430sdp_init_early(void) | 195 | static void __init omap_2430sdp_init_early(void) |
145 | { | 196 | { |
146 | omap2_init_common_infrastructure(); | 197 | omap2_init_common_infrastructure(); |
@@ -229,9 +280,6 @@ static void __init omap_2430sdp_init(void) | |||
229 | { | 280 | { |
230 | omap2430_mux_init(board_mux, OMAP_PACKAGE_ZAC); | 281 | omap2430_mux_init(board_mux, OMAP_PACKAGE_ZAC); |
231 | 282 | ||
232 | omap_board_config = sdp2430_config; | ||
233 | omap_board_config_size = ARRAY_SIZE(sdp2430_config); | ||
234 | |||
235 | omap2430_i2c_init(); | 283 | omap2430_i2c_init(); |
236 | 284 | ||
237 | platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices)); | 285 | platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices)); |
@@ -247,6 +295,8 @@ static void __init omap_2430sdp_init(void) | |||
247 | /* Turn off secondary LCD backlight */ | 295 | /* Turn off secondary LCD backlight */ |
248 | gpio_request_one(SECONDARY_LCD_GPIO, GPIOF_OUT_INIT_LOW, | 296 | gpio_request_one(SECONDARY_LCD_GPIO, GPIOF_OUT_INIT_LOW, |
249 | "Secondary LCD backlight"); | 297 | "Secondary LCD backlight"); |
298 | |||
299 | sdp2430_display_init(); | ||
250 | } | 300 | } |
251 | 301 | ||
252 | static void __init omap_2430sdp_map_io(void) | 302 | static void __init omap_2430sdp_map_io(void) |