diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c index 29ef249..fba2e1b 100644 --- a/drivers/net/wireless/ti/wlcore/sdio.c +++ b/drivers/net/wireless/ti/wlcore/sdio.c @@ -52,6 +52,7 @@ static bool dump = false; struct wl12xx_sdio_glue { struct device *dev; struct platform_device *core; + void (*set_power)(bool enable); }; static const struct sdio_device_id wl1271_devices[] = { @@ -153,6 +154,9 @@ static int wl12xx_sdio_power_on(struct wl12xx_sdio_glue *glue) struct sdio_func *func = dev_to_sdio_func(glue->dev); struct mmc_card *card = func->card; + if (glue->set_power) + glue->set_power(1); + ret = pm_runtime_get_sync(&card->dev); if (ret) { /* @@ -181,6 +185,9 @@ static int wl12xx_sdio_power_off(struct wl12xx_sdio_glue *glue) struct sdio_func *func = dev_to_sdio_func(glue->dev); struct mmc_card *card = func->card; + if (glue->set_power) + glue->set_power(0); + sdio_claim_host(func); sdio_disable_func(func); sdio_release_host(func); @@ -311,6 +318,9 @@ static int wl1271_probe(struct sdio_func *func, dev_err(glue->dev, "can't add platform device\n"); goto out_dev_put; } + + glue->set_power = pdev_data->pdata->set_power; + return 0; out_dev_put: