]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[ARM] S3C: Fix scaler1 clock rate information
authorBen Dooks <ben-linux@fluff.org>
Fri, 21 Nov 2008 10:36:06 +0000 (10:36 +0000)
committerBen Dooks <ben-linux@fluff.org>
Mon, 15 Dec 2008 21:46:25 +0000 (21:46 +0000)
The pwm-scaler0 and pwm-scaler1 clocks have their
.id field set to -1 as they are not referenced to
any specific device. However, parts of the pwm-clock
code used the .id field to identify which scaler
clock was being used.

Fix the problem by comparing against the pointer to
the clock to identify the scalers.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
arch/arm/plat-s3c/pwm-clock.c

index b0fcbc1fb64b7ffd0da804a5ad6b2fc7b2a91615..e07d82891a92259068e34abd4c1a8d2d47e4c5f1 100644 (file)
  * tclk -------------------------/
 */
 
+static struct clk clk_timer_scaler[];
+
 static unsigned long clk_pwm_scaler_get_rate(struct clk *clk)
 {
        unsigned long tcfg0 = __raw_readl(S3C2410_TCFG0);
 
-       if (clk->id == 1) {
+       if (clk == &clk_timer_scaler[1]) {
                tcfg0 &= S3C2410_TCFG_PRESCALER1_MASK;
                tcfg0 >>= S3C2410_TCFG_PRESCALER1_SHIFT;
        } else {
@@ -114,7 +116,7 @@ static int clk_pwm_scaler_set_rate(struct clk *clk, unsigned long rate)
        local_irq_save(flags);
        tcfg0 = __raw_readl(S3C2410_TCFG0);
 
-       if (clk->id == 1) {
+       if (clk == &clk_timer_scaler[1]) {
                tcfg0 &= ~S3C2410_TCFG_PRESCALER1_MASK;
                tcfg0 |= divisor << S3C2410_TCFG_PRESCALER1_SHIFT;
        } else {