]> git.baikalelectronics.ru Git - kernel.git/commit
tmio_mmc: fix clock setup
authorIan Molton <ian@mnementh.co.uk>
Fri, 12 Jun 2009 20:53:05 +0000 (21:53 +0100)
committerPierre Ossman <pierre@ossman.eu>
Sat, 13 Jun 2009 20:43:00 +0000 (22:43 +0200)
commitfffed4e01bf94115684ac110371e2b47b69189f5
tree5c2f750e8cc1e2821bb3c62d6b53cebc3937c6b0
parent12513be75be3303b2dd9360a1da38d3265c3e84b
tmio_mmc: fix clock setup

This patch fixes the clock setup in tmio_mmc.

  * Incorrect divider setting
  * Cruft written to the clock registers (seemingly harmless but Not
Good (tm))

It also eliminates some unnecessary ifs and tidies the loop syntax.

Thanks to Philipp Zabel who discovered the divider issue, commenting

   "Except for the SDCLK = HCLK (divider bypassed) case, the clock
    setting resulted in double the requested frequency.
    The smallest possible frequency (f_max/512) is configured with
    a divider setting 0x80, not 0x40."

Signed-off-by: Ian Molton <ian@mnementh.co.uk>
Signed-off-by: Pierre Ossman <pierre@ossman.eu>
drivers/mmc/host/tmio_mmc.c