mmc/dw_mmc: Fix clock divider calculation error for bypass mode
PATCH 1/1 mmc/dw_mmc: Fix clock divider calculation error for bypass mode
To fix the clock divider calculation error when the controller clock same as the operating frequency. This is known as bypass mode. In this mode, the divider should be 0.
Signed-off-by Chin Liang See <[email protected]>
Cc Pantelis Antoniou <[email protected]>
Cc Rajeshwari Shinde <[email protected]>
Cc Jaehoon Chung <[email protected]>
Cc Mischa Jonker <[email protected]>
--- drivers/mmc/dw_mmc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/mmc/dw_mmc.c +4 -1
@@ -245,7 +245,10 @@ static int dwmci_setup_bus(struct dwmci_host *host, u32 freq)return -EINVAL ; } - div =DIV_ROUND_UP (sclk,2 * freq); +if (sclk == freq) + div =0 ;/* bypass mode */ +else + div =DIV_ROUND_UP (sclk,2 * freq);dwmci_writel (host,DWMCI_CLKENA ,0 );dwmci_writel (host,DWMCI_CLKSRC ,0 );
Signature · 1 line
1.7.9.5
Pantelis Antoniou
AppliedPATCH 1/1 mmc/dw_mmc: Fix clock divider calculation error for bypass mode
Hi Chin,
Quoted 32 lines · Chin Liang See
To fix the clock divider calculation error when the controller clock same as the operating frequency. This is known as bypass mode. In this mode, the divider should be 0.
Signed-off-by Chin Liang See <[email protected]>Cc Pantelis Antoniou <[email protected]>Cc Rajeshwari Shinde <[email protected]>Cc Jaehoon Chung <[email protected]>Cc Mischa Jonker <[email protected]>---
drivers/mmc/dw_mmc.c| 5 ++++-1 file changed, 4 insertions(+), 1 deletion(-)drivers/mmc/dw_mmc.c +4
-1@@ -245,7 +245,10 @@ static int dwmci_setup_bus(struct dwmci_host *host, u32 freq)return -EINVAL ; } - div =DIV_ROUND_UP (sclk,2 * freq); +if (sclk == freq) + div =0 ;/* bypass mode */ +else + div =DIV_ROUND_UP (sclk,2 * freq);dwmci_writel (host,DWMCI_CLKENA ,0 );dwmci_writel (host,DWMCI_CLKSRC ,0 );Signature · 1 line
1.7.9.5
Applied, thanks.
-- Pantelis