aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/board-rx51-peripherals.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/board-rx51-peripherals.c')
-rw-r--r--arch/arm/mach-omap2/board-rx51-peripherals.c42
1 files changed, 11 insertions, 31 deletions
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
index bbcb6775a6a..2e509f9149e 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -43,6 +43,7 @@
43 43
44#include "mux.h" 44#include "mux.h"
45#include "hsmmc.h" 45#include "hsmmc.h"
46#include "common-board-devices.h"
46 47
47#define SYSTEM_REV_B_USES_VAUX3 0x1699 48#define SYSTEM_REV_B_USES_VAUX3 0x1699
48#define SYSTEM_REV_S_USES_VAUX3 0x8 49#define SYSTEM_REV_S_USES_VAUX3 0x8
@@ -557,10 +558,8 @@ static __init void rx51_init_si4713(void)
557static int rx51_twlgpio_setup(struct device *dev, unsigned gpio, unsigned n) 558static int rx51_twlgpio_setup(struct device *dev, unsigned gpio, unsigned n)
558{ 559{
559 /* FIXME this gpio setup is just a placeholder for now */ 560 /* FIXME this gpio setup is just a placeholder for now */
560 gpio_request(gpio + 6, "backlight_pwm"); 561 gpio_request_one(gpio + 6, GPIOF_OUT_INIT_LOW, "backlight_pwm");
561 gpio_direction_output(gpio + 6, 0); 562 gpio_request_one(gpio + 7, GPIOF_OUT_INIT_HIGH, "speaker_en");
562 gpio_request(gpio + 7, "speaker_en");
563 gpio_direction_output(gpio + 7, 1);
564 563
565 return 0; 564 return 0;
566} 565}
@@ -777,15 +776,6 @@ static struct tpa6130a2_platform_data rx51_tpa6130a2_data __initdata_or_module =
777 .power_gpio = 98, 776 .power_gpio = 98,
778}; 777};
779 778
780static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_1[] = {
781 {
782 I2C_BOARD_INFO("twl5030", 0x48),
783 .flags = I2C_CLIENT_WAKE,
784 .irq = INT_34XX_SYS_NIRQ,
785 .platform_data = &rx51_twldata,
786 },
787};
788
789/* Audio setup data */ 779/* Audio setup data */
790static struct aic3x_setup_data rx51_aic34_setup = { 780static struct aic3x_setup_data rx51_aic34_setup = {
791 .gpio_func[0] = AIC3X_GPIO1_FUNC_DISABLED, 781 .gpio_func[0] = AIC3X_GPIO1_FUNC_DISABLED,
@@ -833,8 +823,7 @@ static int __init rx51_i2c_init(void)
833 rx51_twldata.vaux3 = &rx51_vaux3_cam; 823 rx51_twldata.vaux3 = &rx51_vaux3_cam;
834 } 824 }
835 rx51_twldata.vmmc2 = &rx51_vmmc2; 825 rx51_twldata.vmmc2 = &rx51_vmmc2;
836 omap_register_i2c_bus(1, 2200, rx51_peripherals_i2c_board_info_1, 826 omap_pmic_init(1, 2200, "twl5030", INT_34XX_SYS_NIRQ, &rx51_twldata);
837 ARRAY_SIZE(rx51_peripherals_i2c_board_info_1));
838 omap_register_i2c_bus(2, 100, rx51_peripherals_i2c_board_info_2, 827 omap_register_i2c_bus(2, 100, rx51_peripherals_i2c_board_info_2,
839 ARRAY_SIZE(rx51_peripherals_i2c_board_info_2)); 828 ARRAY_SIZE(rx51_peripherals_i2c_board_info_2));
840 omap_register_i2c_bus(3, 400, NULL, 0); 829 omap_register_i2c_bus(3, 400, NULL, 0);
@@ -921,26 +910,20 @@ static void rx51_wl1251_set_power(bool enable)
921 gpio_set_value(RX51_WL1251_POWER_GPIO, enable); 910 gpio_set_value(RX51_WL1251_POWER_GPIO, enable);
922} 911}
923 912
913static struct gpio rx51_wl1251_gpios[] __initdata = {
914 { RX51_WL1251_POWER_GPIO, GPIOF_OUT_INIT_LOW, "wl1251 power" },
915 { RX51_WL1251_IRQ_GPIO, GPIOF_IN, "wl1251 irq" },
916};
917
924static void __init rx51_init_wl1251(void) 918static void __init rx51_init_wl1251(void)
925{ 919{
926 int irq, ret; 920 int irq, ret;
927 921
928 ret = gpio_request(RX51_WL1251_POWER_GPIO, "wl1251 power"); 922 ret = gpio_request_array(rx51_wl1251_gpios,
923 ARRAY_SIZE(rx51_wl1251_gpios));
929 if (ret < 0) 924 if (ret < 0)
930 goto error; 925 goto error;
931 926
932 ret = gpio_direction_output(RX51_WL1251_POWER_GPIO, 0);
933 if (ret < 0)
934 goto err_power;
935
936 ret = gpio_request(RX51_WL1251_IRQ_GPIO, "wl1251 irq");
937 if (ret < 0)
938 goto err_power;
939
940 ret = gpio_direction_input(RX51_WL1251_IRQ_GPIO);
941 if (ret < 0)
942 goto err_irq;
943
944 irq = gpio_to_irq(RX51_WL1251_IRQ_GPIO); 927 irq = gpio_to_irq(RX51_WL1251_IRQ_GPIO);
945 if (irq < 0) 928 if (irq < 0)
946 goto err_irq; 929 goto err_irq;
@@ -952,10 +935,7 @@ static void __init rx51_init_wl1251(void)
952 935
953err_irq: 936err_irq:
954 gpio_free(RX51_WL1251_IRQ_GPIO); 937 gpio_free(RX51_WL1251_IRQ_GPIO);
955
956err_power:
957 gpio_free(RX51_WL1251_POWER_GPIO); 938 gpio_free(RX51_WL1251_POWER_GPIO);
958
959error: 939error:
960 printk(KERN_ERR "wl1251 board initialisation failed\n"); 940 printk(KERN_ERR "wl1251 board initialisation failed\n");
961 wl1251_pdata.set_power = NULL; 941 wl1251_pdata.set_power = NULL;