mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-04-21 05:44:01 +00:00
wlcore: sdio: allow pm to handle sdio power
pm_runtime handles sdio power on and power off transitions. An old workaround for trying to control the power explicitly from the driver was in fact causing failures on suspend/resume as the mmc layer already power the module on resume. In case of resume pm_runtime_get sync returns a positive device's usage count causing the driver to try an re-initialize an already initialized device. This was causing sdio bus failure on resume. Remove this manual power on/off sequence as it is in-fact not needed. Signed-off-by: Eyal Reizer <eyalr@ti.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
parent
3ff6ee2853
commit
60f36637bb
1 changed files with 6 additions and 21 deletions
|
@ -155,18 +155,12 @@ static int wl12xx_sdio_power_on(struct wl12xx_sdio_glue *glue)
|
||||||
struct mmc_card *card = func->card;
|
struct mmc_card *card = func->card;
|
||||||
|
|
||||||
ret = pm_runtime_get_sync(&card->dev);
|
ret = pm_runtime_get_sync(&card->dev);
|
||||||
if (ret) {
|
|
||||||
/*
|
|
||||||
* Runtime PM might be temporarily disabled, or the device
|
|
||||||
* might have a positive reference counter. Make sure it is
|
|
||||||
* really powered on.
|
|
||||||
*/
|
|
||||||
ret = mmc_power_restore_host(card->host);
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
pm_runtime_put_sync(&card->dev);
|
pm_runtime_put_noidle(&card->dev);
|
||||||
|
dev_err(glue->dev, "%s: failed to get_sync(%d)\n",
|
||||||
|
__func__, ret);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
sdio_claim_host(func);
|
sdio_claim_host(func);
|
||||||
sdio_enable_func(func);
|
sdio_enable_func(func);
|
||||||
|
@ -178,7 +172,6 @@ out:
|
||||||
|
|
||||||
static int wl12xx_sdio_power_off(struct wl12xx_sdio_glue *glue)
|
static int wl12xx_sdio_power_off(struct wl12xx_sdio_glue *glue)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
struct sdio_func *func = dev_to_sdio_func(glue->dev);
|
struct sdio_func *func = dev_to_sdio_func(glue->dev);
|
||||||
struct mmc_card *card = func->card;
|
struct mmc_card *card = func->card;
|
||||||
|
|
||||||
|
@ -186,16 +179,8 @@ static int wl12xx_sdio_power_off(struct wl12xx_sdio_glue *glue)
|
||||||
sdio_disable_func(func);
|
sdio_disable_func(func);
|
||||||
sdio_release_host(func);
|
sdio_release_host(func);
|
||||||
|
|
||||||
/* Power off the card manually in case it wasn't powered off above */
|
|
||||||
ret = mmc_power_save_host(card->host);
|
|
||||||
if (ret < 0)
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
/* Let runtime PM know the card is powered off */
|
/* Let runtime PM know the card is powered off */
|
||||||
pm_runtime_put_sync(&card->dev);
|
return pm_runtime_put_sync(&card->dev);
|
||||||
|
|
||||||
out:
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int wl12xx_sdio_set_power(struct device *child, bool enable)
|
static int wl12xx_sdio_set_power(struct device *child, bool enable)
|
||||||
|
|
Loading…
Add table
Reference in a new issue