Patchwork [U-Boot,10/11,v3] Exynos: pwm: Use generic api to get pwm clk freq

login
register
mail settings
Submitter Akshay Saraswat
Date March 28, 2013, 2:32 p.m.
Message ID <1364481144-17495-10-git-send-email-akshay.s@samsung.com>
Download mbox | patch
Permalink /patch/232046/
State Accepted
Delegated to: Minkyu Kang
Headers show

Comments

Akshay Saraswat - March 28, 2013, 2:32 p.m.
From: Padmavathi Venna <padma.v@samsung.com>

Use generic api to get the pwm clock frequency

Test with command "sf probe 1:0; time sf read 40008000 0 1000".
Try with different numbers of bytes and see that sane values are obtained
Build and boot U-boot with this patch, backlight works properly.

Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
Signed-off-by: Akshay Saraswat <akshay.s@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
---
Changes since v2:
	- Replaced "exynos5_get_pwm_clk" with "clock_get_periph_rate" in get_pwm_clk
	  instead of replacing everywhere.
	- Added "Acked-by: Simon Glass".

Changes since v1:
	- Restored get_pwm_clk call in case of non-exynos5 cpu.

 arch/arm/cpu/armv7/exynos/clock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/arch/arm/cpu/armv7/exynos/clock.c b/arch/arm/cpu/armv7/exynos/clock.c
index 5860c8f..1e54e47 100644
--- a/arch/arm/cpu/armv7/exynos/clock.c
+++ b/arch/arm/cpu/armv7/exynos/clock.c
@@ -1354,7 +1354,7 @@  unsigned long get_i2c_clk(void)
 unsigned long get_pwm_clk(void)
 {
 	if (cpu_is_exynos5())
-		return exynos5_get_pwm_clk();
+		return clock_get_periph_rate(PERIPH_ID_PWM0);
 	else {
 		if (proid_is_exynos4412())
 			return exynos4x12_get_pwm_clk();