]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
mmc: dw_mmc-rockchip: MMC tuning with the clock phase framework
authorAlexandru M Stan <amstan@chromium.org>
Mon, 12 Oct 2015 12:48:28 +0000 (14:48 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 26 Oct 2015 15:00:12 +0000 (16:00 +0100)
commitcbb79e43c82635840cdcbf71b1d1c374e2c3a025
tree76a30a5348f966fecccdd338c672e3b0a5640f03
parentf8085bbada3b124b5b39b61bb1a7a0a78c24604b
mmc: dw_mmc-rockchip: MMC tuning with the clock phase framework

This algorithm will try 1 degree increments, since there's no way to tell
what resolution the underlying phase code uses. As an added bonus, doing
many tunings yields better results since some tests are run more than once
(ex: if the underlying driver uses 45 degree increments, the tuning code
will try the same angle more than once).

It will then construct a list of good phase ranges (even ranges that cross
360/0), will pick the biggest range then it will set the sample_clk to the
middle of that range.

We do not touch ciu_drive (and by extension define default-drive-phase).
Drive phase is mostly used to define minimum hold times, while one could
write some code to determine what phase meets the minimum hold time (ex 10
degrees) this will not work with the current clock phase framework (which
floors angles, so we'll get 0 deg, and there's no way to know what
resolution the floors happen at). We assume that the default drive angles
set by the hardware are good enough.

If a device has device specific code (like exynos) then that will still
take precedence, otherwise this new code will execute. If the device wants
to tune, but has no sample_clk defined we'll return EIO with an error
message.

Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/dw_mmc-rockchip.c