提交 af5d2b7b 编写于 作者: U Ulf Hansson

mmc: sdhci: Drop redundant code for SDIO IRQs

Nowadays sdhci prevents runtime suspend when SDIO IRQs are enabled.

However, some variants such as sdhci-esdhc-imx's, tries to allow runtime
suspend while having the SDIO IRQs enabled, but without supporting remote
wakeups. This support is a bit questionable, especially if the host device
have a PM domain attached that can be power gated, but more importantly,
the code have also become redundant (which was not the case when it was
introduced).

Rather than keeping the redundant code around, let's drop it and leave this
to be revisited later on.
Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
上级 a84ad324
...@@ -1666,12 +1666,10 @@ static int sdhci_esdhc_runtime_suspend(struct device *dev) ...@@ -1666,12 +1666,10 @@ static int sdhci_esdhc_runtime_suspend(struct device *dev)
if (host->tuning_mode != SDHCI_TUNING_MODE_3) if (host->tuning_mode != SDHCI_TUNING_MODE_3)
mmc_retune_needed(host->mmc); mmc_retune_needed(host->mmc);
if (!sdhci_sdio_irq_enabled(host)) { imx_data->actual_clock = host->mmc->actual_clock;
imx_data->actual_clock = host->mmc->actual_clock; esdhc_pltfm_set_clock(host, 0);
esdhc_pltfm_set_clock(host, 0); clk_disable_unprepare(imx_data->clk_per);
clk_disable_unprepare(imx_data->clk_per); clk_disable_unprepare(imx_data->clk_ipg);
clk_disable_unprepare(imx_data->clk_ipg);
}
clk_disable_unprepare(imx_data->clk_ahb); clk_disable_unprepare(imx_data->clk_ahb);
if (imx_data->socdata->flags & ESDHC_FLAG_PMQOS) if (imx_data->socdata->flags & ESDHC_FLAG_PMQOS)
...@@ -1695,15 +1693,15 @@ static int sdhci_esdhc_runtime_resume(struct device *dev) ...@@ -1695,15 +1693,15 @@ static int sdhci_esdhc_runtime_resume(struct device *dev)
if (err) if (err)
goto remove_pm_qos_request; goto remove_pm_qos_request;
if (!sdhci_sdio_irq_enabled(host)) { err = clk_prepare_enable(imx_data->clk_per);
err = clk_prepare_enable(imx_data->clk_per); if (err)
if (err) goto disable_ahb_clk;
goto disable_ahb_clk;
err = clk_prepare_enable(imx_data->clk_ipg); err = clk_prepare_enable(imx_data->clk_ipg);
if (err) if (err)
goto disable_per_clk; goto disable_per_clk;
esdhc_pltfm_set_clock(host, imx_data->actual_clock);
} esdhc_pltfm_set_clock(host, imx_data->actual_clock);
err = sdhci_runtime_resume_host(host, 0); err = sdhci_runtime_resume_host(host, 0);
if (err) if (err)
...@@ -1715,11 +1713,9 @@ static int sdhci_esdhc_runtime_resume(struct device *dev) ...@@ -1715,11 +1713,9 @@ static int sdhci_esdhc_runtime_resume(struct device *dev)
return err; return err;
disable_ipg_clk: disable_ipg_clk:
if (!sdhci_sdio_irq_enabled(host)) clk_disable_unprepare(imx_data->clk_ipg);
clk_disable_unprepare(imx_data->clk_ipg);
disable_per_clk: disable_per_clk:
if (!sdhci_sdio_irq_enabled(host)) clk_disable_unprepare(imx_data->clk_per);
clk_disable_unprepare(imx_data->clk_per);
disable_ahb_clk: disable_ahb_clk:
clk_disable_unprepare(imx_data->clk_ahb); clk_disable_unprepare(imx_data->clk_ahb);
remove_pm_qos_request: remove_pm_qos_request:
......
...@@ -3048,7 +3048,7 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id) ...@@ -3048,7 +3048,7 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id)
spin_lock(&host->lock); spin_lock(&host->lock);
if (host->runtime_suspended && !sdhci_sdio_irq_enabled(host)) { if (host->runtime_suspended) {
spin_unlock(&host->lock); spin_unlock(&host->lock);
return IRQ_NONE; return IRQ_NONE;
} }
......
...@@ -753,11 +753,6 @@ static inline void sdhci_read_caps(struct sdhci_host *host) ...@@ -753,11 +753,6 @@ static inline void sdhci_read_caps(struct sdhci_host *host)
__sdhci_read_caps(host, NULL, NULL, NULL); __sdhci_read_caps(host, NULL, NULL, NULL);
} }
static inline bool sdhci_sdio_irq_enabled(struct sdhci_host *host)
{
return !!(host->flags & SDHCI_SDIO_IRQ_ENABLED);
}
u16 sdhci_calc_clk(struct sdhci_host *host, unsigned int clock, u16 sdhci_calc_clk(struct sdhci_host *host, unsigned int clock,
unsigned int *actual_clock); unsigned int *actual_clock);
void sdhci_set_clock(struct sdhci_host *host, unsigned int clock); void sdhci_set_clock(struct sdhci_host *host, unsigned int clock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册