diff options
Diffstat (limited to 'arch/arm/mach-omap2/board-rx51-peripherals.c')
-rw-r--r-- | arch/arm/mach-omap2/board-rx51-peripherals.c | 126 |
1 files changed, 124 insertions, 2 deletions
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c index 56d931a425f..e6e8290b782 100644 --- a/arch/arm/mach-omap2/board-rx51-peripherals.c +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * linux/arch/arm/mach-omap2/board-rx51-flash.c | 2 | * linux/arch/arm/mach-omap2/board-rx51-peripherals.c |
3 | * | 3 | * |
4 | * Copyright (C) 2008-2009 Nokia | 4 | * Copyright (C) 2008-2009 Nokia |
5 | * | 5 | * |
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/delay.h> | 19 | #include <linux/delay.h> |
20 | #include <linux/regulator/machine.h> | 20 | #include <linux/regulator/machine.h> |
21 | #include <linux/gpio.h> | 21 | #include <linux/gpio.h> |
22 | #include <linux/mmc/host.h> | ||
22 | 23 | ||
23 | #include <mach/mcspi.h> | 24 | #include <mach/mcspi.h> |
24 | #include <mach/mux.h> | 25 | #include <mach/mux.h> |
@@ -102,6 +103,7 @@ static struct twl4030_hsmmc_info mmc[] = { | |||
102 | .cover_only = true, | 103 | .cover_only = true, |
103 | .gpio_cd = 160, | 104 | .gpio_cd = 160, |
104 | .gpio_wp = -EINVAL, | 105 | .gpio_wp = -EINVAL, |
106 | .power_saving = true, | ||
105 | }, | 107 | }, |
106 | { | 108 | { |
107 | .name = "internal", | 109 | .name = "internal", |
@@ -109,6 +111,8 @@ static struct twl4030_hsmmc_info mmc[] = { | |||
109 | .wires = 8, | 111 | .wires = 8, |
110 | .gpio_cd = -EINVAL, | 112 | .gpio_cd = -EINVAL, |
111 | .gpio_wp = -EINVAL, | 113 | .gpio_wp = -EINVAL, |
114 | .nonremovable = true, | ||
115 | .power_saving = true, | ||
112 | }, | 116 | }, |
113 | {} /* Terminator */ | 117 | {} /* Terminator */ |
114 | }; | 118 | }; |
@@ -282,7 +286,124 @@ static struct twl4030_usb_data rx51_usb_data = { | |||
282 | .usb_mode = T2_USB_MODE_ULPI, | 286 | .usb_mode = T2_USB_MODE_ULPI, |
283 | }; | 287 | }; |
284 | 288 | ||
285 | static struct twl4030_platform_data rx51_twldata = { | 289 | static struct twl4030_ins sleep_on_seq[] __initdata = { |
290 | /* | ||
291 | * Turn off VDD1 and VDD2. | ||
292 | */ | ||
293 | {MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_OFF), 4}, | ||
294 | {MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_OFF), 2}, | ||
295 | /* | ||
296 | * And also turn off the OMAP3 PLLs and the sysclk output. | ||
297 | */ | ||
298 | {MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_OFF), 3}, | ||
299 | {MSG_SINGULAR(DEV_GRP_P1, 0x17, RES_STATE_OFF), 3}, | ||
300 | }; | ||
301 | |||
302 | static struct twl4030_script sleep_on_script __initdata = { | ||
303 | .script = sleep_on_seq, | ||
304 | .size = ARRAY_SIZE(sleep_on_seq), | ||
305 | .flags = TWL4030_SLEEP_SCRIPT, | ||
306 | }; | ||
307 | |||
308 | static struct twl4030_ins wakeup_seq[] __initdata = { | ||
309 | /* | ||
310 | * Reenable the OMAP3 PLLs. | ||
311 | * Wakeup VDD1 and VDD2. | ||
312 | * Reenable sysclk output. | ||
313 | */ | ||
314 | {MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_ACTIVE), 0x30}, | ||
315 | {MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_ACTIVE), 0x30}, | ||
316 | {MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_ACTIVE), 0x37}, | ||
317 | {MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_ACTIVE), 3}, | ||
318 | }; | ||
319 | |||
320 | static struct twl4030_script wakeup_script __initdata = { | ||
321 | .script = wakeup_seq, | ||
322 | .size = ARRAY_SIZE(wakeup_seq), | ||
323 | .flags = TWL4030_WAKEUP12_SCRIPT, | ||
324 | }; | ||
325 | |||
326 | static struct twl4030_ins wakeup_p3_seq[] __initdata = { | ||
327 | /* | ||
328 | * Wakeup VDD1 (dummy to be able to insert a delay) | ||
329 | * Enable CLKEN | ||
330 | */ | ||
331 | {MSG_SINGULAR(DEV_GRP_P1, 0x17, RES_STATE_ACTIVE), 3}, | ||
332 | }; | ||
333 | |||
334 | static struct twl4030_script wakeup_p3_script __initdata = { | ||
335 | .script = wakeup_p3_seq, | ||
336 | .size = ARRAY_SIZE(wakeup_p3_seq), | ||
337 | .flags = TWL4030_WAKEUP3_SCRIPT, | ||
338 | }; | ||
339 | |||
340 | static struct twl4030_ins wrst_seq[] __initdata = { | ||
341 | /* | ||
342 | * Reset twl4030. | ||
343 | * Reset VDD1 regulator. | ||
344 | * Reset VDD2 regulator. | ||
345 | * Reset VPLL1 regulator. | ||
346 | * Enable sysclk output. | ||
347 | * Reenable twl4030. | ||
348 | */ | ||
349 | {MSG_SINGULAR(DEV_GRP_NULL, RES_RESET, RES_STATE_OFF), 2}, | ||
350 | {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, 0, 1, RES_STATE_ACTIVE), | ||
351 | 0x13}, | ||
352 | {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_PP, 0, 2, RES_STATE_WRST), 0x13}, | ||
353 | {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_PP, 0, 3, RES_STATE_OFF), 0x13}, | ||
354 | {MSG_SINGULAR(DEV_GRP_NULL, RES_VDD1, RES_STATE_WRST), 0x13}, | ||
355 | {MSG_SINGULAR(DEV_GRP_NULL, RES_VDD2, RES_STATE_WRST), 0x13}, | ||
356 | {MSG_SINGULAR(DEV_GRP_NULL, RES_VPLL1, RES_STATE_WRST), 0x35}, | ||
357 | {MSG_SINGULAR(DEV_GRP_P1, RES_HFCLKOUT, RES_STATE_ACTIVE), 2}, | ||
358 | {MSG_SINGULAR(DEV_GRP_NULL, RES_RESET, RES_STATE_ACTIVE), 2}, | ||
359 | }; | ||
360 | |||
361 | static struct twl4030_script wrst_script __initdata = { | ||
362 | .script = wrst_seq, | ||
363 | .size = ARRAY_SIZE(wrst_seq), | ||
364 | .flags = TWL4030_WRST_SCRIPT, | ||
365 | }; | ||
366 | |||
367 | static struct twl4030_script *twl4030_scripts[] __initdata = { | ||
368 | /* wakeup12 script should be loaded before sleep script, otherwise a | ||
369 | board might hit retention before loading of wakeup script is | ||
370 | completed. This can cause boot failures depending on timing issues. | ||
371 | */ | ||
372 | &wakeup_script, | ||
373 | &sleep_on_script, | ||
374 | &wakeup_p3_script, | ||
375 | &wrst_script, | ||
376 | }; | ||
377 | |||
378 | static struct twl4030_resconfig twl4030_rconfig[] __initdata = { | ||
379 | { .resource = RES_VINTANA1, .devgroup = -1, .type = -1, .type2 = 1 }, | ||
380 | { .resource = RES_VINTANA2, .devgroup = -1, .type = -1, .type2 = 1 }, | ||
381 | { .resource = RES_VINTDIG, .devgroup = -1, .type = -1, .type2 = 1 }, | ||
382 | { .resource = RES_VMMC1, .devgroup = -1, .type = -1, .type2 = 3}, | ||
383 | { .resource = RES_VMMC2, .devgroup = DEV_GRP_NULL, .type = -1, | ||
384 | .type2 = 3}, | ||
385 | { .resource = RES_VAUX1, .devgroup = -1, .type = -1, .type2 = 3}, | ||
386 | { .resource = RES_VAUX2, .devgroup = -1, .type = -1, .type2 = 3}, | ||
387 | { .resource = RES_VAUX3, .devgroup = -1, .type = -1, .type2 = 3}, | ||
388 | { .resource = RES_VAUX4, .devgroup = -1, .type = -1, .type2 = 3}, | ||
389 | { .resource = RES_VPLL2, .devgroup = -1, .type = -1, .type2 = 3}, | ||
390 | { .resource = RES_VDAC, .devgroup = -1, .type = -1, .type2 = 3}, | ||
391 | { .resource = RES_VSIM, .devgroup = DEV_GRP_NULL, .type = -1, | ||
392 | .type2 = 3}, | ||
393 | { .resource = RES_CLKEN, .devgroup = DEV_GRP_P3, .type = -1, | ||
394 | .type2 = 1 }, | ||
395 | { 0, 0}, | ||
396 | }; | ||
397 | |||
398 | static struct twl4030_power_data rx51_t2scripts_data __initdata = { | ||
399 | .scripts = twl4030_scripts, | ||
400 | .num = ARRAY_SIZE(twl4030_scripts), | ||
401 | .resource_config = twl4030_rconfig, | ||
402 | }; | ||
403 | |||
404 | |||
405 | |||
406 | static struct twl4030_platform_data rx51_twldata __initdata = { | ||
286 | .irq_base = TWL4030_IRQ_BASE, | 407 | .irq_base = TWL4030_IRQ_BASE, |
287 | .irq_end = TWL4030_IRQ_END, | 408 | .irq_end = TWL4030_IRQ_END, |
288 | 409 | ||
@@ -291,6 +412,7 @@ static struct twl4030_platform_data rx51_twldata = { | |||
291 | .keypad = &rx51_kp_data, | 412 | .keypad = &rx51_kp_data, |
292 | .madc = &rx51_madc_data, | 413 | .madc = &rx51_madc_data, |
293 | .usb = &rx51_usb_data, | 414 | .usb = &rx51_usb_data, |
415 | .power = &rx51_t2scripts_data, | ||
294 | 416 | ||
295 | .vaux1 = &rx51_vaux1, | 417 | .vaux1 = &rx51_vaux1, |
296 | .vaux2 = &rx51_vaux2, | 418 | .vaux2 = &rx51_vaux2, |