When core does not set the MMC_QUIRK_BROKEN_CLK_GATING flag enable
automatic hardware controlled clock gating on the mmc interface.

Signed-off-by: Michal Suchanek <[email protected]>
---
 drivers/mmc/host/sunxi-mmc.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
index f808a02..443cab5 100644
--- a/drivers/mmc/host/sunxi-mmc.c
+++ b/drivers/mmc/host/sunxi-mmc.c
@@ -601,8 +601,13 @@ static int sunxi_mmc_oclk_onoff(struct sunxi_mmc_host 
*host, u32 oclk_en)
        rval = mmc_readl(host, REG_CLKCR);
        rval &= ~(SDXC_CARD_CLOCK_ON | SDXC_LOW_POWER_ON);
 
-       if (oclk_en)
+       if (oclk_en) {
                rval |= SDXC_CARD_CLOCK_ON;
+               if (!host->mmc->card ||
+                    !(host->mmc->card->quirks & MMC_QUIRK_BROKEN_CLK_GATING))
+
+                       rval |= SDXC_LOW_POWER_ON;
+       }
 
        start = jiffies;
        end = start + msecs_to_jiffies(750);
-- 
2.1.4

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to