aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/board-rx51-peripherals.c
diff options
context:
space:
mode:
authorIgor Grinberg <grinberg@compulab.co.il>2011-05-03 11:22:09 -0400
committerTony Lindgren <tony@atomide.com>2011-05-12 05:52:06 -0400
commitbc593f5d787d0a015539e21868302fb44a47c3e3 (patch)
tree75feac78712ae08e38b678c0dae62cb75765ddb0 /arch/arm/mach-omap2/board-rx51-peripherals.c
parent9e18630b689d658d65bf59508bfec084f61ff5c6 (diff)
arm: omap2plus: GPIO cleanup
use gpio_request_<one|array>() instead of multiple gpiolib calls, remove unneeded variables, etc. Signed-off-by: Igor Grinberg <grinberg@compulab.co.il> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/board-rx51-peripherals.c')
-rw-r--r--arch/arm/mach-omap2/board-rx51-peripherals.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
index a5bf5e92eae..2e509f9149e 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -558,10 +558,8 @@ static __init void rx51_init_si4713(void)
558static int rx51_twlgpio_setup(struct device *dev, unsigned gpio, unsigned n) 558static int rx51_twlgpio_setup(struct device *dev, unsigned gpio, unsigned n)
559{ 559{
560 /* FIXME this gpio setup is just a placeholder for now */ 560 /* FIXME this gpio setup is just a placeholder for now */
561 gpio_request(gpio + 6, "backlight_pwm"); 561 gpio_request_one(gpio + 6, GPIOF_OUT_INIT_LOW, "backlight_pwm");
562 gpio_direction_output(gpio + 6, 0); 562 gpio_request_one(gpio + 7, GPIOF_OUT_INIT_HIGH, "speaker_en");
563 gpio_request(gpio + 7, "speaker_en");
564 gpio_direction_output(gpio + 7, 1);
565 563
566 return 0; 564 return 0;
567} 565}
@@ -912,26 +910,20 @@ static void rx51_wl1251_set_power(bool enable)
912 gpio_set_value(RX51_WL1251_POWER_GPIO, enable); 910 gpio_set_value(RX51_WL1251_POWER_GPIO, enable);
913} 911}
914 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
915static void __init rx51_init_wl1251(void) 918static void __init rx51_init_wl1251(void)
916{ 919{
917 int irq, ret; 920 int irq, ret;
918 921
919 ret = gpio_request(RX51_WL1251_POWER_GPIO, "wl1251 power"); 922 ret = gpio_request_array(rx51_wl1251_gpios,
923 ARRAY_SIZE(rx51_wl1251_gpios));
920 if (ret < 0) 924 if (ret < 0)
921 goto error; 925 goto error;
922 926
923 ret = gpio_direction_output(RX51_WL1251_POWER_GPIO, 0);
924 if (ret < 0)
925 goto err_power;
926
927 ret = gpio_request(RX51_WL1251_IRQ_GPIO, "wl1251 irq");
928 if (ret < 0)
929 goto err_power;
930
931 ret = gpio_direction_input(RX51_WL1251_IRQ_GPIO);
932 if (ret < 0)
933 goto err_irq;
934
935 irq = gpio_to_irq(RX51_WL1251_IRQ_GPIO); 927 irq = gpio_to_irq(RX51_WL1251_IRQ_GPIO);
936 if (irq < 0) 928 if (irq < 0)
937 goto err_irq; 929 goto err_irq;
@@ -943,10 +935,7 @@ static void __init rx51_init_wl1251(void)
943 935
944err_irq: 936err_irq:
945 gpio_free(RX51_WL1251_IRQ_GPIO); 937 gpio_free(RX51_WL1251_IRQ_GPIO);
946
947err_power:
948 gpio_free(RX51_WL1251_POWER_GPIO); 938 gpio_free(RX51_WL1251_POWER_GPIO);
949
950error: 939error:
951 printk(KERN_ERR "wl1251 board initialisation failed\n"); 940 printk(KERN_ERR "wl1251 board initialisation failed\n");
952 wl1251_pdata.set_power = NULL; 941 wl1251_pdata.set_power = NULL;