|
@@ -28,6 +28,7 @@
|
|
#include <linux/wl12xx.h>
|
|
#include <linux/wl12xx.h>
|
|
#include <linux/irq.h>
|
|
#include <linux/irq.h>
|
|
#include <linux/pm_runtime.h>
|
|
#include <linux/pm_runtime.h>
|
|
|
|
+#include <linux/gpio.h>
|
|
|
|
|
|
#include "wl1251.h"
|
|
#include "wl1251.h"
|
|
|
|
|
|
@@ -182,8 +183,9 @@ static int wl1251_sdio_set_power(struct wl1251 *wl, bool enable)
|
|
* callback in case it wants to do any additional setup,
|
|
* callback in case it wants to do any additional setup,
|
|
* for example enabling clock buffer for the module.
|
|
* for example enabling clock buffer for the module.
|
|
*/
|
|
*/
|
|
- if (wl->set_power)
|
|
|
|
- wl->set_power(true);
|
|
|
|
|
|
+ if (gpio_is_valid(wl->power_gpio))
|
|
|
|
+ gpio_set_value(wl->power_gpio, true);
|
|
|
|
+
|
|
|
|
|
|
ret = pm_runtime_get_sync(&func->dev);
|
|
ret = pm_runtime_get_sync(&func->dev);
|
|
if (ret < 0) {
|
|
if (ret < 0) {
|
|
@@ -203,8 +205,8 @@ static int wl1251_sdio_set_power(struct wl1251 *wl, bool enable)
|
|
if (ret < 0)
|
|
if (ret < 0)
|
|
goto out;
|
|
goto out;
|
|
|
|
|
|
- if (wl->set_power)
|
|
|
|
- wl->set_power(false);
|
|
|
|
|
|
+ if (gpio_is_valid(wl->power_gpio))
|
|
|
|
+ gpio_set_value(wl->power_gpio, false);
|
|
}
|
|
}
|
|
|
|
|
|
out:
|
|
out:
|
|
@@ -256,11 +258,20 @@ static int wl1251_sdio_probe(struct sdio_func *func,
|
|
|
|
|
|
wl1251_board_data = wl1251_get_platform_data();
|
|
wl1251_board_data = wl1251_get_platform_data();
|
|
if (!IS_ERR(wl1251_board_data)) {
|
|
if (!IS_ERR(wl1251_board_data)) {
|
|
- wl->set_power = wl1251_board_data->set_power;
|
|
|
|
|
|
+ wl->power_gpio = wl1251_board_data->power_gpio;
|
|
wl->irq = wl1251_board_data->irq;
|
|
wl->irq = wl1251_board_data->irq;
|
|
wl->use_eeprom = wl1251_board_data->use_eeprom;
|
|
wl->use_eeprom = wl1251_board_data->use_eeprom;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (gpio_is_valid(wl->power_gpio)) {
|
|
|
|
+ ret = devm_gpio_request(&func->dev, wl->power_gpio,
|
|
|
|
+ "wl1251 power");
|
|
|
|
+ if (ret) {
|
|
|
|
+ wl1251_error("Failed to request gpio: %d\n", ret);
|
|
|
|
+ goto disable;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
if (wl->irq) {
|
|
if (wl->irq) {
|
|
irq_set_status_flags(wl->irq, IRQ_NOAUTOEN);
|
|
irq_set_status_flags(wl->irq, IRQ_NOAUTOEN);
|
|
ret = request_irq(wl->irq, wl1251_line_irq, 0, "wl1251", wl);
|
|
ret = request_irq(wl->irq, wl1251_line_irq, 0, "wl1251", wl);
|