From 7e90d760ee14547145d7da01be4855ae7be5fe2c Mon Sep 17 00:00:00 2001 From: Dallas Foley Date: Thu, 16 Oct 2008 16:46:07 +0100 Subject: [PATCH 1/4] [ARM] S3C24XX: pwm-clock set_parent mask fix Fix s3c24xx pwm-clock supports use of the wrong clock when calculating the bitmask when configuring the parent clock from the set_parent call. Signed-off-by: Dallas Foley Signed-off-by: Ben Dooks --- arch/arm/plat-s3c24xx/pwm-clock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/plat-s3c24xx/pwm-clock.c b/arch/arm/plat-s3c24xx/pwm-clock.c index 306cc9c6f9ef..d41cccd6a25f 100644 --- a/arch/arm/plat-s3c24xx/pwm-clock.c +++ b/arch/arm/plat-s3c24xx/pwm-clock.c @@ -315,7 +315,7 @@ static int clk_pwm_tin_set_parent(struct clk *clk, struct clk *parent) if (parent == s3c24xx_pwmclk_tclk(id)) bits = S3C2410_TCFG1_MUX_TCLK << shift; else if (parent == s3c24xx_pwmclk_tdiv(id)) - bits = clk_pwm_tdiv_bits(to_tdiv(clk)) << shift; + bits = clk_pwm_tdiv_bits(to_tdiv(parent)) << shift; else return -EINVAL; From 5fed4a3739c97eceeac011baf9b2194bda47123f Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Thu, 16 Oct 2008 16:46:08 +0100 Subject: [PATCH 2/4] [ARM] S3C24XX: Serial driver debug depends on DEBUG_LL The SERIAL_SAMSUNG_DEBUG used printascii() to avoid debugging through itself when selected as a console. Disable this option when DEBUG_LL is not set (printascii is unavailable). Signed-off-by: Ben Dooks --- drivers/serial/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index db783b77a881..c94d3c4b7521 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig @@ -457,7 +457,7 @@ config SERIAL_SAMSUNG config SERIAL_SAMSUNG_DEBUG bool "Samsung SoC serial debug" - depends on SERIAL_SAMSUNG + depends on SERIAL_SAMSUNG && DEBUG_LL help Add support for debugging the serial driver. Since this is generally being used as a console, we use our own output From 5c37866c6e2f0d19896e4c14f386189c1fdf2295 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Thu, 16 Oct 2008 16:46:09 +0100 Subject: [PATCH 3/4] [ARM] S3C2443: Fix HCLK rate Fix the calculation of HCLK on the S3C2443, it should not have been passed through S3C2443_CLKDIV0_HALF_HCLK. Re-work of original patch from Wei Shuai Signed-off-by: Ben Dooks --- arch/arm/mach-s3c2443/clock.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm/mach-s3c2443/clock.c b/arch/arm/mach-s3c2443/clock.c index 603b5ea1deab..803e24cd29c4 100644 --- a/arch/arm/mach-s3c2443/clock.c +++ b/arch/arm/mach-s3c2443/clock.c @@ -1033,8 +1033,7 @@ void __init s3c2443_init_clocks(int xtal) fclk = pll / s3c2443_fclk_div(clkdiv0); hclk = s3c2443_prediv_getrate(&clk_prediv); - hclk = hclk / s3c2443_get_hdiv(clkdiv0); - hclk = hclk / ((clkdiv0 & S3C2443_CLKDIV0_HALF_HCLK) ? 2 : 1); + hclk /= s3c2443_get_hdiv(clkdiv0); pclk = hclk / ((clkdiv0 & S3C2443_CLKDIV0_HALF_PCLK) ? 2 : 1); s3c24xx_setup_clocks(xtal, fclk, hclk, pclk); From 55b404fd78792d7a88d19f2534510ee42841146f Mon Sep 17 00:00:00 2001 From: Nelson Castillo Date: Thu, 16 Oct 2008 16:46:10 +0100 Subject: [PATCH 4/4] [ARM] S3C24XX: Fix redefine of DEFINE_TIMER() in s3c24xx pwm-clock.c Do not redefine the DEFINE_TIMER macro. Renamed the local macro to DEFINE_S3C_TIMER. Signed-off-by: Nelson Castillo [ben-linux@fluff.org: spelling and subject fix] Signed-off-by: Ben Dooks --- arch/arm/plat-s3c24xx/pwm.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/arm/plat-s3c24xx/pwm.c b/arch/arm/plat-s3c24xx/pwm.c index 7a92c938542a..cbc06067d9ce 100644 --- a/arch/arm/plat-s3c24xx/pwm.c +++ b/arch/arm/plat-s3c24xx/pwm.c @@ -56,7 +56,7 @@ static struct clk *clk_scaler[2]; } \ } -#define DEFINE_TIMER(_tmr_no, _irq) \ +#define DEFINE_S3C_TIMER(_tmr_no, _irq) \ .name = "s3c24xx-pwm", \ .id = _tmr_no, \ .num_resources = TIMER_RESOURCE_SIZE, \ @@ -67,11 +67,11 @@ static struct clk *clk_scaler[2]; */ struct platform_device s3c_device_timer[] = { - [0] = { DEFINE_TIMER(0, IRQ_TIMER0) }, - [1] = { DEFINE_TIMER(1, IRQ_TIMER1) }, - [2] = { DEFINE_TIMER(2, IRQ_TIMER2) }, - [3] = { DEFINE_TIMER(3, IRQ_TIMER3) }, - [4] = { DEFINE_TIMER(4, IRQ_TIMER4) }, + [0] = { DEFINE_S3C_TIMER(0, IRQ_TIMER0) }, + [1] = { DEFINE_S3C_TIMER(1, IRQ_TIMER1) }, + [2] = { DEFINE_S3C_TIMER(2, IRQ_TIMER2) }, + [3] = { DEFINE_S3C_TIMER(3, IRQ_TIMER3) }, + [4] = { DEFINE_S3C_TIMER(4, IRQ_TIMER4) }, }; static inline int pwm_is_tdiv(struct pwm_device *pwm)