arm: exynos: fix the div value for set_mmc_clk
Subsystems (2)
PATCH 1/1 arm: exynos: fix the div value for set_mmc_clk
The most exynos used the "Ratio + 1" as div value. And value at register is "Ratio".
So if want to set exact value, it needs to subtract one.
Value at register ("Ratio") = div - 1
--- arch/arm/cpu/armv7/exynos/clock.c | 6 ++++++ 1 file changed, 6 insertions(+)
arch/arm/cpu/armv7/exynos/clock.c +6 -0
@@ -1654,6 +1654,12 @@ unsigned long get_mmc_clk(int dev_index)void set_mmc_clk (int dev_index,unsigned int div) { +/* +* If want to set correct value, it needs to substract one from div. +*/ +if (div >0 ) + div -=1 ; +if (cpu_is_exynos5 ()) {if (proid_is_exynos5420 () ||proid_is_exynos5800 ())exynos5420_set_mmc_clk (dev_index, div);
Signature · 1 line
1.9.1
PATCH 1/1 arm: exynos: fix the div value for set_mmc_clk
Hi,
Quoted 16 lines · Jaehoon Chung
The most exynos used the "Ratio + 1" as div value. And value at register is "Ratio".
So if want to set exact value, it needs to subtract one.Value at register ("Ratio") = div - 1
Signed-off-by Jaehoon Chung <[email protected]>--- arch/arm/cpu/armv7/exynos/clock.c | 6 ++++++ 1 file changed, 6 insertions(+)arch/arm/cpu/armv7/exynos/clock.c +0
-0
arch/arm/cpu/armv7/exynos/clock.c unsigned long get_mmc_clk(int dev_index) · line 1659
Quoted 6 lines
arch/arm/cpu/armv7/exynos/clock.c +3
-0@@ -1654,6 +1654,12 @@ unsigned long get_mmc_clk(int dev_index)void set_mmc_clk (int dev_index,unsigned int div) { +/* +* If want to set correct value, it needs to substract one from div. +*/
wrong comment style
arch/arm/cpu/armv7/exynos/clock.c unsigned long get_mmc_clk(int dev_index) · line 1661
Quoted 2 lines
arch/arm/cpu/armv7/exynos/clock.c +2
-0+if (div >0 ) + div -=1 ;
On trats2 and odroid dts file, div value is set to 0x3. Then should it modified to 0x4 after applied this patch?
arch/arm/cpu/armv7/exynos/clock.c unsigned long get_mmc_clk(int dev_index) · line 1665
Quoted 5 lines
arch/arm/cpu/armv7/exynos/clock.c +1
-0+if (cpu_is_exynos5 ()) {if (proid_is_exynos5420 () ||proid_is_exynos5800 ())exynos5420_set_mmc_clk (dev_index, div);
Thanks,
Minkyu Kang.
PATCH 1/1 arm: exynos: fix the div value for set_mmc_clk
Hi,
Quoted 20 lines · Minkyu Kang
Hi,
Quoted 17 lines · Jaehoon Chung
The most exynos used the "Ratio + 1" as div value. And value at register is "Ratio".
So if want to set exact value, it needs to subtract one.Value at register ("Ratio") = div - 1
Signed-off-by Jaehoon Chung <[email protected]>--- arch/arm/cpu/armv7/exynos/clock.c | 6 ++++++ 1 file changed, 6 insertions(+)arch/arm/cpu/armv7/exynos/clock.c +0
-0@@ -1654,6 +1654,12 @@ unsigned long get_mmc_clk(int dev_index)
Quoted 7 lines
arch/arm/cpu/armv7/exynos/clock.c unsigned long get_mmc_clk(int dev_index) · line 1659
Quoted 5 lines
arch/arm/cpu/armv7/exynos/clock.c +3
-0void set_mmc_clk (int dev_index,unsigned int div) { +/* +* If want to set correct value, it needs to substract one from div. +*/ wrong comment style
Will fix.
Quoted 6 lines
arch/arm/cpu/armv7/exynos/clock.c unsigned long get_mmc_clk(int dev_index) · line 1661
Quoted 3 lines
arch/arm/cpu/armv7/exynos/clock.c +2
-0+if (div >0 ) + div -=1 ;On trats2 and odroid dts file, div value is set to
0x3. Then should it modified to0x4after applied this patch?
Those div values are not relevant to cmu.
Best Regards,
Jaehoon Chung
Quoted 10 lines
arch/arm/cpu/armv7/exynos/clock.c unsigned long get_mmc_clk(int dev_index) · line 1665
Quoted 6 lines
arch/arm/cpu/armv7/exynos/clock.c +1
-0+if (cpu_is_exynos5 ()) {if (proid_is_exynos5420 () ||proid_is_exynos5800 ())exynos5420_set_mmc_clk (dev_index, div);Thanks,
Minkyu Kang.