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>
38 #define SYSTEM_REV_B_USES_VAUX3 0x1699
39 #define SYSTEM_REV_S_USES_VAUX3 0x8
41 #define RX51_WL1251_POWER_GPIO 87
42 #define RX51_WL1251_IRQ_GPIO 42
44 /* list all spi devices here */
47 RX51_SPI_MIPID, /* LCD panel */
48 RX51_SPI_TSC2005, /* Touch Controller */
51 static struct wl12xx_platform_data wl1251_pdata;
53 static struct omap2_mcspi_device_config wl1251_mcspi_config = {
58 static struct omap2_mcspi_device_config mipid_mcspi_config = {
63 static struct omap2_mcspi_device_config tsc2005_mcspi_config = {
68 static struct spi_board_info rx51_peripherals_spi_board_info[] __initdata = {
73 .max_speed_hz = 48000000,
75 .controller_data = &wl1251_mcspi_config,
76 .platform_data = &wl1251_pdata,
79 .modalias = "acx565akm",
82 .max_speed_hz = 6000000,
83 .controller_data = &mipid_mcspi_config,
85 [RX51_SPI_TSC2005] = {
86 .modalias = "tsc2005",
89 /* .irq = OMAP_GPIO_IRQ(RX51_TSC2005_IRQ_GPIO),*/
90 .max_speed_hz = 6000000,
91 .controller_data = &tsc2005_mcspi_config,
92 /* .platform_data = &tsc2005_config,*/
96 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
98 #define RX51_GPIO_CAMERA_LENS_COVER 110
99 #define RX51_GPIO_CAMERA_FOCUS 68
100 #define RX51_GPIO_CAMERA_CAPTURE 69
101 #define RX51_GPIO_KEYPAD_SLIDE 71
102 #define RX51_GPIO_LOCK_BUTTON 113
103 #define RX51_GPIO_PROXIMITY 89
105 #define RX51_GPIO_DEBOUNCE_TIMEOUT 10
107 static struct gpio_keys_button rx51_gpio_keys[] = {
109 .desc = "Camera Lens Cover",
111 .code = SW_CAMERA_LENS_COVER,
112 .gpio = RX51_GPIO_CAMERA_LENS_COVER,
114 .debounce_interval = RX51_GPIO_DEBOUNCE_TIMEOUT,
116 .desc = "Camera Focus",
118 .code = KEY_CAMERA_FOCUS,
119 .gpio = RX51_GPIO_CAMERA_FOCUS,
121 .debounce_interval = RX51_GPIO_DEBOUNCE_TIMEOUT,
123 .desc = "Camera Capture",
126 .gpio = RX51_GPIO_CAMERA_CAPTURE,
128 .debounce_interval = RX51_GPIO_DEBOUNCE_TIMEOUT,
130 .desc = "Lock Button",
132 .code = KEY_SCREENLOCK,
133 .gpio = RX51_GPIO_LOCK_BUTTON,
135 .debounce_interval = RX51_GPIO_DEBOUNCE_TIMEOUT,
137 .desc = "Keypad Slide",
139 .code = SW_KEYPAD_SLIDE,
140 .gpio = RX51_GPIO_KEYPAD_SLIDE,
142 .debounce_interval = RX51_GPIO_DEBOUNCE_TIMEOUT,
144 .desc = "Proximity Sensor",
146 .code = SW_FRONT_PROXIMITY,
147 .gpio = RX51_GPIO_PROXIMITY,
149 .debounce_interval = RX51_GPIO_DEBOUNCE_TIMEOUT,
153 static struct gpio_keys_platform_data rx51_gpio_keys_data = {
154 .buttons = rx51_gpio_keys,
155 .nbuttons = ARRAY_SIZE(rx51_gpio_keys),
158 static struct platform_device rx51_gpio_keys_device = {
162 .platform_data = &rx51_gpio_keys_data,
166 static void __init rx51_add_gpio_keys(void)
168 platform_device_register(&rx51_gpio_keys_device);
171 static void __init rx51_add_gpio_keys(void)
174 #endif /* CONFIG_KEYBOARD_GPIO || CONFIG_KEYBOARD_GPIO_MODULE */
176 static int board_keymap[] = {
180 KEY(0, 3, KEY_COMMA),
181 KEY(0, 4, KEY_BACKSPACE),
195 KEY(2, 3, KEY_ENTER),
204 KEY(3, 5, KEY_SPACE),
205 KEY(3, 6, KEY_SPACE),
209 KEY(4, 2, KEY_RIGHT),
210 KEY(4, 4, KEY_LEFTCTRL),
211 KEY(4, 5, KEY_RIGHTALT),
212 KEY(4, 6, KEY_LEFTSHIFT),
218 KEY(0xff, 2, KEY_F9),
219 KEY(0xff, 4, KEY_F10),
220 KEY(0xff, 5, KEY_F11),
223 static struct matrix_keymap_data board_map_data = {
224 .keymap = board_keymap,
225 .keymap_size = ARRAY_SIZE(board_keymap),
228 static struct twl4030_keypad_data rx51_kp_data = {
229 .keymap_data = &board_map_data,
235 static struct twl4030_madc_platform_data rx51_madc_data = {
239 /* Enable input logic and pull all lines up when eMMC is on. */
240 static struct omap_board_mux rx51_mmc2_on_mux[] = {
241 OMAP3_MUX(SDMMC2_CMD, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
242 OMAP3_MUX(SDMMC2_DAT0, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
243 OMAP3_MUX(SDMMC2_DAT1, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
244 OMAP3_MUX(SDMMC2_DAT2, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
245 OMAP3_MUX(SDMMC2_DAT3, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
246 OMAP3_MUX(SDMMC2_DAT4, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
247 OMAP3_MUX(SDMMC2_DAT5, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
248 OMAP3_MUX(SDMMC2_DAT6, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
249 OMAP3_MUX(SDMMC2_DAT7, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
250 { .reg_offset = OMAP_MUX_TERMINATOR },
253 /* Disable input logic and pull all lines down when eMMC is off. */
254 static struct omap_board_mux rx51_mmc2_off_mux[] = {
255 OMAP3_MUX(SDMMC2_CMD, OMAP_PULL_ENA | OMAP_MUX_MODE0),
256 OMAP3_MUX(SDMMC2_DAT0, OMAP_PULL_ENA | OMAP_MUX_MODE0),
257 OMAP3_MUX(SDMMC2_DAT1, OMAP_PULL_ENA | OMAP_MUX_MODE0),
258 OMAP3_MUX(SDMMC2_DAT2, OMAP_PULL_ENA | OMAP_MUX_MODE0),
259 OMAP3_MUX(SDMMC2_DAT3, OMAP_PULL_ENA | OMAP_MUX_MODE0),
260 OMAP3_MUX(SDMMC2_DAT4, OMAP_PULL_ENA | OMAP_MUX_MODE0),
261 OMAP3_MUX(SDMMC2_DAT5, OMAP_PULL_ENA | OMAP_MUX_MODE0),
262 OMAP3_MUX(SDMMC2_DAT6, OMAP_PULL_ENA | OMAP_MUX_MODE0),
263 OMAP3_MUX(SDMMC2_DAT7, OMAP_PULL_ENA | OMAP_MUX_MODE0),
264 { .reg_offset = OMAP_MUX_TERMINATOR },
268 * Current flows to eMMC when eMMC is off and the data lines are pulled up,
269 * so pull them down. N.B. we pull 8 lines because we are using 8 lines.
271 static void rx51_mmc2_remux(struct device *dev, int slot, int power_on)
274 omap_mux_write_array(rx51_mmc2_on_mux);
276 omap_mux_write_array(rx51_mmc2_off_mux);
279 static struct omap2_hsmmc_info mmc[] __initdata = {
287 .power_saving = true,
292 .wires = 8, /* See also rx51_mmc2_remux */
295 .nonremovable = true,
296 .power_saving = true,
297 .remux = rx51_mmc2_remux,
302 static struct regulator_consumer_supply rx51_vmmc1_supply = {
304 .dev_name = "mmci-omap-hs.0",
307 static struct regulator_consumer_supply rx51_vaux3_supply = {
309 .dev_name = "mmci-omap-hs.1",
312 static struct regulator_consumer_supply rx51_vsim_supply = {
313 .supply = "vmmc_aux",
314 .dev_name = "mmci-omap-hs.1",
317 static struct regulator_consumer_supply rx51_vmmc2_supplies[] = {
318 /* tlv320aic3x analog supplies */
321 .dev_name = "2-0018",
325 .dev_name = "2-0018",
327 /* Keep vmmc as last item. It is not iterated for newer boards */
330 .dev_name = "mmci-omap-hs.1",
334 static struct regulator_consumer_supply rx51_vio_supplies[] = {
335 /* tlv320aic3x digital supplies */
346 #if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE)
347 extern struct platform_device rx51_display_device;
350 static struct regulator_consumer_supply rx51_vaux1_consumers[] = {
351 #if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE)
353 .supply = "vdds_sdi",
354 .dev = &rx51_display_device.dev,
359 static struct regulator_init_data rx51_vaux1 = {
364 .valid_modes_mask = REGULATOR_MODE_NORMAL
365 | REGULATOR_MODE_STANDBY,
366 .valid_ops_mask = REGULATOR_CHANGE_MODE
367 | REGULATOR_CHANGE_STATUS,
369 .num_consumer_supplies = ARRAY_SIZE(rx51_vaux1_consumers),
370 .consumer_supplies = rx51_vaux1_consumers,
373 static struct regulator_init_data rx51_vaux2 = {
378 .valid_modes_mask = REGULATOR_MODE_NORMAL
379 | REGULATOR_MODE_STANDBY,
380 .valid_ops_mask = REGULATOR_CHANGE_MODE
381 | REGULATOR_CHANGE_STATUS,
385 /* VAUX3 - adds more power to VIO_18 rail */
386 static struct regulator_init_data rx51_vaux3_cam = {
388 .name = "VCAM_DIG_18",
392 .valid_modes_mask = REGULATOR_MODE_NORMAL
393 | REGULATOR_MODE_STANDBY,
394 .valid_ops_mask = REGULATOR_CHANGE_MODE
395 | REGULATOR_CHANGE_STATUS,
399 static struct regulator_init_data rx51_vaux3_mmc = {
405 .valid_modes_mask = REGULATOR_MODE_NORMAL
406 | REGULATOR_MODE_STANDBY,
407 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
408 | REGULATOR_CHANGE_MODE
409 | REGULATOR_CHANGE_STATUS,
411 .num_consumer_supplies = 1,
412 .consumer_supplies = &rx51_vaux3_supply,
415 static struct regulator_init_data rx51_vaux4 = {
417 .name = "VCAM_ANA_28",
421 .valid_modes_mask = REGULATOR_MODE_NORMAL
422 | REGULATOR_MODE_STANDBY,
423 .valid_ops_mask = REGULATOR_CHANGE_MODE
424 | REGULATOR_CHANGE_STATUS,
428 static struct regulator_init_data rx51_vmmc1 = {
432 .valid_modes_mask = REGULATOR_MODE_NORMAL
433 | REGULATOR_MODE_STANDBY,
434 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
435 | REGULATOR_CHANGE_MODE
436 | REGULATOR_CHANGE_STATUS,
438 .num_consumer_supplies = 1,
439 .consumer_supplies = &rx51_vmmc1_supply,
442 static struct regulator_init_data rx51_vmmc2 = {
448 .valid_modes_mask = REGULATOR_MODE_NORMAL
449 | REGULATOR_MODE_STANDBY,
450 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
451 | REGULATOR_CHANGE_MODE
452 | REGULATOR_CHANGE_STATUS,
454 .num_consumer_supplies = ARRAY_SIZE(rx51_vmmc2_supplies),
455 .consumer_supplies = rx51_vmmc2_supplies,
458 static struct regulator_init_data rx51_vsim = {
460 .name = "VMMC2_IO_18",
464 .valid_modes_mask = REGULATOR_MODE_NORMAL
465 | REGULATOR_MODE_STANDBY,
466 .valid_ops_mask = REGULATOR_CHANGE_MODE
467 | REGULATOR_CHANGE_STATUS,
469 .num_consumer_supplies = 1,
470 .consumer_supplies = &rx51_vsim_supply,
473 static struct regulator_init_data rx51_vdac = {
477 .valid_modes_mask = REGULATOR_MODE_NORMAL
478 | REGULATOR_MODE_STANDBY,
479 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
480 | REGULATOR_CHANGE_MODE
481 | REGULATOR_CHANGE_STATUS,
485 static struct regulator_init_data rx51_vio = {
489 .valid_modes_mask = REGULATOR_MODE_NORMAL
490 | REGULATOR_MODE_STANDBY,
491 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
492 | REGULATOR_CHANGE_MODE
493 | REGULATOR_CHANGE_STATUS,
495 .num_consumer_supplies = ARRAY_SIZE(rx51_vio_supplies),
496 .consumer_supplies = rx51_vio_supplies,
499 static int rx51_twlgpio_setup(struct device *dev, unsigned gpio, unsigned n)
501 /* FIXME this gpio setup is just a placeholder for now */
502 gpio_request(gpio + 6, "backlight_pwm");
503 gpio_direction_output(gpio + 6, 0);
504 gpio_request(gpio + 7, "speaker_en");
505 gpio_direction_output(gpio + 7, 1);
510 static struct twl4030_gpio_platform_data rx51_gpio_data = {
511 .gpio_base = OMAP_MAX_GPIO_LINES,
512 .irq_base = TWL4030_GPIO_IRQ_BASE,
513 .irq_end = TWL4030_GPIO_IRQ_END,
514 .pulldowns = BIT(0) | BIT(1) | BIT(2) | BIT(3)
516 | BIT(8) | BIT(9) | BIT(10) | BIT(11)
517 | BIT(12) | BIT(13) | BIT(14) | BIT(15)
518 | BIT(16) | BIT(17) ,
519 .setup = rx51_twlgpio_setup,
522 static struct twl4030_usb_data rx51_usb_data = {
523 .usb_mode = T2_USB_MODE_ULPI,
526 static struct twl4030_ins sleep_on_seq[] __initdata = {
528 * Turn off everything
530 {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, 1, 0, RES_STATE_SLEEP), 2},
533 static struct twl4030_script sleep_on_script __initdata = {
534 .script = sleep_on_seq,
535 .size = ARRAY_SIZE(sleep_on_seq),
536 .flags = TWL4030_SLEEP_SCRIPT,
539 static struct twl4030_ins wakeup_seq[] __initdata = {
541 * Reenable everything
543 {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, 1, 0, RES_STATE_ACTIVE), 2},
546 static struct twl4030_script wakeup_script __initdata = {
547 .script = wakeup_seq,
548 .size = ARRAY_SIZE(wakeup_seq),
549 .flags = TWL4030_WAKEUP12_SCRIPT,
552 static struct twl4030_ins wakeup_p3_seq[] __initdata = {
554 * Reenable everything
556 {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, 1, 0, RES_STATE_ACTIVE), 2},
559 static struct twl4030_script wakeup_p3_script __initdata = {
560 .script = wakeup_p3_seq,
561 .size = ARRAY_SIZE(wakeup_p3_seq),
562 .flags = TWL4030_WAKEUP3_SCRIPT,
565 static struct twl4030_ins wrst_seq[] __initdata = {
568 * Reset VDD1 regulator.
569 * Reset VDD2 regulator.
570 * Reset VPLL1 regulator.
571 * Enable sysclk output.
574 {MSG_SINGULAR(DEV_GRP_NULL, RES_RESET, RES_STATE_OFF), 2},
575 {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, 0, 1, RES_STATE_ACTIVE),
577 {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_PP, 0, 3, RES_STATE_OFF), 0x13},
578 {MSG_SINGULAR(DEV_GRP_NULL, RES_VDD1, RES_STATE_WRST), 0x13},
579 {MSG_SINGULAR(DEV_GRP_NULL, RES_VDD2, RES_STATE_WRST), 0x13},
580 {MSG_SINGULAR(DEV_GRP_NULL, RES_VPLL1, RES_STATE_WRST), 0x35},
581 {MSG_SINGULAR(DEV_GRP_P3, RES_HFCLKOUT, RES_STATE_ACTIVE), 2},
582 {MSG_SINGULAR(DEV_GRP_NULL, RES_RESET, RES_STATE_ACTIVE), 2},
585 static struct twl4030_script wrst_script __initdata = {
587 .size = ARRAY_SIZE(wrst_seq),
588 .flags = TWL4030_WRST_SCRIPT,
591 static struct twl4030_script *twl4030_scripts[] __initdata = {
592 /* wakeup12 script should be loaded before sleep script, otherwise a
593 board might hit retention before loading of wakeup script is
594 completed. This can cause boot failures depending on timing issues.
602 static struct twl4030_resconfig twl4030_rconfig[] __initdata = {
603 { .resource = RES_VDD1, .devgroup = -1,
604 .type = 1, .type2 = -1, .remap_off = RES_STATE_OFF,
605 .remap_sleep = RES_STATE_OFF
607 { .resource = RES_VDD2, .devgroup = -1,
608 .type = 1, .type2 = -1, .remap_off = RES_STATE_OFF,
609 .remap_sleep = RES_STATE_OFF
611 { .resource = RES_VPLL1, .devgroup = -1,
612 .type = 1, .type2 = -1, .remap_off = RES_STATE_OFF,
613 .remap_sleep = RES_STATE_OFF
615 { .resource = RES_VPLL2, .devgroup = -1,
616 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
618 { .resource = RES_VAUX1, .devgroup = -1,
619 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
621 { .resource = RES_VAUX2, .devgroup = -1,
622 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
624 { .resource = RES_VAUX3, .devgroup = -1,
625 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
627 { .resource = RES_VAUX4, .devgroup = -1,
628 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
630 { .resource = RES_VMMC1, .devgroup = -1,
631 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
633 { .resource = RES_VMMC2, .devgroup = -1,
634 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
636 { .resource = RES_VDAC, .devgroup = -1,
637 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
639 { .resource = RES_VSIM, .devgroup = -1,
640 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
642 { .resource = RES_VINTANA1, .devgroup = DEV_GRP_P1 | DEV_GRP_P3,
643 .type = -1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
645 { .resource = RES_VINTANA2, .devgroup = DEV_GRP_P1 | DEV_GRP_P3,
646 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
648 { .resource = RES_VINTDIG, .devgroup = DEV_GRP_P1 | DEV_GRP_P3,
649 .type = -1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
651 { .resource = RES_VIO, .devgroup = DEV_GRP_P3,
652 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
654 { .resource = RES_CLKEN, .devgroup = DEV_GRP_P1 | DEV_GRP_P3,
655 .type = 1, .type2 = -1 , .remap_off = -1, .remap_sleep = -1
657 { .resource = RES_REGEN, .devgroup = DEV_GRP_P1 | DEV_GRP_P3,
658 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
660 { .resource = RES_NRES_PWRON, .devgroup = DEV_GRP_P1 | DEV_GRP_P3,
661 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
663 { .resource = RES_SYSEN, .devgroup = DEV_GRP_P1 | DEV_GRP_P3,
664 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
666 { .resource = RES_HFCLKOUT, .devgroup = DEV_GRP_P3,
667 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
669 { .resource = RES_32KCLKOUT, .devgroup = -1,
670 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
672 { .resource = RES_RESET, .devgroup = -1,
673 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
675 { .resource = RES_Main_Ref, .devgroup = -1,
676 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
681 static struct twl4030_power_data rx51_t2scripts_data __initdata = {
682 .scripts = twl4030_scripts,
683 .num = ARRAY_SIZE(twl4030_scripts),
684 .resource_config = twl4030_rconfig,
689 static struct twl4030_platform_data rx51_twldata __initdata = {
690 .irq_base = TWL4030_IRQ_BASE,
691 .irq_end = TWL4030_IRQ_END,
693 /* platform_data for children goes here */
694 .gpio = &rx51_gpio_data,
695 .keypad = &rx51_kp_data,
696 .madc = &rx51_madc_data,
697 .usb = &rx51_usb_data,
698 .power = &rx51_t2scripts_data,
700 .vaux1 = &rx51_vaux1,
701 .vaux2 = &rx51_vaux2,
702 .vaux4 = &rx51_vaux4,
703 .vmmc1 = &rx51_vmmc1,
709 static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_1[] = {
711 I2C_BOARD_INFO("twl5030", 0x48),
712 .flags = I2C_CLIENT_WAKE,
713 .irq = INT_34XX_SYS_NIRQ,
714 .platform_data = &rx51_twldata,
718 static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_2[] = {
720 I2C_BOARD_INFO("tlv320aic3x", 0x18),
724 static int __init rx51_i2c_init(void)
726 if ((system_rev >= SYSTEM_REV_S_USES_VAUX3 && system_rev < 0x100) ||
727 system_rev >= SYSTEM_REV_B_USES_VAUX3) {
728 rx51_twldata.vaux3 = &rx51_vaux3_mmc;
729 /* Only older boards use VMMC2 for internal MMC */
730 rx51_vmmc2.num_consumer_supplies--;
732 rx51_twldata.vaux3 = &rx51_vaux3_cam;
734 rx51_twldata.vmmc2 = &rx51_vmmc2;
735 omap_register_i2c_bus(1, 2200, rx51_peripherals_i2c_board_info_1,
736 ARRAY_SIZE(rx51_peripherals_i2c_board_info_1));
737 omap_register_i2c_bus(2, 100, rx51_peripherals_i2c_board_info_2,
738 ARRAY_SIZE(rx51_peripherals_i2c_board_info_2));
739 omap_register_i2c_bus(3, 400, NULL, 0);
743 #if defined(CONFIG_MTD_ONENAND_OMAP2) || \
744 defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
746 static struct mtd_partition onenand_partitions[] = {
748 .name = "bootloader",
751 .mask_flags = MTD_WRITEABLE, /* Force read-only */
755 .offset = MTDPART_OFS_APPEND,
760 .offset = MTDPART_OFS_APPEND,
765 .offset = MTDPART_OFS_APPEND,
770 .offset = MTDPART_OFS_APPEND,
775 .offset = MTDPART_OFS_APPEND,
776 .size = MTDPART_SIZ_FULL,
780 static struct omap_onenand_platform_data board_onenand_data = {
783 .parts = onenand_partitions,
784 .nr_parts = ARRAY_SIZE(onenand_partitions),
785 .flags = ONENAND_SYNC_READWRITE,
788 static void __init board_onenand_init(void)
790 gpmc_onenand_init(&board_onenand_data);
795 static inline void board_onenand_init(void)
801 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
803 static struct omap_smc91x_platform_data board_smc91x_data = {
808 .flags = GPMC_TIMINGS_SMC91C96 | IORESOURCE_IRQ_HIGHLEVEL,
811 static void __init board_smc91x_init(void)
813 omap_mux_init_gpio(54, OMAP_PIN_INPUT_PULLDOWN);
814 omap_mux_init_gpio(86, OMAP_PIN_OUTPUT);
815 omap_mux_init_gpio(164, OMAP_PIN_OUTPUT);
817 gpmc_smc91x_init(&board_smc91x_data);
822 static inline void board_smc91x_init(void)
828 static void rx51_wl1251_set_power(bool enable)
830 gpio_set_value(RX51_WL1251_POWER_GPIO, enable);
833 static void __init rx51_init_wl1251(void)
837 ret = gpio_request(RX51_WL1251_POWER_GPIO, "wl1251 power");
841 ret = gpio_direction_output(RX51_WL1251_POWER_GPIO, 0);
845 ret = gpio_request(RX51_WL1251_IRQ_GPIO, "wl1251 irq");
849 ret = gpio_direction_input(RX51_WL1251_IRQ_GPIO);
853 irq = gpio_to_irq(RX51_WL1251_IRQ_GPIO);
857 wl1251_pdata.set_power = rx51_wl1251_set_power;
858 rx51_peripherals_spi_board_info[RX51_SPI_WL1251].irq = irq;
863 gpio_free(RX51_WL1251_IRQ_GPIO);
866 gpio_free(RX51_WL1251_POWER_GPIO);
869 printk(KERN_ERR "wl1251 board initialisation failed\n");
870 wl1251_pdata.set_power = NULL;
873 * Now rx51_peripherals_spi_board_info[1].irq is zero and
874 * set_power is null, and wl1251_probe() will fail.
878 void __init rx51_peripherals_init(void)
881 board_onenand_init();
883 rx51_add_gpio_keys();
885 spi_register_board_info(rx51_peripherals_spi_board_info,
886 ARRAY_SIZE(rx51_peripherals_spi_board_info));
887 omap2_hsmmc_init(mmc);