• Ian Molton's avatar
    tmio_mmc: fix clock setup · da46a0bd
    Ian Molton authored
    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: default avatarIan Molton <ian@mnementh.co.uk>
    Signed-off-by: default avatarPierre Ossman <pierre@ossman.eu>
    da46a0bd
tmio_mmc.c 16.1 KB