Changeset 3171


Ignore:
Timestamp:
10/15/07 12:54:10 (6 years ago)
Author:
laforge
Message:

S3c24xx timer4 doesn't have PWM support, so don't even try to use it for that.
Also, refuse to reconfigure the prescaler 1 (shared between timer 2,3,4), since
that would modify the kernel timer clock tick.

Location:
trunk/src/target/kernel/patches
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/target/kernel/patches/gta01-vibrator.patch

    r3137 r3171  
    77--- /dev/null 
    88+++ linux-2.6.22.5-moko/drivers/leds/leds-gta01.c 
    9 @@ -0,0 +1,187 @@ 
     9@@ -0,0 +1,188 @@ 
    1010+/* 
    1111+ * LED driver for the FIC GTA01 (Neo1973) GSM Phone Vibrator 
     
    101101+ 
    102102+       vp->pwm->timerid= PWM3; 
    103 +       vp->pwm->prescaler = 0x0000; 
    104 +       vp->pwm->divider = S3C2410_TCFG1_MUX3_DIV8; 
     103+       /* use same prescaler as arch/arm/plat-s3c24xx/time.c */ 
     104+       vp->pwm->prescaler = (6 - 1) / 2; 
     105+       vp->pwm->divider = S3C2410_TCFG1_MUX3_DIV16; 
    105106+       vp->pwm->counter = COUNTER; 
    106107+       vp->pwm->comparer = COUNTER; 
  • trunk/src/target/kernel/patches/s3c2410-pwm.patch

    r3121 r3171  
    3939--- /dev/null 
    4040+++ linux-2.6.22.5-moko/arch/arm/mach-s3c2410/pwm.c 
    41 @@ -0,0 +1,222 @@ 
     41@@ -0,0 +1,234 @@ 
    4242+/* 
    4343+ * arch/arm/mach-s3c2410/3c2410-pwm.c 
     
    119119+ 
    120120+       /* divider & scaler slection */ 
    121 +       switch(s3c2410_pwm->timerid) { 
     121+       switch (s3c2410_pwm->timerid) { 
    122122+       case PWM0: 
    123123+               tcfg1 &= ~S3C2410_TCFG1_MUX0_MASK; 
     
    137137+               break; 
    138138+       case PWM4: 
    139 +               tcfg1 &= ~S3C2410_TCFG1_MUX4_MASK; 
    140 +               tcfg0 &= ~S3C2410_TCFG_PRESCALER1_MASK; 
     139+               /* timer four is not capable of doing PWM */ 
    141140+               break; 
    142141+       default: 
     
    146145+       /* divider & scaler values */ 
    147146+       tcfg1 |= s3c2410_pwm->divider; 
    148 +       tcfg0 |= s3c2410_pwm->prescaler; 
    149 + 
    150147+       __raw_writel(tcfg1, S3C2410_TCFG1); 
    151 +       __raw_writel(tcfg0, S3C2410_TCFG0); 
     148+ 
     149+       switch (s3c2410_pwm->timerid) { 
     150+       case PWM0: 
     151+       case PWM1: 
     152+               tcfg0 |= s3c2410_pwm->prescaler; 
     153+               __raw_writel(tcfg0, S3C2410_TCFG0); 
     154+               break; 
     155+       default: 
     156+               if ((tcfg0 | s3c2410_pwm->prescaler) != tcfg0) { 
     157+                       printk(KERN_WARNING "not changing prescaler of PWM %u," 
     158+                              " since it's shared with timer4 (clock tick)\n", 
     159+                              s3c2410_pwm->timerid); 
     160+               } 
     161+               break; 
     162+       } 
    152163+ 
    153164+       /* timer count and compare buffer initial values */ 
     
    190201+               break; 
    191202+       case PWM4: 
    192 +               tcon |= S3C2410_TCON_T4START; 
    193 +               tcon &= ~S3C2410_TCON_T4MANUALUPD; 
     203+               /* timer four is not capable of doing PWM */ 
     204+       default: 
     205+               return -1; 
    194206+       } 
    195207+ 
     
    229241+               break; 
    230242+       case PWM4: 
    231 +               tcon &= ~0x00080000; 
    232 +               tcon |= S3C2410_TCON_T4RELOAD; 
    233 +               tcon |= S3C2410_TCON_T3MANUALUPD; 
     243+               /* timer four is not capable of doing PWM */ 
     244+       default: 
     245+               return -1; 
    234246+       } 
    235247+ 
Note: See TracChangeset for help on using the changeset viewer.