]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mmc: meson: Assign the minimum clk rate as close to 400KHz as possible
authorUlf Hansson <ulf.hansson@linaro.org>
Wed, 8 Feb 2017 11:36:20 +0000 (12:36 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 14 Feb 2017 08:10:53 +0000 (09:10 +0100)
commita4c38c8dba98643602ae08c0867425b20a3c204b
tree71e60144cd7cf5404ed14974f5beb5af7c71bfc9
parent37dac0681e2be4f3c32b090a8c0591d4ce57e6f0
mmc: meson: Assign the minimum clk rate as close to 400KHz as possible

The current code dealing with calculating mmc->f_min is a bit complicated.
Additionally, the attempt to set an initial clock rate should explicitly
use a rate between 100KHz to 400 KHz, according the (e)MMC/SD specs, which
it doesn't.

Fix the problem and clean up the code by using clk_round_rate() to pick the
nearest minimum rate to 400KHz (rounded down from 400kHz).

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
[Heiner: Changed from 100KHz to 400KHz to get a proper rounded rate]
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
drivers/mmc/host/meson-gx-mmc.c