2 * linux/arch/arm/mach-omap2/board-rx51-peripherals.c
4 * Copyright (C) 2008-2009 Nokia
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
11 #include <linux/kernel.h>
12 #include <linux/init.h>
13 #include <linux/platform_device.h>
14 #include <linux/input.h>
15 #include <linux/input/matrix_keypad.h>
16 #include <linux/spi/spi.h>
17 #include <linux/spi/wl12xx.h>
18 #include <linux/i2c.h>
19 #include <linux/i2c/twl.h>
20 #include <linux/clk.h>
21 #include <linux/delay.h>
22 #include <linux/regulator/machine.h>
23 #include <linux/gpio.h>
24 #include <linux/gpio_keys.h>
25 #include <linux/mmc/host.h>
27 #include <plat/mcspi.h>
28 #include <plat/board.h>
29 #include <plat/common.h>
31 #include <plat/gpmc.h>
32 #include <plat/onenand.h>
33 #include <plat/gpmc-smc91x.h>
35 #include <sound/tlv320aic3x.h>
36 #include <sound/tpa6130a2-plat.h>
41 #define SYSTEM_REV_B_USES_VAUX3 0x1699
42 #define SYSTEM_REV_S_USES_VAUX3 0x8
44 #define RX51_WL1251_POWER_GPIO 87
45 #define RX51_WL1251_IRQ_GPIO 42
47 /* list all spi devices here */
50 RX51_SPI_MIPID, /* LCD panel */
51 RX51_SPI_TSC2005, /* Touch Controller */
54 static struct wl12xx_platform_data wl1251_pdata;
56 static struct omap2_mcspi_device_config wl1251_mcspi_config = {
61 static struct omap2_mcspi_device_config mipid_mcspi_config = {
66 static struct omap2_mcspi_device_config tsc2005_mcspi_config = {
71 static struct spi_board_info rx51_peripherals_spi_board_info[] __initdata = {
76 .max_speed_hz = 48000000,
78 .controller_data = &wl1251_mcspi_config,
79 .platform_data = &wl1251_pdata,
82 .modalias = "acx565akm",
85 .max_speed_hz = 6000000,
86 .controller_data = &mipid_mcspi_config,
88 [RX51_SPI_TSC2005] = {
89 .modalias = "tsc2005",
92 /* .irq = OMAP_GPIO_IRQ(RX51_TSC2005_IRQ_GPIO),*/
93 .max_speed_hz = 6000000,
94 .controller_data = &tsc2005_mcspi_config,
95 /* .platform_data = &tsc2005_config,*/
99 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
101 #define RX51_GPIO_CAMERA_LENS_COVER 110
102 #define RX51_GPIO_CAMERA_FOCUS 68
103 #define RX51_GPIO_CAMERA_CAPTURE 69
104 #define RX51_GPIO_KEYPAD_SLIDE 71
105 #define RX51_GPIO_LOCK_BUTTON 113
106 #define RX51_GPIO_PROXIMITY 89
108 #define RX51_GPIO_DEBOUNCE_TIMEOUT 10
110 static struct gpio_keys_button rx51_gpio_keys[] = {
112 .desc = "Camera Lens Cover",
114 .code = SW_CAMERA_LENS_COVER,
115 .gpio = RX51_GPIO_CAMERA_LENS_COVER,
117 .debounce_interval = RX51_GPIO_DEBOUNCE_TIMEOUT,
119 .desc = "Camera Focus",
121 .code = KEY_CAMERA_FOCUS,
122 .gpio = RX51_GPIO_CAMERA_FOCUS,
124 .debounce_interval = RX51_GPIO_DEBOUNCE_TIMEOUT,
126 .desc = "Camera Capture",
129 .gpio = RX51_GPIO_CAMERA_CAPTURE,
131 .debounce_interval = RX51_GPIO_DEBOUNCE_TIMEOUT,
133 .desc = "Lock Button",
135 .code = KEY_SCREENLOCK,
136 .gpio = RX51_GPIO_LOCK_BUTTON,
138 .debounce_interval = RX51_GPIO_DEBOUNCE_TIMEOUT,
140 .desc = "Keypad Slide",
142 .code = SW_KEYPAD_SLIDE,
143 .gpio = RX51_GPIO_KEYPAD_SLIDE,
145 .debounce_interval = RX51_GPIO_DEBOUNCE_TIMEOUT,
147 .desc = "Proximity Sensor",
149 .code = SW_FRONT_PROXIMITY,
150 .gpio = RX51_GPIO_PROXIMITY,
152 .debounce_interval = RX51_GPIO_DEBOUNCE_TIMEOUT,
156 static struct gpio_keys_platform_data rx51_gpio_keys_data = {
157 .buttons = rx51_gpio_keys,
158 .nbuttons = ARRAY_SIZE(rx51_gpio_keys),
161 static struct platform_device rx51_gpio_keys_device = {
165 .platform_data = &rx51_gpio_keys_data,
169 static void __init rx51_add_gpio_keys(void)
171 platform_device_register(&rx51_gpio_keys_device);
174 static void __init rx51_add_gpio_keys(void)
177 #endif /* CONFIG_KEYBOARD_GPIO || CONFIG_KEYBOARD_GPIO_MODULE */
179 static int board_keymap[] = {
183 KEY(0, 3, KEY_COMMA),
184 KEY(0, 4, KEY_BACKSPACE),
198 KEY(2, 3, KEY_ENTER),
207 KEY(3, 5, KEY_SPACE),
208 KEY(3, 6, KEY_SPACE),
212 KEY(4, 2, KEY_RIGHT),
213 KEY(4, 4, KEY_LEFTCTRL),
214 KEY(4, 5, KEY_RIGHTALT),
215 KEY(4, 6, KEY_LEFTSHIFT),
221 KEY(0xff, 2, KEY_F9),
222 KEY(0xff, 4, KEY_F10),
223 KEY(0xff, 5, KEY_F11),
226 static struct matrix_keymap_data board_map_data = {
227 .keymap = board_keymap,
228 .keymap_size = ARRAY_SIZE(board_keymap),
231 static struct twl4030_keypad_data rx51_kp_data = {
232 .keymap_data = &board_map_data,
238 static struct twl4030_madc_platform_data rx51_madc_data = {
242 /* Enable input logic and pull all lines up when eMMC is on. */
243 static struct omap_board_mux rx51_mmc2_on_mux[] = {
244 OMAP3_MUX(SDMMC2_CMD, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
245 OMAP3_MUX(SDMMC2_DAT0, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
246 OMAP3_MUX(SDMMC2_DAT1, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
247 OMAP3_MUX(SDMMC2_DAT2, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
248 OMAP3_MUX(SDMMC2_DAT3, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
249 OMAP3_MUX(SDMMC2_DAT4, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
250 OMAP3_MUX(SDMMC2_DAT5, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
251 OMAP3_MUX(SDMMC2_DAT6, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
252 OMAP3_MUX(SDMMC2_DAT7, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
253 { .reg_offset = OMAP_MUX_TERMINATOR },
256 /* Disable input logic and pull all lines down when eMMC is off. */
257 static struct omap_board_mux rx51_mmc2_off_mux[] = {
258 OMAP3_MUX(SDMMC2_CMD, OMAP_PULL_ENA | OMAP_MUX_MODE0),
259 OMAP3_MUX(SDMMC2_DAT0, OMAP_PULL_ENA | OMAP_MUX_MODE0),
260 OMAP3_MUX(SDMMC2_DAT1, OMAP_PULL_ENA | OMAP_MUX_MODE0),
261 OMAP3_MUX(SDMMC2_DAT2, OMAP_PULL_ENA | OMAP_MUX_MODE0),
262 OMAP3_MUX(SDMMC2_DAT3, OMAP_PULL_ENA | OMAP_MUX_MODE0),
263 OMAP3_MUX(SDMMC2_DAT4, OMAP_PULL_ENA | OMAP_MUX_MODE0),
264 OMAP3_MUX(SDMMC2_DAT5, OMAP_PULL_ENA | OMAP_MUX_MODE0),
265 OMAP3_MUX(SDMMC2_DAT6, OMAP_PULL_ENA | OMAP_MUX_MODE0),
266 OMAP3_MUX(SDMMC2_DAT7, OMAP_PULL_ENA | OMAP_MUX_MODE0),
267 { .reg_offset = OMAP_MUX_TERMINATOR },
271 * Current flows to eMMC when eMMC is off and the data lines are pulled up,
272 * so pull them down. N.B. we pull 8 lines because we are using 8 lines.
274 static void rx51_mmc2_remux(struct device *dev, int slot, int power_on)
277 omap_mux_write_array(rx51_mmc2_on_mux);
279 omap_mux_write_array(rx51_mmc2_off_mux);
282 static struct omap2_hsmmc_info mmc[] __initdata = {
290 .power_saving = true,
295 .wires = 8, /* See also rx51_mmc2_remux */
298 .nonremovable = true,
299 .power_saving = true,
300 .remux = rx51_mmc2_remux,
305 static struct regulator_consumer_supply rx51_vmmc1_supply =
306 REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.0");
308 static struct regulator_consumer_supply rx51_vaux3_supply =
309 REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1");
311 static struct regulator_consumer_supply rx51_vsim_supply =
312 REGULATOR_SUPPLY("vmmc_aux", "mmci-omap-hs.1");
314 static struct regulator_consumer_supply rx51_vmmc2_supplies[] = {
315 /* tlv320aic3x analog supplies */
316 REGULATOR_SUPPLY("AVDD", "2-0018"),
317 REGULATOR_SUPPLY("DRVDD", "2-0018"),
319 REGULATOR_SUPPLY("Vdd", "2-0060"),
320 /* Keep vmmc as last item. It is not iterated for newer boards */
321 REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1"),
324 static struct regulator_consumer_supply rx51_vio_supplies[] = {
325 /* tlv320aic3x digital supplies */
326 REGULATOR_SUPPLY("IOVDD", "2-0018"),
327 REGULATOR_SUPPLY("DVDD", "2-0018"),
330 #if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE)
331 extern struct platform_device rx51_display_device;
334 static struct regulator_consumer_supply rx51_vaux1_consumers[] = {
335 #if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE)
337 .supply = "vdds_sdi",
338 .dev = &rx51_display_device.dev,
343 static struct regulator_init_data rx51_vaux1 = {
348 .always_on = true, /* due battery cover sensor */
349 .valid_modes_mask = REGULATOR_MODE_NORMAL
350 | REGULATOR_MODE_STANDBY,
351 .valid_ops_mask = REGULATOR_CHANGE_MODE
352 | REGULATOR_CHANGE_STATUS,
354 .num_consumer_supplies = ARRAY_SIZE(rx51_vaux1_consumers),
355 .consumer_supplies = rx51_vaux1_consumers,
358 static struct regulator_init_data rx51_vaux2 = {
363 .valid_modes_mask = REGULATOR_MODE_NORMAL
364 | REGULATOR_MODE_STANDBY,
365 .valid_ops_mask = REGULATOR_CHANGE_MODE
366 | REGULATOR_CHANGE_STATUS,
370 /* VAUX3 - adds more power to VIO_18 rail */
371 static struct regulator_init_data rx51_vaux3_cam = {
373 .name = "VCAM_DIG_18",
377 .valid_modes_mask = REGULATOR_MODE_NORMAL
378 | REGULATOR_MODE_STANDBY,
379 .valid_ops_mask = REGULATOR_CHANGE_MODE
380 | REGULATOR_CHANGE_STATUS,
384 static struct regulator_init_data rx51_vaux3_mmc = {
390 .valid_modes_mask = REGULATOR_MODE_NORMAL
391 | REGULATOR_MODE_STANDBY,
392 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
393 | REGULATOR_CHANGE_MODE
394 | REGULATOR_CHANGE_STATUS,
396 .num_consumer_supplies = 1,
397 .consumer_supplies = &rx51_vaux3_supply,
400 static struct regulator_init_data rx51_vaux4 = {
402 .name = "VCAM_ANA_28",
406 .valid_modes_mask = REGULATOR_MODE_NORMAL
407 | REGULATOR_MODE_STANDBY,
408 .valid_ops_mask = REGULATOR_CHANGE_MODE
409 | REGULATOR_CHANGE_STATUS,
413 static struct regulator_init_data rx51_vmmc1 = {
417 .valid_modes_mask = REGULATOR_MODE_NORMAL
418 | REGULATOR_MODE_STANDBY,
419 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
420 | REGULATOR_CHANGE_MODE
421 | REGULATOR_CHANGE_STATUS,
423 .num_consumer_supplies = 1,
424 .consumer_supplies = &rx51_vmmc1_supply,
427 static struct regulator_init_data rx51_vmmc2 = {
433 .valid_modes_mask = REGULATOR_MODE_NORMAL
434 | REGULATOR_MODE_STANDBY,
435 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
436 | REGULATOR_CHANGE_MODE
437 | REGULATOR_CHANGE_STATUS,
439 .num_consumer_supplies = ARRAY_SIZE(rx51_vmmc2_supplies),
440 .consumer_supplies = rx51_vmmc2_supplies,
443 static struct regulator_init_data rx51_vsim = {
445 .name = "VMMC2_IO_18",
449 .valid_modes_mask = REGULATOR_MODE_NORMAL
450 | REGULATOR_MODE_STANDBY,
451 .valid_ops_mask = REGULATOR_CHANGE_MODE
452 | REGULATOR_CHANGE_STATUS,
454 .num_consumer_supplies = 1,
455 .consumer_supplies = &rx51_vsim_supply,
458 static struct regulator_init_data rx51_vdac = {
462 .valid_modes_mask = REGULATOR_MODE_NORMAL
463 | REGULATOR_MODE_STANDBY,
464 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
465 | REGULATOR_CHANGE_MODE
466 | REGULATOR_CHANGE_STATUS,
470 static struct regulator_init_data rx51_vio = {
474 .valid_modes_mask = REGULATOR_MODE_NORMAL
475 | REGULATOR_MODE_STANDBY,
476 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
477 | REGULATOR_CHANGE_MODE
478 | REGULATOR_CHANGE_STATUS,
480 .num_consumer_supplies = ARRAY_SIZE(rx51_vio_supplies),
481 .consumer_supplies = rx51_vio_supplies,
484 static int rx51_twlgpio_setup(struct device *dev, unsigned gpio, unsigned n)
486 /* FIXME this gpio setup is just a placeholder for now */
487 gpio_request(gpio + 6, "backlight_pwm");
488 gpio_direction_output(gpio + 6, 0);
489 gpio_request(gpio + 7, "speaker_en");
490 gpio_direction_output(gpio + 7, 1);
495 static struct twl4030_gpio_platform_data rx51_gpio_data = {
496 .gpio_base = OMAP_MAX_GPIO_LINES,
497 .irq_base = TWL4030_GPIO_IRQ_BASE,
498 .irq_end = TWL4030_GPIO_IRQ_END,
499 .pulldowns = BIT(0) | BIT(1) | BIT(2) | BIT(3)
501 | BIT(8) | BIT(9) | BIT(10) | BIT(11)
502 | BIT(12) | BIT(13) | BIT(14) | BIT(15)
503 | BIT(16) | BIT(17) ,
504 .setup = rx51_twlgpio_setup,
507 static struct twl4030_usb_data rx51_usb_data = {
508 .usb_mode = T2_USB_MODE_ULPI,
511 static struct twl4030_ins sleep_on_seq[] __initdata = {
513 * Turn off everything
515 {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, 1, 0, RES_STATE_SLEEP), 2},
518 static struct twl4030_script sleep_on_script __initdata = {
519 .script = sleep_on_seq,
520 .size = ARRAY_SIZE(sleep_on_seq),
521 .flags = TWL4030_SLEEP_SCRIPT,
524 static struct twl4030_ins wakeup_seq[] __initdata = {
526 * Reenable everything
528 {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, 1, 0, RES_STATE_ACTIVE), 2},
531 static struct twl4030_script wakeup_script __initdata = {
532 .script = wakeup_seq,
533 .size = ARRAY_SIZE(wakeup_seq),
534 .flags = TWL4030_WAKEUP12_SCRIPT,
537 static struct twl4030_ins wakeup_p3_seq[] __initdata = {
539 * Reenable everything
541 {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, 1, 0, RES_STATE_ACTIVE), 2},
544 static struct twl4030_script wakeup_p3_script __initdata = {
545 .script = wakeup_p3_seq,
546 .size = ARRAY_SIZE(wakeup_p3_seq),
547 .flags = TWL4030_WAKEUP3_SCRIPT,
550 static struct twl4030_ins wrst_seq[] __initdata = {
553 * Reset VDD1 regulator.
554 * Reset VDD2 regulator.
555 * Reset VPLL1 regulator.
556 * Enable sysclk output.
559 {MSG_SINGULAR(DEV_GRP_NULL, RES_RESET, RES_STATE_OFF), 2},
560 {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, 0, 1, RES_STATE_ACTIVE),
562 {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_PP, 0, 3, RES_STATE_OFF), 0x13},
563 {MSG_SINGULAR(DEV_GRP_NULL, RES_VDD1, RES_STATE_WRST), 0x13},
564 {MSG_SINGULAR(DEV_GRP_NULL, RES_VDD2, RES_STATE_WRST), 0x13},
565 {MSG_SINGULAR(DEV_GRP_NULL, RES_VPLL1, RES_STATE_WRST), 0x35},
566 {MSG_SINGULAR(DEV_GRP_P3, RES_HFCLKOUT, RES_STATE_ACTIVE), 2},
567 {MSG_SINGULAR(DEV_GRP_NULL, RES_RESET, RES_STATE_ACTIVE), 2},
570 static struct twl4030_script wrst_script __initdata = {
572 .size = ARRAY_SIZE(wrst_seq),
573 .flags = TWL4030_WRST_SCRIPT,
576 static struct twl4030_script *twl4030_scripts[] __initdata = {
577 /* wakeup12 script should be loaded before sleep script, otherwise a
578 board might hit retention before loading of wakeup script is
579 completed. This can cause boot failures depending on timing issues.
587 static struct twl4030_resconfig twl4030_rconfig[] __initdata = {
588 { .resource = RES_VDD1, .devgroup = -1,
589 .type = 1, .type2 = -1, .remap_off = RES_STATE_OFF,
590 .remap_sleep = RES_STATE_OFF
592 { .resource = RES_VDD2, .devgroup = -1,
593 .type = 1, .type2 = -1, .remap_off = RES_STATE_OFF,
594 .remap_sleep = RES_STATE_OFF
596 { .resource = RES_VPLL1, .devgroup = -1,
597 .type = 1, .type2 = -1, .remap_off = RES_STATE_OFF,
598 .remap_sleep = RES_STATE_OFF
600 { .resource = RES_VPLL2, .devgroup = -1,
601 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
603 { .resource = RES_VAUX1, .devgroup = -1,
604 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
606 { .resource = RES_VAUX2, .devgroup = -1,
607 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
609 { .resource = RES_VAUX3, .devgroup = -1,
610 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
612 { .resource = RES_VAUX4, .devgroup = -1,
613 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
615 { .resource = RES_VMMC1, .devgroup = -1,
616 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
618 { .resource = RES_VMMC2, .devgroup = -1,
619 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
621 { .resource = RES_VDAC, .devgroup = -1,
622 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
624 { .resource = RES_VSIM, .devgroup = -1,
625 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
627 { .resource = RES_VINTANA1, .devgroup = DEV_GRP_P1 | DEV_GRP_P3,
628 .type = -1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
630 { .resource = RES_VINTANA2, .devgroup = DEV_GRP_P1 | DEV_GRP_P3,
631 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
633 { .resource = RES_VINTDIG, .devgroup = DEV_GRP_P1 | DEV_GRP_P3,
634 .type = -1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
636 { .resource = RES_VIO, .devgroup = DEV_GRP_P3,
637 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
639 { .resource = RES_CLKEN, .devgroup = DEV_GRP_P1 | DEV_GRP_P3,
640 .type = 1, .type2 = -1 , .remap_off = -1, .remap_sleep = -1
642 { .resource = RES_REGEN, .devgroup = DEV_GRP_P1 | DEV_GRP_P3,
643 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
645 { .resource = RES_NRES_PWRON, .devgroup = DEV_GRP_P1 | DEV_GRP_P3,
646 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
648 { .resource = RES_SYSEN, .devgroup = DEV_GRP_P1 | DEV_GRP_P3,
649 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
651 { .resource = RES_HFCLKOUT, .devgroup = DEV_GRP_P3,
652 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
654 { .resource = RES_32KCLKOUT, .devgroup = -1,
655 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
657 { .resource = RES_RESET, .devgroup = -1,
658 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
660 { .resource = RES_Main_Ref, .devgroup = -1,
661 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
666 static struct twl4030_power_data rx51_t2scripts_data __initdata = {
667 .scripts = twl4030_scripts,
668 .num = ARRAY_SIZE(twl4030_scripts),
669 .resource_config = twl4030_rconfig,
674 static struct twl4030_platform_data rx51_twldata __initdata = {
675 .irq_base = TWL4030_IRQ_BASE,
676 .irq_end = TWL4030_IRQ_END,
678 /* platform_data for children goes here */
679 .gpio = &rx51_gpio_data,
680 .keypad = &rx51_kp_data,
681 .madc = &rx51_madc_data,
682 .usb = &rx51_usb_data,
683 .power = &rx51_t2scripts_data,
685 .vaux1 = &rx51_vaux1,
686 .vaux2 = &rx51_vaux2,
687 .vaux4 = &rx51_vaux4,
688 .vmmc1 = &rx51_vmmc1,
694 static struct aic3x_pdata rx51_aic3x_data __initdata = {
698 static struct tpa6130a2_platform_data rx51_tpa6130a2_data __initdata = {
703 static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_1[] = {
705 I2C_BOARD_INFO("twl5030", 0x48),
706 .flags = I2C_CLIENT_WAKE,
707 .irq = INT_34XX_SYS_NIRQ,
708 .platform_data = &rx51_twldata,
712 static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_2[] = {
714 I2C_BOARD_INFO("tlv320aic3x", 0x18),
715 .platform_data = &rx51_aic3x_data,
718 I2C_BOARD_INFO("tpa6130a2", 0x60),
719 .platform_data = &rx51_tpa6130a2_data,
723 static int __init rx51_i2c_init(void)
725 if ((system_rev >= SYSTEM_REV_S_USES_VAUX3 && system_rev < 0x100) ||
726 system_rev >= SYSTEM_REV_B_USES_VAUX3) {
727 rx51_twldata.vaux3 = &rx51_vaux3_mmc;
728 /* Only older boards use VMMC2 for internal MMC */
729 rx51_vmmc2.num_consumer_supplies--;
731 rx51_twldata.vaux3 = &rx51_vaux3_cam;
733 rx51_twldata.vmmc2 = &rx51_vmmc2;
734 omap_register_i2c_bus(1, 2200, rx51_peripherals_i2c_board_info_1,
735 ARRAY_SIZE(rx51_peripherals_i2c_board_info_1));
736 omap_register_i2c_bus(2, 100, rx51_peripherals_i2c_board_info_2,
737 ARRAY_SIZE(rx51_peripherals_i2c_board_info_2));
738 omap_register_i2c_bus(3, 400, NULL, 0);
742 #if defined(CONFIG_MTD_ONENAND_OMAP2) || \
743 defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
745 static struct mtd_partition onenand_partitions[] = {
747 .name = "bootloader",
750 .mask_flags = MTD_WRITEABLE, /* Force read-only */
754 .offset = MTDPART_OFS_APPEND,
759 .offset = MTDPART_OFS_APPEND,
764 .offset = MTDPART_OFS_APPEND,
769 .offset = MTDPART_OFS_APPEND,
774 .offset = MTDPART_OFS_APPEND,
775 .size = MTDPART_SIZ_FULL,
779 static struct omap_onenand_platform_data board_onenand_data = {
782 .parts = onenand_partitions,
783 .nr_parts = ARRAY_SIZE(onenand_partitions),
784 .flags = ONENAND_SYNC_READWRITE,
787 static void __init board_onenand_init(void)
789 gpmc_onenand_init(&board_onenand_data);
794 static inline void board_onenand_init(void)
800 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
802 static struct omap_smc91x_platform_data board_smc91x_data = {
807 .flags = GPMC_TIMINGS_SMC91C96 | IORESOURCE_IRQ_HIGHLEVEL,
810 static void __init board_smc91x_init(void)
812 omap_mux_init_gpio(54, OMAP_PIN_INPUT_PULLDOWN);
813 omap_mux_init_gpio(86, OMAP_PIN_OUTPUT);
814 omap_mux_init_gpio(164, OMAP_PIN_OUTPUT);
816 gpmc_smc91x_init(&board_smc91x_data);
821 static inline void board_smc91x_init(void)
827 static void rx51_wl1251_set_power(bool enable)
829 gpio_set_value(RX51_WL1251_POWER_GPIO, enable);
832 static void __init rx51_init_wl1251(void)
836 ret = gpio_request(RX51_WL1251_POWER_GPIO, "wl1251 power");
840 ret = gpio_direction_output(RX51_WL1251_POWER_GPIO, 0);
844 ret = gpio_request(RX51_WL1251_IRQ_GPIO, "wl1251 irq");
848 ret = gpio_direction_input(RX51_WL1251_IRQ_GPIO);
852 irq = gpio_to_irq(RX51_WL1251_IRQ_GPIO);
856 wl1251_pdata.set_power = rx51_wl1251_set_power;
857 rx51_peripherals_spi_board_info[RX51_SPI_WL1251].irq = irq;
862 gpio_free(RX51_WL1251_IRQ_GPIO);
865 gpio_free(RX51_WL1251_POWER_GPIO);
868 printk(KERN_ERR "wl1251 board initialisation failed\n");
869 wl1251_pdata.set_power = NULL;
872 * Now rx51_peripherals_spi_board_info[1].irq is zero and
873 * set_power is null, and wl1251_probe() will fail.
877 void __init rx51_peripherals_init(void)
880 board_onenand_init();
882 rx51_add_gpio_keys();
884 spi_register_board_info(rx51_peripherals_spi_board_info,
885 ARRAY_SIZE(rx51_peripherals_spi_board_info));
886 omap2_hsmmc_init(mmc);