diff options
author | Arnd Bergmann <arnd@arndb.de> | 2011-10-31 18:17:39 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2011-10-31 18:17:39 -0400 |
commit | 034ee299122c6b145d6d3cafb9ef5c329a4ab990 (patch) | |
tree | 0fb4dba7b72d28e1dc4d3bab1317a9a98302a7a5 /arch/arm/mach-omap2/board-ldp.c | |
parent | d6bb0f27709b91e674ce1441e2dd5e68620edf14 (diff) | |
parent | 3e28189038bb831512cf4f8313e1aead97c3e63f (diff) |
Merge branch 'depends/omap2_dss' into next/cleanup
Omap cleanups conflicted with omap2_dss work in a nontrivial
way, this is the most logical fixup.
Conflicts:
arch/arm/mach-omap2/board-2430sdp.c
arch/arm/mach-omap2/board-4430sdp.c
arch/arm/mach-omap2/board-apollon.c
arch/arm/mach-omap2/board-h4.c
arch/arm/mach-omap2/board-ldp.c
arch/arm/mach-omap2/board-rx51.c
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm/mach-omap2/board-ldp.c')
-rw-r--r-- | arch/arm/mach-omap2/board-ldp.c | 123 |
1 files changed, 112 insertions, 11 deletions
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c index 0fa28be2cfda..2a2545153d15 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> |
@@ -34,7 +35,6 @@ | |||
34 | #include <asm/mach/map.h> | 35 | #include <asm/mach/map.h> |
35 | 36 | ||
36 | #include <plat/mcspi.h> | 37 | #include <plat/mcspi.h> |
37 | #include <mach/gpio.h> | ||
38 | #include <plat/board.h> | 38 | #include <plat/board.h> |
39 | #include <plat/common.h> | 39 | #include <plat/common.h> |
40 | #include <plat/gpmc.h> | 40 | #include <plat/gpmc.h> |
@@ -44,6 +44,9 @@ | |||
44 | #include <plat/usb.h> | 44 | #include <plat/usb.h> |
45 | #include <plat/gpmc-smsc911x.h> | 45 | #include <plat/gpmc-smsc911x.h> |
46 | 46 | ||
47 | #include <video/omapdss.h> | ||
48 | #include <video/omap-panel-generic-dpi.h> | ||
49 | |||
47 | #include "board-flash.h" | 50 | #include "board-flash.h" |
48 | #include "mux.h" | 51 | #include "mux.h" |
49 | #include "hsmmc.h" | 52 | #include "hsmmc.h" |
@@ -180,23 +183,102 @@ static inline void __init ldp_init_smsc911x(void) | |||
180 | gpmc_smsc911x_init(&smsc911x_cfg); | 183 | gpmc_smsc911x_init(&smsc911x_cfg); |
181 | } | 184 | } |
182 | 185 | ||
183 | static struct platform_device ldp_lcd_device = { | 186 | /* LCD */ |
184 | .name = "ldp_lcd", | 187 | |
185 | .id = -1, | 188 | static int ldp_backlight_gpio; |
189 | static int ldp_lcd_enable_gpio; | ||
190 | |||
191 | #define LCD_PANEL_RESET_GPIO 55 | ||
192 | #define LCD_PANEL_QVGA_GPIO 56 | ||
193 | |||
194 | static 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 | |||
204 | static 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 | |||
212 | static 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, | ||
186 | }; | 216 | }; |
187 | 217 | ||
188 | static struct omap_lcd_config ldp_lcd_config __initdata = { | 218 | static struct omap_dss_device ldp_lcd_device = { |
189 | .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 | |||
226 | static struct omap_dss_device *ldp_dss_devices[] = { | ||
227 | &ldp_lcd_device, | ||
190 | }; | 228 | }; |
191 | 229 | ||
192 | static struct omap_board_config_kernel ldp_config[] __initdata = { | 230 | static struct omap_dss_board_info ldp_dss_data = { |
193 | { 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, | ||
194 | }; | 234 | }; |
195 | 235 | ||
236 | static 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 | |||
254 | static int ldp_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio) | ||
255 | { | ||
256 | int r; | ||
257 | |||
258 | struct gpio gpios[] = { | ||
259 | {gpio + 7 , GPIOF_OUT_INIT_LOW, "LCD ENABLE"}, | ||
260 | {gpio + 15, GPIOF_OUT_INIT_LOW, "LCD BACKLIGHT"}, | ||
261 | }; | ||
262 | |||
263 | r = gpio_request_array(gpios, ARRAY_SIZE(gpios)); | ||
264 | if (r) { | ||
265 | pr_err("Cannot request LCD GPIOs, error %d\n", r); | ||
266 | ldp_backlight_gpio = -EINVAL; | ||
267 | ldp_lcd_enable_gpio = -EINVAL; | ||
268 | return r; | ||
269 | } | ||
270 | |||
271 | ldp_backlight_gpio = gpio + 15; | ||
272 | ldp_lcd_enable_gpio = gpio + 7; | ||
273 | |||
274 | return 0; | ||
275 | } | ||
276 | |||
196 | static struct twl4030_gpio_platform_data ldp_gpio_data = { | 277 | static struct twl4030_gpio_platform_data ldp_gpio_data = { |
197 | .gpio_base = OMAP_MAX_GPIO_LINES, | 278 | .gpio_base = OMAP_MAX_GPIO_LINES, |
198 | .irq_base = TWL4030_GPIO_IRQ_BASE, | 279 | .irq_base = TWL4030_GPIO_IRQ_BASE, |
199 | .irq_end = TWL4030_GPIO_IRQ_END, | 280 | .irq_end = TWL4030_GPIO_IRQ_END, |
281 | .setup = ldp_twl_gpio_setup, | ||
200 | }; | 282 | }; |
201 | 283 | ||
202 | static struct regulator_consumer_supply ldp_vmmc1_supply[] = { | 284 | static struct regulator_consumer_supply ldp_vmmc1_supply[] = { |
@@ -238,10 +320,31 @@ static struct regulator_init_data ldp_vaux1 = { | |||
238 | .consumer_supplies = ldp_vaux1_supplies, | 320 | .consumer_supplies = ldp_vaux1_supplies, |
239 | }; | 321 | }; |
240 | 322 | ||
323 | static struct regulator_consumer_supply ldp_vpll2_supplies[] = { | ||
324 | REGULATOR_SUPPLY("vdds_dsi", "omapdss"), | ||
325 | REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"), | ||
326 | }; | ||
327 | |||
328 | static struct regulator_init_data ldp_vpll2 = { | ||
329 | .constraints = { | ||
330 | .name = "VDVI", | ||
331 | .min_uV = 1800000, | ||
332 | .max_uV = 1800000, | ||
333 | .apply_uV = true, | ||
334 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
335 | | REGULATOR_MODE_STANDBY, | ||
336 | .valid_ops_mask = REGULATOR_CHANGE_MODE | ||
337 | | REGULATOR_CHANGE_STATUS, | ||
338 | }, | ||
339 | .num_consumer_supplies = ARRAY_SIZE(ldp_vpll2_supplies), | ||
340 | .consumer_supplies = ldp_vpll2_supplies, | ||
341 | }; | ||
342 | |||
241 | static struct twl4030_platform_data ldp_twldata = { | 343 | static struct twl4030_platform_data ldp_twldata = { |
242 | /* platform_data for children goes here */ | 344 | /* platform_data for children goes here */ |
243 | .vmmc1 = &ldp_vmmc1, | 345 | .vmmc1 = &ldp_vmmc1, |
244 | .vaux1 = &ldp_vaux1, | 346 | .vaux1 = &ldp_vaux1, |
347 | .vpll2 = &ldp_vpll2, | ||
245 | .gpio = &ldp_gpio_data, | 348 | .gpio = &ldp_gpio_data, |
246 | .keypad = &ldp_kp_twl4030_data, | 349 | .keypad = &ldp_kp_twl4030_data, |
247 | }; | 350 | }; |
@@ -267,7 +370,6 @@ static struct omap2_hsmmc_info mmc[] __initdata = { | |||
267 | }; | 370 | }; |
268 | 371 | ||
269 | static struct platform_device *ldp_devices[] __initdata = { | 372 | static struct platform_device *ldp_devices[] __initdata = { |
270 | &ldp_lcd_device, | ||
271 | &ldp_gpio_keys_device, | 373 | &ldp_gpio_keys_device, |
272 | }; | 374 | }; |
273 | 375 | ||
@@ -312,8 +414,6 @@ static struct mtd_partition ldp_nand_partitions[] = { | |||
312 | static void __init omap_ldp_init(void) | 414 | static void __init omap_ldp_init(void) |
313 | { | 415 | { |
314 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 416 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
315 | omap_board_config = ldp_config; | ||
316 | omap_board_config_size = ARRAY_SIZE(ldp_config); | ||
317 | ldp_init_smsc911x(); | 417 | ldp_init_smsc911x(); |
318 | omap_i2c_init(); | 418 | omap_i2c_init(); |
319 | platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices)); | 419 | platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices)); |
@@ -325,6 +425,7 @@ static void __init omap_ldp_init(void) | |||
325 | ARRAY_SIZE(ldp_nand_partitions), ZOOM_NAND_CS, 0); | 425 | ARRAY_SIZE(ldp_nand_partitions), ZOOM_NAND_CS, 0); |
326 | 426 | ||
327 | omap2_hsmmc_init(mmc); | 427 | omap2_hsmmc_init(mmc); |
428 | ldp_display_init(); | ||
328 | } | 429 | } |
329 | 430 | ||
330 | MACHINE_START(OMAP_LDP, "OMAP LDP board") | 431 | MACHINE_START(OMAP_LDP, "OMAP LDP board") |