mmc: mediatek: Fixed bug where clock frequency could be set wrong
authoryong mao <yong.mao@mediatek.com>
Sat, 4 Mar 2017 07:10:03 +0000 (15:10 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Thu, 16 Mar 2017 12:24:38 +0000 (13:24 +0100)
commit40ceda09c8c84694c2ca6b00bcc6dc71e8e62d96
treeebd0f88e7a15f7eadcb5721bdfedd946462a99b0
parent8ecc34448e24e9e8a8f3a9b37be70b43c6af5288
mmc: mediatek: Fixed bug where clock frequency could be set wrong

This patch can fix two issues:

Issue 1:
In previous code, div may be overflow when setting clock frequency
as f_min. We can use DIV_ROUND_UP to fix this boundary related
issue.

Issue 2:
In previous code, we can not set the correct clock frequency when
div equals 0xff.

Signed-off-by: Yong Mao <yong.mao@mediatek.com>
Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/mtk-sd.c