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>
29 #include <plat/board.h>
30 #include <plat/common.h>
32 #include <plat/gpmc.h>
33 #include <plat/onenand.h>
34 #include <plat/gpmc-smc91x.h>
39 #define SYSTEM_REV_B_USES_VAUX3 0x1699
40 #define SYSTEM_REV_S_USES_VAUX3 0x8
42 #define RX51_WL1251_POWER_GPIO 87
43 #define RX51_WL1251_IRQ_GPIO 42
45 /* list all spi devices here */
50 static struct wl12xx_platform_data wl1251_pdata;
52 static struct omap2_mcspi_device_config wl1251_mcspi_config = {
57 static struct spi_board_info rx51_peripherals_spi_board_info[] __initdata = {
62 .max_speed_hz = 48000000,
64 .controller_data = &wl1251_mcspi_config,
65 .platform_data = &wl1251_pdata,
69 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
71 #define RX51_GPIO_CAMERA_LENS_COVER 110
72 #define RX51_GPIO_CAMERA_FOCUS 68
73 #define RX51_GPIO_CAMERA_CAPTURE 69
74 #define RX51_GPIO_KEYPAD_SLIDE 71
75 #define RX51_GPIO_LOCK_BUTTON 113
76 #define RX51_GPIO_PROXIMITY 89
78 #define RX51_GPIO_DEBOUNCE_TIMEOUT 10
80 static struct gpio_keys_button rx51_gpio_keys[] = {
82 .desc = "Camera Lens Cover",
84 .code = SW_CAMERA_LENS_COVER,
85 .gpio = RX51_GPIO_CAMERA_LENS_COVER,
87 .debounce_interval = RX51_GPIO_DEBOUNCE_TIMEOUT,
89 .desc = "Camera Focus",
91 .code = KEY_CAMERA_FOCUS,
92 .gpio = RX51_GPIO_CAMERA_FOCUS,
94 .debounce_interval = RX51_GPIO_DEBOUNCE_TIMEOUT,
96 .desc = "Camera Capture",
99 .gpio = RX51_GPIO_CAMERA_CAPTURE,
101 .debounce_interval = RX51_GPIO_DEBOUNCE_TIMEOUT,
103 .desc = "Lock Button",
105 .code = KEY_SCREENLOCK,
106 .gpio = RX51_GPIO_LOCK_BUTTON,
108 .debounce_interval = RX51_GPIO_DEBOUNCE_TIMEOUT,
110 .desc = "Keypad Slide",
112 .code = SW_KEYPAD_SLIDE,
113 .gpio = RX51_GPIO_KEYPAD_SLIDE,
115 .debounce_interval = RX51_GPIO_DEBOUNCE_TIMEOUT,
117 .desc = "Proximity Sensor",
119 .code = SW_FRONT_PROXIMITY,
120 .gpio = RX51_GPIO_PROXIMITY,
122 .debounce_interval = RX51_GPIO_DEBOUNCE_TIMEOUT,
126 static struct gpio_keys_platform_data rx51_gpio_keys_data = {
127 .buttons = rx51_gpio_keys,
128 .nbuttons = ARRAY_SIZE(rx51_gpio_keys),
131 static struct platform_device rx51_gpio_keys_device = {
135 .platform_data = &rx51_gpio_keys_data,
139 static void __init rx51_add_gpio_keys(void)
141 platform_device_register(&rx51_gpio_keys_device);
144 static void __init rx51_add_gpio_keys(void)
147 #endif /* CONFIG_KEYBOARD_GPIO || CONFIG_KEYBOARD_GPIO_MODULE */
149 static int board_keymap[] = {
153 KEY(0, 3, KEY_COMMA),
154 KEY(0, 4, KEY_BACKSPACE),
168 KEY(2, 3, KEY_ENTER),
177 KEY(3, 5, KEY_SPACE),
178 KEY(3, 6, KEY_SPACE),
182 KEY(4, 2, KEY_RIGHT),
183 KEY(4, 4, KEY_LEFTCTRL),
184 KEY(4, 5, KEY_RIGHTALT),
185 KEY(4, 6, KEY_LEFTSHIFT),
191 KEY(0xff, 2, KEY_F9),
192 KEY(0xff, 4, KEY_F10),
193 KEY(0xff, 5, KEY_F11),
196 static struct matrix_keymap_data board_map_data = {
197 .keymap = board_keymap,
198 .keymap_size = ARRAY_SIZE(board_keymap),
201 static struct twl4030_keypad_data rx51_kp_data = {
202 .keymap_data = &board_map_data,
208 static struct twl4030_madc_platform_data rx51_madc_data = {
212 /* Enable input logic and pull all lines up when eMMC is on. */
213 static struct omap_board_mux rx51_mmc2_on_mux[] = {
214 OMAP3_MUX(SDMMC2_CMD, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
215 OMAP3_MUX(SDMMC2_DAT0, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
216 OMAP3_MUX(SDMMC2_DAT1, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
217 OMAP3_MUX(SDMMC2_DAT2, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
218 OMAP3_MUX(SDMMC2_DAT3, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
219 OMAP3_MUX(SDMMC2_DAT4, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
220 OMAP3_MUX(SDMMC2_DAT5, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
221 OMAP3_MUX(SDMMC2_DAT6, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
222 OMAP3_MUX(SDMMC2_DAT7, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
223 { .reg_offset = OMAP_MUX_TERMINATOR },
226 /* Disable input logic and pull all lines down when eMMC is off. */
227 static struct omap_board_mux rx51_mmc2_off_mux[] = {
228 OMAP3_MUX(SDMMC2_CMD, OMAP_PULL_ENA | OMAP_MUX_MODE0),
229 OMAP3_MUX(SDMMC2_DAT0, OMAP_PULL_ENA | OMAP_MUX_MODE0),
230 OMAP3_MUX(SDMMC2_DAT1, OMAP_PULL_ENA | OMAP_MUX_MODE0),
231 OMAP3_MUX(SDMMC2_DAT2, OMAP_PULL_ENA | OMAP_MUX_MODE0),
232 OMAP3_MUX(SDMMC2_DAT3, OMAP_PULL_ENA | OMAP_MUX_MODE0),
233 OMAP3_MUX(SDMMC2_DAT4, OMAP_PULL_ENA | OMAP_MUX_MODE0),
234 OMAP3_MUX(SDMMC2_DAT5, OMAP_PULL_ENA | OMAP_MUX_MODE0),
235 OMAP3_MUX(SDMMC2_DAT6, OMAP_PULL_ENA | OMAP_MUX_MODE0),
236 OMAP3_MUX(SDMMC2_DAT7, OMAP_PULL_ENA | OMAP_MUX_MODE0),
237 { .reg_offset = OMAP_MUX_TERMINATOR },
241 * Current flows to eMMC when eMMC is off and the data lines are pulled up,
242 * so pull them down. N.B. we pull 8 lines because we are using 8 lines.
244 static void rx51_mmc2_remux(struct device *dev, int slot, int power_on)
247 omap_mux_write_array(rx51_mmc2_on_mux);
249 omap_mux_write_array(rx51_mmc2_off_mux);
252 static struct omap2_hsmmc_info mmc[] __initdata = {
260 .power_saving = true,
265 .wires = 8, /* See also rx51_mmc2_remux */
268 .nonremovable = true,
269 .power_saving = true,
270 .remux = rx51_mmc2_remux,
275 static struct regulator_consumer_supply rx51_vmmc1_supply = {
277 .dev_name = "mmci-omap-hs.0",
280 static struct regulator_consumer_supply rx51_vaux3_supply = {
282 .dev_name = "mmci-omap-hs.1",
285 static struct regulator_consumer_supply rx51_vsim_supply = {
286 .supply = "vmmc_aux",
287 .dev_name = "mmci-omap-hs.1",
290 static struct regulator_consumer_supply rx51_vmmc2_supplies[] = {
291 /* tlv320aic3x analog supplies */
294 .dev_name = "2-0018",
298 .dev_name = "2-0018",
300 /* Keep vmmc as last item. It is not iterated for newer boards */
303 .dev_name = "mmci-omap-hs.1",
307 static struct regulator_consumer_supply rx51_vio_supplies[] = {
308 /* tlv320aic3x digital supplies */
319 #if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE)
320 extern struct platform_device rx51_display_device;
323 static struct regulator_consumer_supply rx51_vaux1_consumers[] = {
324 #if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE)
326 .supply = "vdds_sdi",
327 .dev = &rx51_display_device.dev,
332 static struct regulator_init_data rx51_vaux1 = {
337 .valid_modes_mask = REGULATOR_MODE_NORMAL
338 | REGULATOR_MODE_STANDBY,
339 .valid_ops_mask = REGULATOR_CHANGE_MODE
340 | REGULATOR_CHANGE_STATUS,
342 .num_consumer_supplies = ARRAY_SIZE(rx51_vaux1_consumers),
343 .consumer_supplies = rx51_vaux1_consumers,
346 static struct regulator_init_data rx51_vaux2 = {
351 .valid_modes_mask = REGULATOR_MODE_NORMAL
352 | REGULATOR_MODE_STANDBY,
353 .valid_ops_mask = REGULATOR_CHANGE_MODE
354 | REGULATOR_CHANGE_STATUS,
358 /* VAUX3 - adds more power to VIO_18 rail */
359 static struct regulator_init_data rx51_vaux3_cam = {
361 .name = "VCAM_DIG_18",
365 .valid_modes_mask = REGULATOR_MODE_NORMAL
366 | REGULATOR_MODE_STANDBY,
367 .valid_ops_mask = REGULATOR_CHANGE_MODE
368 | REGULATOR_CHANGE_STATUS,
372 static struct regulator_init_data rx51_vaux3_mmc = {
378 .valid_modes_mask = REGULATOR_MODE_NORMAL
379 | REGULATOR_MODE_STANDBY,
380 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
381 | REGULATOR_CHANGE_MODE
382 | REGULATOR_CHANGE_STATUS,
384 .num_consumer_supplies = 1,
385 .consumer_supplies = &rx51_vaux3_supply,
388 static struct regulator_init_data rx51_vaux4 = {
390 .name = "VCAM_ANA_28",
394 .valid_modes_mask = REGULATOR_MODE_NORMAL
395 | REGULATOR_MODE_STANDBY,
396 .valid_ops_mask = REGULATOR_CHANGE_MODE
397 | REGULATOR_CHANGE_STATUS,
401 static struct regulator_init_data rx51_vmmc1 = {
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_vmmc1_supply,
415 static struct regulator_init_data rx51_vmmc2 = {
421 .valid_modes_mask = REGULATOR_MODE_NORMAL
422 | REGULATOR_MODE_STANDBY,
423 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
424 | REGULATOR_CHANGE_MODE
425 | REGULATOR_CHANGE_STATUS,
427 .num_consumer_supplies = ARRAY_SIZE(rx51_vmmc2_supplies),
428 .consumer_supplies = rx51_vmmc2_supplies,
431 static struct regulator_init_data rx51_vsim = {
433 .name = "VMMC2_IO_18",
437 .valid_modes_mask = REGULATOR_MODE_NORMAL
438 | REGULATOR_MODE_STANDBY,
439 .valid_ops_mask = REGULATOR_CHANGE_MODE
440 | REGULATOR_CHANGE_STATUS,
442 .num_consumer_supplies = 1,
443 .consumer_supplies = &rx51_vsim_supply,
446 static struct regulator_init_data rx51_vdac = {
450 .valid_modes_mask = REGULATOR_MODE_NORMAL
451 | REGULATOR_MODE_STANDBY,
452 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
453 | REGULATOR_CHANGE_MODE
454 | REGULATOR_CHANGE_STATUS,
458 static struct regulator_init_data rx51_vio = {
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,
468 .num_consumer_supplies = ARRAY_SIZE(rx51_vio_supplies),
469 .consumer_supplies = rx51_vio_supplies,
472 static int rx51_twlgpio_setup(struct device *dev, unsigned gpio, unsigned n)
474 /* FIXME this gpio setup is just a placeholder for now */
475 gpio_request(gpio + 6, "backlight_pwm");
476 gpio_direction_output(gpio + 6, 0);
477 gpio_request(gpio + 7, "speaker_en");
478 gpio_direction_output(gpio + 7, 1);
483 static struct twl4030_gpio_platform_data rx51_gpio_data = {
484 .gpio_base = OMAP_MAX_GPIO_LINES,
485 .irq_base = TWL4030_GPIO_IRQ_BASE,
486 .irq_end = TWL4030_GPIO_IRQ_END,
487 .pulldowns = BIT(0) | BIT(1) | BIT(2) | BIT(3)
489 | BIT(8) | BIT(9) | BIT(10) | BIT(11)
490 | BIT(12) | BIT(13) | BIT(14) | BIT(15)
491 | BIT(16) | BIT(17) ,
492 .setup = rx51_twlgpio_setup,
495 static struct twl4030_usb_data rx51_usb_data = {
496 .usb_mode = T2_USB_MODE_ULPI,
499 static struct twl4030_ins sleep_on_seq[] __initdata = {
501 * Turn off everything
503 {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, 1, 0, RES_STATE_SLEEP), 2},
506 static struct twl4030_script sleep_on_script __initdata = {
507 .script = sleep_on_seq,
508 .size = ARRAY_SIZE(sleep_on_seq),
509 .flags = TWL4030_SLEEP_SCRIPT,
512 static struct twl4030_ins wakeup_seq[] __initdata = {
514 * Reenable everything
516 {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, 1, 0, RES_STATE_ACTIVE), 2},
519 static struct twl4030_script wakeup_script __initdata = {
520 .script = wakeup_seq,
521 .size = ARRAY_SIZE(wakeup_seq),
522 .flags = TWL4030_WAKEUP12_SCRIPT,
525 static struct twl4030_ins wakeup_p3_seq[] __initdata = {
527 * Reenable everything
529 {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, 1, 0, RES_STATE_ACTIVE), 2},
532 static struct twl4030_script wakeup_p3_script __initdata = {
533 .script = wakeup_p3_seq,
534 .size = ARRAY_SIZE(wakeup_p3_seq),
535 .flags = TWL4030_WAKEUP3_SCRIPT,
538 static struct twl4030_ins wrst_seq[] __initdata = {
541 * Reset VDD1 regulator.
542 * Reset VDD2 regulator.
543 * Reset VPLL1 regulator.
544 * Enable sysclk output.
547 {MSG_SINGULAR(DEV_GRP_NULL, RES_RESET, RES_STATE_OFF), 2},
548 {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, 0, 1, RES_STATE_ACTIVE),
550 {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_PP, 0, 3, RES_STATE_OFF), 0x13},
551 {MSG_SINGULAR(DEV_GRP_NULL, RES_VDD1, RES_STATE_WRST), 0x13},
552 {MSG_SINGULAR(DEV_GRP_NULL, RES_VDD2, RES_STATE_WRST), 0x13},
553 {MSG_SINGULAR(DEV_GRP_NULL, RES_VPLL1, RES_STATE_WRST), 0x35},
554 {MSG_SINGULAR(DEV_GRP_P3, RES_HFCLKOUT, RES_STATE_ACTIVE), 2},
555 {MSG_SINGULAR(DEV_GRP_NULL, RES_RESET, RES_STATE_ACTIVE), 2},
558 static struct twl4030_script wrst_script __initdata = {
560 .size = ARRAY_SIZE(wrst_seq),
561 .flags = TWL4030_WRST_SCRIPT,
564 static struct twl4030_script *twl4030_scripts[] __initdata = {
565 /* wakeup12 script should be loaded before sleep script, otherwise a
566 board might hit retention before loading of wakeup script is
567 completed. This can cause boot failures depending on timing issues.
575 static struct twl4030_resconfig twl4030_rconfig[] __initdata = {
576 { .resource = RES_VDD1, .devgroup = -1,
577 .type = 1, .type2 = -1, .remap_off = RES_STATE_OFF,
578 .remap_sleep = RES_STATE_OFF
580 { .resource = RES_VDD2, .devgroup = -1,
581 .type = 1, .type2 = -1, .remap_off = RES_STATE_OFF,
582 .remap_sleep = RES_STATE_OFF
584 { .resource = RES_VPLL1, .devgroup = -1,
585 .type = 1, .type2 = -1, .remap_off = RES_STATE_OFF,
586 .remap_sleep = RES_STATE_OFF
588 { .resource = RES_VPLL2, .devgroup = -1,
589 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
591 { .resource = RES_VAUX1, .devgroup = -1,
592 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
594 { .resource = RES_VAUX2, .devgroup = -1,
595 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
597 { .resource = RES_VAUX3, .devgroup = -1,
598 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
600 { .resource = RES_VAUX4, .devgroup = -1,
601 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
603 { .resource = RES_VMMC1, .devgroup = -1,
604 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
606 { .resource = RES_VMMC2, .devgroup = -1,
607 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
609 { .resource = RES_VDAC, .devgroup = -1,
610 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
612 { .resource = RES_VSIM, .devgroup = -1,
613 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
615 { .resource = RES_VINTANA1, .devgroup = DEV_GRP_P1 | DEV_GRP_P3,
616 .type = -1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
618 { .resource = RES_VINTANA2, .devgroup = DEV_GRP_P1 | DEV_GRP_P3,
619 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
621 { .resource = RES_VINTDIG, .devgroup = DEV_GRP_P1 | DEV_GRP_P3,
622 .type = -1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
624 { .resource = RES_VIO, .devgroup = DEV_GRP_P3,
625 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
627 { .resource = RES_CLKEN, .devgroup = DEV_GRP_P1 | DEV_GRP_P3,
628 .type = 1, .type2 = -1 , .remap_off = -1, .remap_sleep = -1
630 { .resource = RES_REGEN, .devgroup = DEV_GRP_P1 | DEV_GRP_P3,
631 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
633 { .resource = RES_NRES_PWRON, .devgroup = DEV_GRP_P1 | DEV_GRP_P3,
634 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
636 { .resource = RES_SYSEN, .devgroup = DEV_GRP_P1 | DEV_GRP_P3,
637 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
639 { .resource = RES_HFCLKOUT, .devgroup = DEV_GRP_P3,
640 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
642 { .resource = RES_32KCLKOUT, .devgroup = -1,
643 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
645 { .resource = RES_RESET, .devgroup = -1,
646 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
648 { .resource = RES_Main_Ref, .devgroup = -1,
649 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
654 static struct twl4030_power_data rx51_t2scripts_data __initdata = {
655 .scripts = twl4030_scripts,
656 .num = ARRAY_SIZE(twl4030_scripts),
657 .resource_config = twl4030_rconfig,
662 static struct twl4030_platform_data rx51_twldata __initdata = {
663 .irq_base = TWL4030_IRQ_BASE,
664 .irq_end = TWL4030_IRQ_END,
666 /* platform_data for children goes here */
667 .gpio = &rx51_gpio_data,
668 .keypad = &rx51_kp_data,
669 .madc = &rx51_madc_data,
670 .usb = &rx51_usb_data,
671 .power = &rx51_t2scripts_data,
673 .vaux1 = &rx51_vaux1,
674 .vaux2 = &rx51_vaux2,
675 .vaux4 = &rx51_vaux4,
676 .vmmc1 = &rx51_vmmc1,
682 static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_1[] = {
684 I2C_BOARD_INFO("twl5030", 0x48),
685 .flags = I2C_CLIENT_WAKE,
686 .irq = INT_34XX_SYS_NIRQ,
687 .platform_data = &rx51_twldata,
691 static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_2[] = {
693 I2C_BOARD_INFO("tlv320aic3x", 0x18),
697 static int __init rx51_i2c_init(void)
699 if ((system_rev >= SYSTEM_REV_S_USES_VAUX3 && system_rev < 0x100) ||
700 system_rev >= SYSTEM_REV_B_USES_VAUX3) {
701 rx51_twldata.vaux3 = &rx51_vaux3_mmc;
702 /* Only older boards use VMMC2 for internal MMC */
703 rx51_vmmc2.num_consumer_supplies--;
705 rx51_twldata.vaux3 = &rx51_vaux3_cam;
707 rx51_twldata.vmmc2 = &rx51_vmmc2;
708 omap_register_i2c_bus(1, 2200, rx51_peripherals_i2c_board_info_1,
709 ARRAY_SIZE(rx51_peripherals_i2c_board_info_1));
710 omap_register_i2c_bus(2, 100, rx51_peripherals_i2c_board_info_2,
711 ARRAY_SIZE(rx51_peripherals_i2c_board_info_2));
712 omap_register_i2c_bus(3, 400, NULL, 0);
716 #if defined(CONFIG_MTD_ONENAND_OMAP2) || \
717 defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
719 static struct mtd_partition onenand_partitions[] = {
721 .name = "bootloader",
724 .mask_flags = MTD_WRITEABLE, /* Force read-only */
728 .offset = MTDPART_OFS_APPEND,
733 .offset = MTDPART_OFS_APPEND,
738 .offset = MTDPART_OFS_APPEND,
743 .offset = MTDPART_OFS_APPEND,
748 .offset = MTDPART_OFS_APPEND,
749 .size = MTDPART_SIZ_FULL,
753 static struct omap_onenand_platform_data board_onenand_data = {
756 .parts = onenand_partitions,
757 .nr_parts = ARRAY_SIZE(onenand_partitions),
758 .flags = ONENAND_SYNC_READWRITE,
761 static void __init board_onenand_init(void)
763 gpmc_onenand_init(&board_onenand_data);
768 static inline void board_onenand_init(void)
774 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
776 static struct omap_smc91x_platform_data board_smc91x_data = {
781 .flags = GPMC_TIMINGS_SMC91C96 | IORESOURCE_IRQ_HIGHLEVEL,
784 static void __init board_smc91x_init(void)
786 omap_mux_init_gpio(54, OMAP_PIN_INPUT_PULLDOWN);
787 omap_mux_init_gpio(86, OMAP_PIN_OUTPUT);
788 omap_mux_init_gpio(164, OMAP_PIN_OUTPUT);
790 gpmc_smc91x_init(&board_smc91x_data);
795 static inline void board_smc91x_init(void)
801 static void rx51_wl1251_set_power(bool enable)
803 gpio_set_value(RX51_WL1251_POWER_GPIO, enable);
806 static void __init rx51_init_wl1251(void)
810 ret = gpio_request(RX51_WL1251_POWER_GPIO, "wl1251 power");
814 ret = gpio_direction_output(RX51_WL1251_POWER_GPIO, 0);
818 ret = gpio_request(RX51_WL1251_IRQ_GPIO, "wl1251 irq");
822 ret = gpio_direction_input(RX51_WL1251_IRQ_GPIO);
826 irq = gpio_to_irq(RX51_WL1251_IRQ_GPIO);
830 wl1251_pdata.set_power = rx51_wl1251_set_power;
831 rx51_peripherals_spi_board_info[RX51_SPI_WL1251].irq = irq;
836 gpio_free(RX51_WL1251_IRQ_GPIO);
839 gpio_free(RX51_WL1251_POWER_GPIO);
842 printk(KERN_ERR "wl1251 board initialisation failed\n");
843 wl1251_pdata.set_power = NULL;
846 * Now rx51_peripherals_spi_board_info[1].irq is zero and
847 * set_power is null, and wl1251_probe() will fail.
851 void __init rx51_peripherals_init(void)
854 board_onenand_init();
856 rx51_add_gpio_keys();
858 spi_register_board_info(rx51_peripherals_spi_board_info,
859 ARRAY_SIZE(rx51_peripherals_spi_board_info));
860 omap2_hsmmc_init(mmc);