aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/board-rx51-peripherals.c
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /arch/arm/mach-omap2/board-rx51-peripherals.c
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'arch/arm/mach-omap2/board-rx51-peripherals.c')
-rw-r--r--arch/arm/mach-omap2/board-rx51-peripherals.c231
1 files changed, 154 insertions, 77 deletions
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
index 9a5eb87425fc..88bd6f7705f0 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -14,7 +14,7 @@
14#include <linux/input.h> 14#include <linux/input.h>
15#include <linux/input/matrix_keypad.h> 15#include <linux/input/matrix_keypad.h>
16#include <linux/spi/spi.h> 16#include <linux/spi/spi.h>
17#include <linux/spi/wl12xx.h> 17#include <linux/wl12xx.h>
18#include <linux/i2c.h> 18#include <linux/i2c.h>
19#include <linux/i2c/twl.h> 19#include <linux/i2c/twl.h>
20#include <linux/clk.h> 20#include <linux/clk.h>
@@ -23,6 +23,7 @@
23#include <linux/gpio.h> 23#include <linux/gpio.h>
24#include <linux/gpio_keys.h> 24#include <linux/gpio_keys.h>
25#include <linux/mmc/host.h> 25#include <linux/mmc/host.h>
26#include <linux/power/isp1704_charger.h>
26 27
27#include <plat/mcspi.h> 28#include <plat/mcspi.h>
28#include <plat/board.h> 29#include <plat/board.h>
@@ -32,19 +33,28 @@
32#include <plat/onenand.h> 33#include <plat/onenand.h>
33#include <plat/gpmc-smc91x.h> 34#include <plat/gpmc-smc91x.h>
34 35
36#include <mach/board-rx51.h>
37
35#include <sound/tlv320aic3x.h> 38#include <sound/tlv320aic3x.h>
36#include <sound/tpa6130a2-plat.h> 39#include <sound/tpa6130a2-plat.h>
40#include <media/radio-si4713.h>
41#include <media/si4713.h>
37 42
38#include <../drivers/staging/iio/light/tsl2563.h> 43#include <../drivers/staging/iio/light/tsl2563.h>
39 44
40#include "mux.h" 45#include "mux.h"
41#include "hsmmc.h" 46#include "hsmmc.h"
47#include "common-board-devices.h"
42 48
43#define SYSTEM_REV_B_USES_VAUX3 0x1699 49#define SYSTEM_REV_B_USES_VAUX3 0x1699
44#define SYSTEM_REV_S_USES_VAUX3 0x8 50#define SYSTEM_REV_S_USES_VAUX3 0x8
45 51
46#define RX51_WL1251_POWER_GPIO 87 52#define RX51_WL1251_POWER_GPIO 87
47#define RX51_WL1251_IRQ_GPIO 42 53#define RX51_WL1251_IRQ_GPIO 42
54#define RX51_FMTX_RESET_GPIO 163
55#define RX51_FMTX_IRQ 53
56
57#define RX51_USB_TRANSCEIVER_RST_GPIO 67
48 58
49/* list all spi devices here */ 59/* list all spi devices here */
50enum { 60enum {
@@ -104,6 +114,30 @@ static struct spi_board_info rx51_peripherals_spi_board_info[] __initdata = {
104 }, 114 },
105}; 115};
106 116
117static void rx51_charger_set_power(bool on)
118{
119 gpio_set_value(RX51_USB_TRANSCEIVER_RST_GPIO, on);
120}
121
122static struct isp1704_charger_data rx51_charger_data = {
123 .set_power = rx51_charger_set_power,
124};
125
126static struct platform_device rx51_charger_device = {
127 .name = "isp1704_charger",
128 .dev = {
129 .platform_data = &rx51_charger_data,
130 },
131};
132
133static void __init rx51_charger_init(void)
134{
135 WARN_ON(gpio_request_one(RX51_USB_TRANSCEIVER_RST_GPIO,
136 GPIOF_OUT_INIT_LOW, "isp1704_reset"));
137
138 platform_device_register(&rx51_charger_device);
139}
140
107#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 141#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
108 142
109#define RX51_GPIO_CAMERA_LENS_COVER 110 143#define RX51_GPIO_CAMERA_LENS_COVER 110
@@ -184,7 +218,7 @@ static void __init rx51_add_gpio_keys(void)
184} 218}
185#endif /* CONFIG_KEYBOARD_GPIO || CONFIG_KEYBOARD_GPIO_MODULE */ 219#endif /* CONFIG_KEYBOARD_GPIO || CONFIG_KEYBOARD_GPIO_MODULE */
186 220
187static int board_keymap[] = { 221static uint32_t board_keymap[] = {
188 /* 222 /*
189 * Note that KEY(x, 8, KEY_XXX) entries represent "entrire row 223 * Note that KEY(x, 8, KEY_XXX) entries represent "entrire row
190 * connected to the ground" matrix state. 224 * connected to the ground" matrix state.
@@ -286,6 +320,8 @@ static struct omap_board_mux rx51_mmc2_off_mux[] = {
286 { .reg_offset = OMAP_MUX_TERMINATOR }, 320 { .reg_offset = OMAP_MUX_TERMINATOR },
287}; 321};
288 322
323static struct omap_mux_partition *partition;
324
289/* 325/*
290 * Current flows to eMMC when eMMC is off and the data lines are pulled up, 326 * Current flows to eMMC when eMMC is off and the data lines are pulled up,
291 * so pull them down. N.B. we pull 8 lines because we are using 8 lines. 327 * so pull them down. N.B. we pull 8 lines because we are using 8 lines.
@@ -293,16 +329,16 @@ static struct omap_board_mux rx51_mmc2_off_mux[] = {
293static void rx51_mmc2_remux(struct device *dev, int slot, int power_on) 329static void rx51_mmc2_remux(struct device *dev, int slot, int power_on)
294{ 330{
295 if (power_on) 331 if (power_on)
296 omap_mux_write_array(rx51_mmc2_on_mux); 332 omap_mux_write_array(partition, rx51_mmc2_on_mux);
297 else 333 else
298 omap_mux_write_array(rx51_mmc2_off_mux); 334 omap_mux_write_array(partition, rx51_mmc2_off_mux);
299} 335}
300 336
301static struct omap2_hsmmc_info mmc[] __initdata = { 337static struct omap2_hsmmc_info mmc[] __initdata = {
302 { 338 {
303 .name = "external", 339 .name = "external",
304 .mmc = 1, 340 .mmc = 1,
305 .wires = 4, 341 .caps = MMC_CAP_4_BIT_DATA,
306 .cover_only = true, 342 .cover_only = true,
307 .gpio_cd = 160, 343 .gpio_cd = 160,
308 .gpio_wp = -EINVAL, 344 .gpio_wp = -EINVAL,
@@ -311,7 +347,8 @@ static struct omap2_hsmmc_info mmc[] __initdata = {
311 { 347 {
312 .name = "internal", 348 .name = "internal",
313 .mmc = 2, 349 .mmc = 2,
314 .wires = 8, /* See also rx51_mmc2_remux */ 350 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
351 /* See also rx51_mmc2_remux */
315 .gpio_cd = -EINVAL, 352 .gpio_cd = -EINVAL,
316 .gpio_wp = -EINVAL, 353 .gpio_wp = -EINVAL,
317 .nonremovable = true, 354 .nonremovable = true,
@@ -322,41 +359,44 @@ static struct omap2_hsmmc_info mmc[] __initdata = {
322}; 359};
323 360
324static struct regulator_consumer_supply rx51_vmmc1_supply = 361static struct regulator_consumer_supply rx51_vmmc1_supply =
325 REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.0"); 362 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0");
326 363
327static struct regulator_consumer_supply rx51_vaux3_supply = 364static struct regulator_consumer_supply rx51_vaux3_supply =
328 REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1"); 365 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1");
329 366
330static struct regulator_consumer_supply rx51_vsim_supply = 367static struct regulator_consumer_supply rx51_vsim_supply =
331 REGULATOR_SUPPLY("vmmc_aux", "mmci-omap-hs.1"); 368 REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.1");
332 369
333static struct regulator_consumer_supply rx51_vmmc2_supplies[] = { 370static struct regulator_consumer_supply rx51_vmmc2_supplies[] = {
334 /* tlv320aic3x analog supplies */ 371 /* tlv320aic3x analog supplies */
335 REGULATOR_SUPPLY("AVDD", "2-0018"), 372 REGULATOR_SUPPLY("AVDD", "2-0018"),
336 REGULATOR_SUPPLY("DRVDD", "2-0018"), 373 REGULATOR_SUPPLY("DRVDD", "2-0018"),
374 REGULATOR_SUPPLY("AVDD", "2-0019"),
375 REGULATOR_SUPPLY("DRVDD", "2-0019"),
337 /* tpa6130a2 */ 376 /* tpa6130a2 */
338 REGULATOR_SUPPLY("Vdd", "2-0060"), 377 REGULATOR_SUPPLY("Vdd", "2-0060"),
339 /* Keep vmmc as last item. It is not iterated for newer boards */ 378 /* Keep vmmc as last item. It is not iterated for newer boards */
340 REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1"), 379 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"),
341}; 380};
342 381
343static struct regulator_consumer_supply rx51_vio_supplies[] = { 382static struct regulator_consumer_supply rx51_vio_supplies[] = {
344 /* tlv320aic3x digital supplies */ 383 /* tlv320aic3x digital supplies */
345 REGULATOR_SUPPLY("IOVDD", "2-0018"), 384 REGULATOR_SUPPLY("IOVDD", "2-0018"),
346 REGULATOR_SUPPLY("DVDD", "2-0018"), 385 REGULATOR_SUPPLY("DVDD", "2-0018"),
386 REGULATOR_SUPPLY("IOVDD", "2-0019"),
387 REGULATOR_SUPPLY("DVDD", "2-0019"),
388 /* Si4713 IO supply */
389 REGULATOR_SUPPLY("vio", "2-0063"),
347}; 390};
348 391
349#if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE)
350extern struct platform_device rx51_display_device;
351#endif
352
353static struct regulator_consumer_supply rx51_vaux1_consumers[] = { 392static struct regulator_consumer_supply rx51_vaux1_consumers[] = {
354#if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE) 393 REGULATOR_SUPPLY("vdds_sdi", "omapdss"),
355 { 394 /* Si4713 supply */
356 .supply = "vdds_sdi", 395 REGULATOR_SUPPLY("vdd", "2-0063"),
357 .dev = &rx51_display_device.dev, 396};
358 }, 397
359#endif 398static struct regulator_consumer_supply rx51_vdac_supply[] = {
399 REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"),
360}; 400};
361 401
362static struct regulator_init_data rx51_vaux1 = { 402static struct regulator_init_data rx51_vaux1 = {
@@ -448,6 +488,7 @@ static struct regulator_init_data rx51_vmmc2 = {
448 .name = "V28_A", 488 .name = "V28_A",
449 .min_uV = 2800000, 489 .min_uV = 2800000,
450 .max_uV = 3000000, 490 .max_uV = 3000000,
491 .always_on = true, /* due VIO leak to AIC34 VDDs */
451 .apply_uV = true, 492 .apply_uV = true,
452 .valid_modes_mask = REGULATOR_MODE_NORMAL 493 .valid_modes_mask = REGULATOR_MODE_NORMAL
453 | REGULATOR_MODE_STANDBY, 494 | REGULATOR_MODE_STANDBY,
@@ -476,14 +517,17 @@ static struct regulator_init_data rx51_vsim = {
476 517
477static struct regulator_init_data rx51_vdac = { 518static struct regulator_init_data rx51_vdac = {
478 .constraints = { 519 .constraints = {
520 .name = "VDAC",
479 .min_uV = 1800000, 521 .min_uV = 1800000,
480 .max_uV = 1800000, 522 .max_uV = 1800000,
523 .apply_uV = true,
481 .valid_modes_mask = REGULATOR_MODE_NORMAL 524 .valid_modes_mask = REGULATOR_MODE_NORMAL
482 | REGULATOR_MODE_STANDBY, 525 | REGULATOR_MODE_STANDBY,
483 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE 526 .valid_ops_mask = REGULATOR_CHANGE_MODE
484 | REGULATOR_CHANGE_MODE
485 | REGULATOR_CHANGE_STATUS, 527 | REGULATOR_CHANGE_STATUS,
486 }, 528 },
529 .num_consumer_supplies = 1,
530 .consumer_supplies = rx51_vdac_supply,
487}; 531};
488 532
489static struct regulator_init_data rx51_vio = { 533static struct regulator_init_data rx51_vio = {
@@ -500,13 +544,46 @@ static struct regulator_init_data rx51_vio = {
500 .consumer_supplies = rx51_vio_supplies, 544 .consumer_supplies = rx51_vio_supplies,
501}; 545};
502 546
547static struct si4713_platform_data rx51_si4713_i2c_data __initdata_or_module = {
548 .gpio_reset = RX51_FMTX_RESET_GPIO,
549};
550
551static struct i2c_board_info rx51_si4713_board_info __initdata_or_module = {
552 I2C_BOARD_INFO("si4713", SI4713_I2C_ADDR_BUSEN_HIGH),
553 .platform_data = &rx51_si4713_i2c_data,
554};
555
556static struct radio_si4713_platform_data rx51_si4713_data __initdata_or_module = {
557 .i2c_bus = 2,
558 .subdev_board_info = &rx51_si4713_board_info,
559};
560
561static struct platform_device rx51_si4713_dev = {
562 .name = "radio-si4713",
563 .id = -1,
564 .dev = {
565 .platform_data = &rx51_si4713_data,
566 },
567};
568
569static __init void rx51_init_si4713(void)
570{
571 int err;
572
573 err = gpio_request_one(RX51_FMTX_IRQ, GPIOF_DIR_IN, "si4713 irq");
574 if (err) {
575 printk(KERN_ERR "Cannot request si4713 irq gpio. %d\n", err);
576 return;
577 }
578 rx51_si4713_board_info.irq = gpio_to_irq(RX51_FMTX_IRQ);
579 platform_device_register(&rx51_si4713_dev);
580}
581
503static int rx51_twlgpio_setup(struct device *dev, unsigned gpio, unsigned n) 582static int rx51_twlgpio_setup(struct device *dev, unsigned gpio, unsigned n)
504{ 583{
505 /* FIXME this gpio setup is just a placeholder for now */ 584 /* FIXME this gpio setup is just a placeholder for now */
506 gpio_request(gpio + 6, "backlight_pwm"); 585 gpio_request_one(gpio + 6, GPIOF_OUT_INIT_LOW, "backlight_pwm");
507 gpio_direction_output(gpio + 6, 0); 586 gpio_request_one(gpio + 7, GPIOF_OUT_INIT_LOW, "speaker_en");
508 gpio_request(gpio + 7, "speaker_en");
509 gpio_direction_output(gpio + 7, 1);
510 587
511 return 0; 588 return 0;
512} 589}
@@ -676,7 +753,7 @@ static struct twl4030_resconfig twl4030_rconfig[] __initdata = {
676 { .resource = RES_RESET, .devgroup = -1, 753 { .resource = RES_RESET, .devgroup = -1,
677 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1 754 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
678 }, 755 },
679 { .resource = RES_Main_Ref, .devgroup = -1, 756 { .resource = RES_MAIN_REF, .devgroup = -1,
680 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1 757 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
681 }, 758 },
682 { 0, 0}, 759 { 0, 0},
@@ -688,7 +765,14 @@ static struct twl4030_power_data rx51_t2scripts_data __initdata = {
688 .resource_config = twl4030_rconfig, 765 .resource_config = twl4030_rconfig,
689}; 766};
690 767
768struct twl4030_codec_vibra_data rx51_vibra_data __initdata = {
769 .coexist = 0,
770};
691 771
772struct twl4030_codec_data rx51_codec_data __initdata = {
773 .audio_mclk = 26000000,
774 .vibra = &rx51_vibra_data,
775};
692 776
693static struct twl4030_platform_data rx51_twldata __initdata = { 777static struct twl4030_platform_data rx51_twldata __initdata = {
694 .irq_base = TWL4030_IRQ_BASE, 778 .irq_base = TWL4030_IRQ_BASE,
@@ -700,6 +784,7 @@ static struct twl4030_platform_data rx51_twldata __initdata = {
700 .madc = &rx51_madc_data, 784 .madc = &rx51_madc_data,
701 .usb = &rx51_usb_data, 785 .usb = &rx51_usb_data,
702 .power = &rx51_t2scripts_data, 786 .power = &rx51_t2scripts_data,
787 .codec = &rx51_codec_data,
703 788
704 .vaux1 = &rx51_vaux1, 789 .vaux1 = &rx51_vaux1,
705 .vaux2 = &rx51_vaux2, 790 .vaux2 = &rx51_vaux2,
@@ -710,22 +795,24 @@ static struct twl4030_platform_data rx51_twldata __initdata = {
710 .vio = &rx51_vio, 795 .vio = &rx51_vio,
711}; 796};
712 797
713static struct aic3x_pdata rx51_aic3x_data __initdata = { 798static struct tpa6130a2_platform_data rx51_tpa6130a2_data __initdata_or_module = {
714 .gpio_reset = 60,
715};
716
717static struct tpa6130a2_platform_data rx51_tpa6130a2_data __initdata = {
718 .id = TPA6130A2, 799 .id = TPA6130A2,
719 .power_gpio = 98, 800 .power_gpio = 98,
720}; 801};
721 802
722static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_1[] = { 803/* Audio setup data */
723 { 804static struct aic3x_setup_data rx51_aic34_setup = {
724 I2C_BOARD_INFO("twl5030", 0x48), 805 .gpio_func[0] = AIC3X_GPIO1_FUNC_DISABLED,
725 .flags = I2C_CLIENT_WAKE, 806 .gpio_func[1] = AIC3X_GPIO2_FUNC_DIGITAL_MIC_INPUT,
726 .irq = INT_34XX_SYS_NIRQ, 807};
727 .platform_data = &rx51_twldata, 808
728 }, 809static struct aic3x_pdata rx51_aic3x_data = {
810 .setup = &rx51_aic34_setup,
811 .gpio_reset = 60,
812};
813
814static struct aic3x_pdata rx51_aic3x_data2 = {
815 .gpio_reset = 60,
729}; 816};
730 817
731static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_2[] = { 818static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_2[] = {
@@ -733,6 +820,10 @@ static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_2[] = {
733 I2C_BOARD_INFO("tlv320aic3x", 0x18), 820 I2C_BOARD_INFO("tlv320aic3x", 0x18),
734 .platform_data = &rx51_aic3x_data, 821 .platform_data = &rx51_aic3x_data,
735 }, 822 },
823 {
824 I2C_BOARD_INFO("tlv320aic3x", 0x19),
825 .platform_data = &rx51_aic3x_data2,
826 },
736#if defined(CONFIG_SENSORS_TSL2563) || defined(CONFIG_SENSORS_TSL2563_MODULE) 827#if defined(CONFIG_SENSORS_TSL2563) || defined(CONFIG_SENSORS_TSL2563_MODULE)
737 { 828 {
738 I2C_BOARD_INFO("tsl2563", 0x29), 829 I2C_BOARD_INFO("tsl2563", 0x29),
@@ -756,8 +847,7 @@ static int __init rx51_i2c_init(void)
756 rx51_twldata.vaux3 = &rx51_vaux3_cam; 847 rx51_twldata.vaux3 = &rx51_vaux3_cam;
757 } 848 }
758 rx51_twldata.vmmc2 = &rx51_vmmc2; 849 rx51_twldata.vmmc2 = &rx51_vmmc2;
759 omap_register_i2c_bus(1, 2200, rx51_peripherals_i2c_board_info_1, 850 omap_pmic_init(1, 2200, "twl5030", INT_34XX_SYS_NIRQ, &rx51_twldata);
760 ARRAY_SIZE(rx51_peripherals_i2c_board_info_1));
761 omap_register_i2c_bus(2, 100, rx51_peripherals_i2c_board_info_2, 851 omap_register_i2c_bus(2, 100, rx51_peripherals_i2c_board_info_2,
762 ARRAY_SIZE(rx51_peripherals_i2c_board_info_2)); 852 ARRAY_SIZE(rx51_peripherals_i2c_board_info_2));
763 omap_register_i2c_bus(3, 400, NULL, 0); 853 omap_register_i2c_bus(3, 400, NULL, 0);
@@ -801,25 +891,15 @@ static struct mtd_partition onenand_partitions[] = {
801 }, 891 },
802}; 892};
803 893
804static struct omap_onenand_platform_data board_onenand_data = { 894static struct omap_onenand_platform_data board_onenand_data[] = {
805 .cs = 0, 895 {
806 .gpio_irq = 65, 896 .cs = 0,
807 .parts = onenand_partitions, 897 .gpio_irq = 65,
808 .nr_parts = ARRAY_SIZE(onenand_partitions), 898 .parts = onenand_partitions,
809 .flags = ONENAND_SYNC_READWRITE, 899 .nr_parts = ARRAY_SIZE(onenand_partitions),
900 .flags = ONENAND_SYNC_READWRITE,
901 }
810}; 902};
811
812static void __init board_onenand_init(void)
813{
814 gpmc_onenand_init(&board_onenand_data);
815}
816
817#else
818
819static inline void board_onenand_init(void)
820{
821}
822
823#endif 903#endif
824 904
825#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 905#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
@@ -854,26 +934,20 @@ static void rx51_wl1251_set_power(bool enable)
854 gpio_set_value(RX51_WL1251_POWER_GPIO, enable); 934 gpio_set_value(RX51_WL1251_POWER_GPIO, enable);
855} 935}
856 936
937static struct gpio rx51_wl1251_gpios[] __initdata = {
938 { RX51_WL1251_POWER_GPIO, GPIOF_OUT_INIT_LOW, "wl1251 power" },
939 { RX51_WL1251_IRQ_GPIO, GPIOF_IN, "wl1251 irq" },
940};
941
857static void __init rx51_init_wl1251(void) 942static void __init rx51_init_wl1251(void)
858{ 943{
859 int irq, ret; 944 int irq, ret;
860 945
861 ret = gpio_request(RX51_WL1251_POWER_GPIO, "wl1251 power"); 946 ret = gpio_request_array(rx51_wl1251_gpios,
947 ARRAY_SIZE(rx51_wl1251_gpios));
862 if (ret < 0) 948 if (ret < 0)
863 goto error; 949 goto error;
864 950
865 ret = gpio_direction_output(RX51_WL1251_POWER_GPIO, 0);
866 if (ret < 0)
867 goto err_power;
868
869 ret = gpio_request(RX51_WL1251_IRQ_GPIO, "wl1251 irq");
870 if (ret < 0)
871 goto err_power;
872
873 ret = gpio_direction_input(RX51_WL1251_IRQ_GPIO);
874 if (ret < 0)
875 goto err_irq;
876
877 irq = gpio_to_irq(RX51_WL1251_IRQ_GPIO); 951 irq = gpio_to_irq(RX51_WL1251_IRQ_GPIO);
878 if (irq < 0) 952 if (irq < 0)
879 goto err_irq; 953 goto err_irq;
@@ -885,10 +959,7 @@ static void __init rx51_init_wl1251(void)
885 959
886err_irq: 960err_irq:
887 gpio_free(RX51_WL1251_IRQ_GPIO); 961 gpio_free(RX51_WL1251_IRQ_GPIO);
888
889err_power:
890 gpio_free(RX51_WL1251_POWER_GPIO); 962 gpio_free(RX51_WL1251_POWER_GPIO);
891
892error: 963error:
893 printk(KERN_ERR "wl1251 board initialisation failed\n"); 964 printk(KERN_ERR "wl1251 board initialisation failed\n");
894 wl1251_pdata.set_power = NULL; 965 wl1251_pdata.set_power = NULL;
@@ -902,12 +973,18 @@ error:
902void __init rx51_peripherals_init(void) 973void __init rx51_peripherals_init(void)
903{ 974{
904 rx51_i2c_init(); 975 rx51_i2c_init();
905 board_onenand_init(); 976 gpmc_onenand_init(board_onenand_data);
906 board_smc91x_init(); 977 board_smc91x_init();
907 rx51_add_gpio_keys(); 978 rx51_add_gpio_keys();
908 rx51_init_wl1251(); 979 rx51_init_wl1251();
980 rx51_init_si4713();
909 spi_register_board_info(rx51_peripherals_spi_board_info, 981 spi_register_board_info(rx51_peripherals_spi_board_info,
910 ARRAY_SIZE(rx51_peripherals_spi_board_info)); 982 ARRAY_SIZE(rx51_peripherals_spi_board_info));
911 omap2_hsmmc_init(mmc); 983
984 partition = omap_mux_get("core");
985 if (partition)
986 omap2_hsmmc_init(mmc);
987
988 rx51_charger_init();
912} 989}
913 990