diff options
author | Sebastian Reichel <sre@debian.org> | 2014-02-14 18:05:53 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-02-28 14:08:26 -0500 |
commit | 1d207cd30b65fdd60d952cb9e100b6f776564f06 (patch) | |
tree | d7da13786239fa133a95c7cb0452877a9e2763d9 /arch | |
parent | 946651cba26779864bcdbd7e12502f5a36c2de37 (diff) |
wl1251: move power GPIO handling into the driver
Move the power GPIO handling from the board code into
the driver. This is a dependency for device tree support.
Signed-off-by: Sebastian Reichel <sre@debian.org>
Reviewed-by: Pavel Machek <pavel@ucw.cz>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-omap2/board-omap3pandora.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-rx51-peripherals.c | 11 |
2 files changed, 4 insertions, 9 deletions
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c index 24f3c1be69a5..cf18340eb3bb 100644 --- a/arch/arm/mach-omap2/board-omap3pandora.c +++ b/arch/arm/mach-omap2/board-omap3pandora.c | |||
@@ -541,6 +541,8 @@ static void __init pandora_wl1251_init(void) | |||
541 | 541 | ||
542 | memset(&pandora_wl1251_pdata, 0, sizeof(pandora_wl1251_pdata)); | 542 | memset(&pandora_wl1251_pdata, 0, sizeof(pandora_wl1251_pdata)); |
543 | 543 | ||
544 | pandora_wl1251_pdata.power_gpio = -1; | ||
545 | |||
544 | ret = gpio_request_one(PANDORA_WIFI_IRQ_GPIO, GPIOF_IN, "wl1251 irq"); | 546 | ret = gpio_request_one(PANDORA_WIFI_IRQ_GPIO, GPIOF_IN, "wl1251 irq"); |
545 | if (ret < 0) | 547 | if (ret < 0) |
546 | goto fail; | 548 | goto fail; |
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c index e05e740a4426..ddfc8df83c6a 100644 --- a/arch/arm/mach-omap2/board-rx51-peripherals.c +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c | |||
@@ -1173,13 +1173,7 @@ static inline void board_smc91x_init(void) | |||
1173 | 1173 | ||
1174 | #endif | 1174 | #endif |
1175 | 1175 | ||
1176 | static void rx51_wl1251_set_power(bool enable) | ||
1177 | { | ||
1178 | gpio_set_value(RX51_WL1251_POWER_GPIO, enable); | ||
1179 | } | ||
1180 | |||
1181 | static struct gpio rx51_wl1251_gpios[] __initdata = { | 1176 | static struct gpio rx51_wl1251_gpios[] __initdata = { |
1182 | { RX51_WL1251_POWER_GPIO, GPIOF_OUT_INIT_LOW, "wl1251 power" }, | ||
1183 | { RX51_WL1251_IRQ_GPIO, GPIOF_IN, "wl1251 irq" }, | 1177 | { RX51_WL1251_IRQ_GPIO, GPIOF_IN, "wl1251 irq" }, |
1184 | }; | 1178 | }; |
1185 | 1179 | ||
@@ -1196,17 +1190,16 @@ static void __init rx51_init_wl1251(void) | |||
1196 | if (irq < 0) | 1190 | if (irq < 0) |
1197 | goto err_irq; | 1191 | goto err_irq; |
1198 | 1192 | ||
1199 | wl1251_pdata.set_power = rx51_wl1251_set_power; | 1193 | wl1251_pdata.power_gpio = RX51_WL1251_POWER_GPIO; |
1200 | rx51_peripherals_spi_board_info[RX51_SPI_WL1251].irq = irq; | 1194 | rx51_peripherals_spi_board_info[RX51_SPI_WL1251].irq = irq; |
1201 | 1195 | ||
1202 | return; | 1196 | return; |
1203 | 1197 | ||
1204 | err_irq: | 1198 | err_irq: |
1205 | gpio_free(RX51_WL1251_IRQ_GPIO); | 1199 | gpio_free(RX51_WL1251_IRQ_GPIO); |
1206 | gpio_free(RX51_WL1251_POWER_GPIO); | ||
1207 | error: | 1200 | error: |
1208 | printk(KERN_ERR "wl1251 board initialisation failed\n"); | 1201 | printk(KERN_ERR "wl1251 board initialisation failed\n"); |
1209 | wl1251_pdata.set_power = NULL; | 1202 | wl1251_pdata.power_gpio = -1; |
1210 | 1203 | ||
1211 | /* | 1204 | /* |
1212 | * Now rx51_peripherals_spi_board_info[1].irq is zero and | 1205 | * Now rx51_peripherals_spi_board_info[1].irq is zero and |