mmc: dw_mmc: Honor requests to set the clock to 0
authorDoug Anderson <dianders@chromium.org>
Fri, 30 Aug 2013 15:11:43 +0000 (00:11 +0900)
committerChris Ball <cjb@laptop.org>
Thu, 26 Sep 2013 01:32:04 +0000 (21:32 -0400)
commitfdf492a1cc6db8c13f650948f43855a077600895
tree1ab60020111594abb3f414588153e1710b7f6574
parente2c635999f44324d0c9db3330debd807be809507
mmc: dw_mmc: Honor requests to set the clock to 0

Previously the dw_mmc driver would ignore any requests to disable the
card's clock.  This doesn't seem like a good thing in general, but had
one extra bad side effect in the following situation:
* mmc core would set clk to 400kHz at boot time while scanning
* mmc core would set clk to 0 since no card, but it would be ignored.
* suspend to ram and resume; clocks in the dw_mmc IP block are now 0
  but dw_mmc thinks that they're 400kHz (it ignored the set to 0).
* insert card
* mmc core would set clk to 400kHz which would be considered a no-op.

Note that if there is no card in the slot and we do a suspend/resume
cycle, we _do_ still end up with differences in a dw_mmc register
dump, but the differences are clock related and we've got the clock
disabled both before and after, so this should be OK.

Signed-off-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/host/dw_mmc.c