Send commitlog mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.openmoko.org/mailman/listinfo/commitlog
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of commitlog digest..."
Today's Topics:

   1. r3195 - branches/src/target/kernel/2.6.23.x/patches
      ([EMAIL PROTECTED])
   2. r3196 - branches/src/target/kernel/2.6.23.x/patches
      ([EMAIL PROTECTED])
   3. r3197 - branches/src/target/kernel/2.6.23.x/patches
      ([EMAIL PROTECTED])
--- Begin Message ---
Author: shoragan
Date: 2007-10-16 18:39:39 +0200 (Tue, 16 Oct 2007)
New Revision: 3195

Modified:
   branches/src/target/kernel/2.6.23.x/patches/smedia-glamo.patch
Log:
Follow change in 2.6.22:
(orig r3174):  laforge | 2007-10-15 14:50:15 +0200

the spi bus is number 2 (0+1 are s3c24xx internal spi0 and spi1)


Modified: branches/src/target/kernel/2.6.23.x/patches/smedia-glamo.patch
===================================================================
--- branches/src/target/kernel/2.6.23.x/patches/smedia-glamo.patch      
2007-10-16 16:19:59 UTC (rev 3194)
+++ branches/src/target/kernel/2.6.23.x/patches/smedia-glamo.patch      
2007-10-16 16:39:39 UTC (rev 3195)
@@ -2682,7 +2682,7 @@
 ===================================================================
 --- /dev/null
 +++ linux-2.6.23-rc8/drivers/video/glamo/glamo-spi-gpio.c
-@@ -0,0 +1,250 @@
+@@ -0,0 +1,251 @@
 +/*
 + * Copyright (C) 2007 OpenMoko, Inc.
 + * Author: Harald Welte <[EMAIL PROTECTED]>
@@ -2837,6 +2837,7 @@
 +
 +
 +      //memset(sp, 0, sizeof(struct glamo_spigpio));
++      master->bus_num = 2; /* FIXME: use dynamic number */
 +
 +      sp->master = spi_master_get(master);
 +      sp->glamo = sp->info->glamo;




--- End Message ---
--- Begin Message ---
Author: shoragan
Date: 2007-10-16 19:27:14 +0200 (Tue, 16 Oct 2007)
New Revision: 3196

Modified:
   branches/src/target/kernel/2.6.23.x/patches/gta01-backlight.patch
   branches/src/target/kernel/2.6.23.x/patches/gta01-vibrator.patch
   branches/src/target/kernel/2.6.23.x/patches/s3c2410-pwm.patch
Log:
Follow change in 2.6.22:
(orig r3179):  laforge | 2007-10-15 18:44:08 +0200

s3c2410_pwm:
* change structure name into one without _t suffix (it's not a typedef, thank 
god)
* don't allocate the pwm structure within s3c2410_pwm code, but rather embed it
  into other structures
* rename s3c2410_pwm variables into just 'pwm'
gta01-vibrator:
* adopt s3c2410_pwm api changes
* set gpio pwm mode at startup, not at every update
gta01-backlight:
* adopt s3c2410_pwm api changes


Modified: branches/src/target/kernel/2.6.23.x/patches/gta01-backlight.patch
===================================================================
--- branches/src/target/kernel/2.6.23.x/patches/gta01-backlight.patch   
2007-10-16 16:39:39 UTC (rev 3195)
+++ branches/src/target/kernel/2.6.23.x/patches/gta01-backlight.patch   
2007-10-16 17:27:14 UTC (rev 3196)
@@ -35,7 +35,7 @@
 ===================================================================
 --- /dev/null
 +++ linux-2.6.22.5-moko/drivers/video/backlight/gta01_bl.c
-@@ -0,0 +1,249 @@
+@@ -0,0 +1,253 @@
 +/*
 + *  Backlight Driver for FIC GTA01 (Neo1973) GSM Phone
 + *
@@ -89,7 +89,7 @@
 +      int intensity;
 +      struct mutex mutex;
 +      struct clk *clk;
-+      struct s3c2410_pwm_t *pwm;
++      struct s3c2410_pwm pwm;
 +};
 +
 +static struct gta01bl_data gta01bl;
@@ -130,7 +130,7 @@
 +              s3c2410_gpio_setpin(GTA01_GPIO_BACKLIGHT, 1);
 +              s3c2410_gpio_cfgpin(GTA01_GPIO_BACKLIGHT, S3C2410_GPIO_OUTPUT);
 +      } else  {
-+              s3c2410_pwm_duty_cycle(intensity & 0xffff, gta01bl.pwm);
++              s3c2410_pwm_duty_cycle(intensity & 0xffff, &gta01bl.pwm);
 +              s3c2410_gpio_cfgpin(GTA01_GPIO_BACKLIGHT, S3C2410_GPB0_TOUT0);
 +      }
 +#endif
@@ -140,18 +140,25 @@
 +      return 0;
 +}
 +
-+static void gta01bl_init_hw(void)
++static int gta01bl_init_hw(void)
 +{
-+      gta01bl.pwm->timerid = PWM0;
-+      gta01bl.pwm->prescaler = (4 - 1);
-+      gta01bl.pwm->divider = S3C2410_TCFG1_MUX0_DIV8;
-+      gta01bl.pwm->counter = (((gta01bl.pwm->pclk_rate) / 32) / GTA01BL_FREQ) 
-1;
-+      gta01bl.pwm->comparer = gta01bl.pwm->counter;
++      int rc;
 +
-+      s3c2410_pwm_enable(gta01bl.pwm);
-+      s3c2410_pwm_start(gta01bl.pwm);
++      gta01bl.pwm.timerid = PWM0;
++      gta01bl.pwm.prescaler = (4 - 1);
++      gta01bl.pwm.divider = S3C2410_TCFG1_MUX0_DIV8;
++      gta01bl.pwm.counter = (((gta01bl.pwm.pclk_rate) / 32) / GTA01BL_FREQ) 
-1;
++      gta01bl.pwm.comparer = gta01bl.pwm.counter;
 +
-+      gta01bl_prop.max_brightness = gta01bl.pwm->counter;
++      rc = s3c2410_pwm_enable(&gta01bl.pwm);
++      if (rc)
++              return rc;
++
++      s3c2410_pwm_start(&gta01bl.pwm);
++
++      gta01bl_prop.max_brightness = gta01bl.pwm.counter;
++
++      return 0;
 +}
 +
 +#ifdef CONFIG_PM
@@ -211,16 +218,15 @@
 +static int __init gta01bl_probe(struct platform_device *pdev)
 +{
 +      struct gta01bl_machinfo *machinfo = pdev->dev.platform_data;
++      int rc;
 +
 +#ifdef GTA01_BACKLIGHT_ONOFF_ONLY
 +      s3c2410_gpio_cfgpin(GTA01_GPIO_BACKLIGHT, S3C2410_GPIO_OUTPUT);
 +      gta01bl_prop.max_brightness = 1;
 +#else
-+      /* use s3c_device_timer0 for PWM */
-+      if (!(gta01bl.pwm = s3c2410_pwm_alloc()))
-+              return -ENOMEM;
-+
-+      gta01bl_init_hw();
++      rc = gta01bl_init_hw();
++      if (rc < 0)
++              return rc;
 +#endif
 +      mutex_init(&gta01bl.mutex);
 +
@@ -246,9 +252,7 @@
 +static int gta01bl_remove(struct platform_device *dev)
 +{
 +#ifndef GTA01_BACKLIGHT_ONOFF_ONLY
-+
-+      s3c2410_pwm_disable(gta01bl.pwm);
-+
++      s3c2410_pwm_disable(&gta01bl.pwm);
 +#endif
 +      backlight_device_unregister(gta01_backlight_device);
 +      mutex_destroy(&gta01bl.mutex);

Modified: branches/src/target/kernel/2.6.23.x/patches/gta01-vibrator.patch
===================================================================
--- branches/src/target/kernel/2.6.23.x/patches/gta01-vibrator.patch    
2007-10-16 16:39:39 UTC (rev 3195)
+++ branches/src/target/kernel/2.6.23.x/patches/gta01-vibrator.patch    
2007-10-16 17:27:14 UTC (rev 3196)
@@ -6,7 +6,7 @@
 ===================================================================
 --- /dev/null
 +++ linux-2.6.22.5-moko/drivers/leds/leds-gta01.c
-@@ -0,0 +1,188 @@
+@@ -0,0 +1,189 @@
 +/*
 + * LED driver for the FIC GTA01 (Neo1973) GSM Phone Vibrator
 + *
@@ -40,7 +40,7 @@
 +      unsigned int gpio;
 +      struct mutex mutex;
 +      unsigned int has_pwm;
-+      struct s3c2410_pwm_t *pwm;
++      struct s3c2410_pwm pwm;
 +};
 +
 +static inline struct gta01_vib_priv *pdev_to_vpriv(struct platform_device 
*dev)
@@ -65,8 +65,7 @@
 +       */
 +      mutex_lock(&vp->mutex);
 +      if (vp->has_pwm) {
-+                      s3c2410_pwm_duty_cycle(value/4, vp->pwm);
-+                      s3c2410_gpio_cfgpin(vp->gpio, S3C2410_GPB3_TOUT3);
++              s3c2410_pwm_duty_cycle(value/4, &vp->pwm);
 +      } else {
 +              if (value)
 +                      s3c2410_gpio_setpin(vp->gpio, 1);
@@ -96,21 +95,24 @@
 +}
 +#endif
 +
-+static void gta01vib_init_hw(struct platform_device *pdev)
++static int gta01vib_init_hw(struct gta01_vib_priv *vp)
 +{
-+      struct gta01_vib_priv *vp = pdev_to_vpriv(pdev);
++      int rc;
 +
-+      vp->pwm->timerid= PWM3;
++      vp->pwm.timerid= PWM3;
 +      /* use same prescaler as arch/arm/plat-s3c24xx/time.c */
-+      vp->pwm->prescaler = (6 - 1) / 2;
-+      vp->pwm->divider = S3C2410_TCFG1_MUX3_DIV2;
-+      vp->pwm->counter = COUNTER;
-+      vp->pwm->comparer = COUNTER;
++      vp->pwm.prescaler = (6 - 1) / 2;
++      vp->pwm.divider = S3C2410_TCFG1_MUX3_DIV2;
++      vp->pwm.counter = COUNTER;
++      vp->pwm.comparer = COUNTER;
 +
-+      s3c2410_pwm_enable(vp->pwm);
-+      s3c2410_pwm_start(vp->pwm);
++      rc = s3c2410_pwm_enable(&vp->pwm);
++      if (rc)
++              return rc;
 +
-+      return;
++      s3c2410_pwm_start(&vp->pwm);
++
++      return 0;
 +}
 +
 +static int __init gta01vib_probe(struct platform_device *pdev)
@@ -129,25 +131,24 @@
 +      if (!vp)
 +              return -ENOMEM;
 +
-+      platform_set_drvdata(pdev, vp);
-+
 +      vp->gpio = r->start;
 +
 +      /* TOUT3 */
 +      if (vp->gpio == S3C2410_GPB3) {
-+              vp->has_pwm = 1;
++              int rc;
 +
-+              vp->pwm = s3c2410_pwm_alloc();
-+              if (!vp->pwm) {
-+                      dev_err(&pdev->dev, "PWM allocation failed\n");
++              rc = gta01vib_init_hw(vp);
++              if (rc) {
 +                      kfree(vp);
-+                      return -ENOMEM;
++                      return rc;
 +              }
 +
-+              gta01vib_init_hw(pdev);
++              s3c2410_gpio_cfgpin(vp->gpio, S3C2410_GPB3_TOUT3);
++              vp->has_pwm = 1;
 +      }
 +
 +      mutex_init(&vp->mutex);
++      platform_set_drvdata(pdev, vp);
 +
 +      return led_classdev_register(&pdev->dev, &gta01_vib_led);
 +}
@@ -157,7 +158,7 @@
 +      struct gta01_vib_priv *vp = pdev_to_vpriv(pdev);
 +
 +      if (vp->has_pwm)
-+              s3c2410_pwm_disable(vp->pwm);
++              s3c2410_pwm_disable(&vp->pwm);
 +
 +      led_classdev_unregister(&gta01_vib_led);
 +      platform_set_drvdata(pdev, NULL);

Modified: branches/src/target/kernel/2.6.23.x/patches/s3c2410-pwm.patch
===================================================================
--- branches/src/target/kernel/2.6.23.x/patches/s3c2410-pwm.patch       
2007-10-16 16:39:39 UTC (rev 3195)
+++ branches/src/target/kernel/2.6.23.x/patches/s3c2410-pwm.patch       
2007-10-16 17:27:14 UTC (rev 3196)
@@ -1,7 +1,7 @@
-Index: linux-2.6.22/arch/arm/mach-s3c2410/Kconfig
+Index: linux-2.6.23/arch/arm/mach-s3c2410/Kconfig
 ===================================================================
---- linux-2.6.22.orig/arch/arm/mach-s3c2410/Kconfig
-+++ linux-2.6.22/arch/arm/mach-s3c2410/Kconfig
+--- linux-2.6.23.orig/arch/arm/mach-s3c2410/Kconfig
++++ linux-2.6.23/arch/arm/mach-s3c2410/Kconfig
 @@ -9,6 +9,7 @@
        depends on ARCH_S3C2410
        select S3C2410_CLOCK
@@ -22,10 +22,10 @@
  
  menu "S3C2410 Machines"
  
-Index: linux-2.6.22/arch/arm/mach-s3c2410/Makefile
+Index: linux-2.6.23/arch/arm/mach-s3c2410/Makefile
 ===================================================================
---- linux-2.6.22.orig/arch/arm/mach-s3c2410/Makefile
-+++ linux-2.6.22/arch/arm/mach-s3c2410/Makefile
+--- linux-2.6.23.orig/arch/arm/mach-s3c2410/Makefile
++++ linux-2.6.23/arch/arm/mach-s3c2410/Makefile
 @@ -16,6 +16,7 @@
  obj-$(CONFIG_S3C2410_PM)      += pm.o sleep.o
  obj-$(CONFIG_S3C2410_GPIO)    += gpio.o
@@ -34,11 +34,11 @@
  
  # Machine support
  
-Index: linux-2.6.22/arch/arm/mach-s3c2410/pwm.c
+Index: linux-2.6.23/arch/arm/mach-s3c2410/pwm.c
 ===================================================================
 --- /dev/null
-+++ linux-2.6.22/arch/arm/mach-s3c2410/pwm.c
-@@ -0,0 +1,234 @@
++++ linux-2.6.23/arch/arm/mach-s3c2410/pwm.c
+@@ -0,0 +1,210 @@
 +/*
 + * arch/arm/mach-s3c2410/3c2410-pwm.c
 + *
@@ -65,34 +65,8 @@
 +#include <asm/plat-s3c/regs-timer.h>
 +#include <asm/arch/pwm.h>
 +
-+struct s3c2410_pwm_t *s3c2410_pwm_alloc(void)
++int s3c2410_pwm_disable(struct s3c2410_pwm *pwm)
 +{
-+      struct s3c2410_pwm_t *s3c2410_pwm;
-+
-+        s3c2410_pwm = kzalloc(sizeof(*s3c2410_pwm), GFP_KERNEL);
-+        if (!s3c2410_pwm)
-+                /*return -ENOMEM;*/
-+              return NULL;
-+
-+      s3c2410_pwm->pclk = clk_get(NULL, "timers");
-+
-+      if (IS_ERR(s3c2410_pwm->pclk)) {
-+              /*return PTR_ERR(clk);*/
-+              kfree(s3c2410_pwm);
-+              return NULL;
-+      }
-+
-+      clk_enable(s3c2410_pwm->pclk);
-+
-+      s3c2410_pwm->pclk_rate = clk_get_rate(s3c2410_pwm->pclk);
-+
-+      return s3c2410_pwm;
-+}
-+
-+EXPORT_SYMBOL_GPL(s3c2410_pwm_alloc);
-+
-+int s3c2410_pwm_disable(struct s3c2410_pwm_t *s3c2410_pwm)
-+{
 +      unsigned long tcon;
 +
 +      /* stop timer */
@@ -100,25 +74,31 @@
 +        tcon &= 0xffffff00;
 +        __raw_writel(tcon, S3C2410_TCON);
 +
-+      clk_disable(s3c2410_pwm->pclk);
-+      clk_put(s3c2410_pwm->pclk);
++      clk_disable(pwm->pclk);
++      clk_put(pwm->pclk);
 +
-+      kfree(s3c2410_pwm);
++      kfree(pwm);
 +      return 0;
 +}
-+
 +EXPORT_SYMBOL_GPL(s3c2410_pwm_disable);
 +
-+int s3c2410_pwm_enable(struct s3c2410_pwm_t *s3c2410_pwm)
++int s3c2410_pwm_enable(struct s3c2410_pwm *pwm)
 +{
 +      unsigned long tcfg0, tcfg1, tcnt, tcmp;
 +
++      pwm->pclk = clk_get(NULL, "timers");
++      if (IS_ERR(pwm->pclk))
++              return PTR_ERR(pwm->pclk);
++
++      clk_enable(pwm->pclk);
++      pwm->pclk_rate = clk_get_rate(pwm->pclk);
++
 +      /* control registers bits */
 +      tcfg1 = __raw_readl(S3C2410_TCFG1);
 +      tcfg0 = __raw_readl(S3C2410_TCFG0);
 +
 +      /* divider & scaler slection */
-+      switch (s3c2410_pwm->timerid) {
++      switch (pwm->timerid) {
 +      case PWM0:
 +              tcfg1 &= ~S3C2410_TCFG1_MUX0_MASK;
 +              tcfg0 &= ~S3C2410_TCFG_PRESCALER0_MASK;
@@ -139,50 +119,51 @@
 +              /* timer four is not capable of doing PWM */
 +              break;
 +      default:
++              clk_disable(pwm->pclk);
++              clk_put(pwm->pclk);
 +              return -1;
 +      }
 +
 +      /* divider & scaler values */
-+      tcfg1 |= s3c2410_pwm->divider;
++      tcfg1 |= pwm->divider;
 +      __raw_writel(tcfg1, S3C2410_TCFG1);
 +
-+      switch (s3c2410_pwm->timerid) {
++      switch (pwm->timerid) {
 +      case PWM0:
 +      case PWM1:
-+              tcfg0 |= s3c2410_pwm->prescaler;
++              tcfg0 |= pwm->prescaler;
 +              __raw_writel(tcfg0, S3C2410_TCFG0);
 +              break;
 +      default:
-+              if ((tcfg0 | s3c2410_pwm->prescaler) != tcfg0) {
++              if ((tcfg0 | pwm->prescaler) != tcfg0) {
 +                      printk(KERN_WARNING "not changing prescaler of PWM %u,"
 +                             " since it's shared with timer4 (clock tick)\n",
-+                             s3c2410_pwm->timerid);
++                             pwm->timerid);
 +              }
 +              break;
 +      }
 +
 +      /* timer count and compare buffer initial values */
-+      tcnt = s3c2410_pwm->counter;
-+      tcmp = s3c2410_pwm->comparer;
++      tcnt = pwm->counter;
++      tcmp = pwm->comparer;
 +
-+      __raw_writel(tcnt, S3C2410_TCNTB(s3c2410_pwm->timerid));
-+      __raw_writel(tcmp, S3C2410_TCMPB(s3c2410_pwm->timerid));
++      __raw_writel(tcnt, S3C2410_TCNTB(pwm->timerid));
++      __raw_writel(tcmp, S3C2410_TCMPB(pwm->timerid));
 +
 +      /* ensure timer is stopped */
-+      s3c2410_pwm_stop(s3c2410_pwm);
++      s3c2410_pwm_stop(pwm);
 +
 +      return 0;
 +}
-+
 +EXPORT_SYMBOL_GPL(s3c2410_pwm_enable);
 +
-+int s3c2410_pwm_start(struct s3c2410_pwm_t *s3c2410_pwm)
++int s3c2410_pwm_start(struct s3c2410_pwm *pwm)
 +{
 +      unsigned long tcon;
 +
 +      tcon = __raw_readl(S3C2410_TCON);
 +
-+      switch (s3c2410_pwm->timerid) {
++      switch (pwm->timerid) {
 +      case PWM0:
 +              tcon |= S3C2410_TCON_T0START;
 +              tcon &= ~S3C2410_TCON_T0MANUALUPD;
@@ -202,23 +183,22 @@
 +      case PWM4:
 +              /* timer four is not capable of doing PWM */
 +      default:
-+              return -1;
++              return -ENODEV;
 +      }
 +
 +      __raw_writel(tcon, S3C2410_TCON);
 +
 +      return 0;
 +}
-+
 +EXPORT_SYMBOL_GPL(s3c2410_pwm_start);
 +
-+int s3c2410_pwm_stop(struct s3c2410_pwm_t *s3c2410_pwm)
++int s3c2410_pwm_stop(struct s3c2410_pwm *pwm)
 +{
 +      unsigned long tcon;
 +
 +      tcon = __raw_readl(S3C2410_TCON);
 +
-+      switch (s3c2410_pwm->timerid) {
++      switch (pwm->timerid) {
 +      case PWM0:
 +              tcon &= ~0x00000000;
 +              tcon |= S3C2410_TCON_T0RELOAD;
@@ -242,23 +222,21 @@
 +      case PWM4:
 +              /* timer four is not capable of doing PWM */
 +      default:
-+              return -1;
++              return -ENODEV;
 +      }
 +
 +      __raw_writel(tcon, S3C2410_TCON);
 +
 +      return 0;
 +}
-+
 +EXPORT_SYMBOL_GPL(s3c2410_pwm_stop);
 +
-+int s3c2410_pwm_duty_cycle(int reg_value, struct s3c2410_pwm_t *s3c2410_pwm)
++int s3c2410_pwm_duty_cycle(int reg_value, struct s3c2410_pwm *pwm)
 +{
-+      __raw_writel(reg_value, S3C2410_TCMPB(s3c2410_pwm->timerid));
++      __raw_writel(reg_value, S3C2410_TCMPB(pwm->timerid));
 +
 +      return 0;
 +}
-+
 +EXPORT_SYMBOL_GPL(s3c2410_pwm_duty_cycle);
 +
 +int s3c2410_pwm_dumpregs(void)
@@ -270,14 +248,12 @@
 +
 +      return 0;
 +}
-+
 +EXPORT_SYMBOL_GPL(s3c2410_pwm_dumpregs);
-+
-Index: linux-2.6.22/include/asm-arm/arch-s3c2410/pwm.h
+Index: linux-2.6.23/include/asm-arm/arch-s3c2410/pwm.h
 ===================================================================
 --- /dev/null
-+++ linux-2.6.22/include/asm-arm/arch-s3c2410/pwm.h
-@@ -0,0 +1,39 @@
++++ linux-2.6.23/include/asm-arm/arch-s3c2410/pwm.h
+@@ -0,0 +1,38 @@
 +#ifndef __S3C2410_PWM_H
 +#define __S3C2410_PWM_H
 +
@@ -298,7 +274,7 @@
 +      PWM4
 +};
 +
-+struct s3c2410_pwm_t {
++struct s3c2410_pwm {
 +      enum pwm_timer timerid;
 +      struct clk *pclk;
 +      unsigned long pclk_rate;
@@ -308,12 +284,11 @@
 +      unsigned long comparer;
 +};
 +
-+struct s3c2410_pwm_t *s3c2410_pwm_alloc(void);
-+int s3c2410_pwm_enable(struct s3c2410_pwm_t *s3c2410_pwm);
-+int s3c2410_pwm_disable(struct s3c2410_pwm_t *s3c2410_pwm);
-+int s3c2410_pwm_start(struct s3c2410_pwm_t *s3c2410_pwm);
-+int s3c2410_pwm_stop(struct s3c2410_pwm_t *s3c2410_pwm);
-+int s3c2410_pwm_duty_cycle(int reg_value, struct s3c2410_pwm_t *s3c2410_pwm);
++int s3c2410_pwm_enable(struct s3c2410_pwm *s3c2410_pwm);
++int s3c2410_pwm_disable(struct s3c2410_pwm *s3c2410_pwm);
++int s3c2410_pwm_start(struct s3c2410_pwm *s3c2410_pwm);
++int s3c2410_pwm_stop(struct s3c2410_pwm *s3c2410_pwm);
++int s3c2410_pwm_duty_cycle(int reg_value, struct s3c2410_pwm *s3c2410_pwm);
 +int s3c2410_pwm_dumpregs(void);
 +
 +#endif /* __S3C2410_PWM_H */




--- End Message ---
--- Begin Message ---
Author: shoragan
Date: 2007-10-16 19:54:28 +0200 (Tue, 16 Oct 2007)
New Revision: 3197

Added:
   branches/src/target/kernel/2.6.23.x/patches/gta02-leds.patch
Removed:
   branches/src/target/kernel/2.6.23.x/patches/gta02-leds.patch
Modified:
   branches/src/target/kernel/2.6.23.x/patches/gta02-core.patch
   branches/src/target/kernel/2.6.23.x/patches/series
Log:
Follow change in 2.6.22:
(orig r3181):  laforge | 2007-10-15 18:44:47 +0200

Add GTA02 LED driver as well as required platform devices/resources


Modified: branches/src/target/kernel/2.6.23.x/patches/gta02-core.patch
===================================================================
--- branches/src/target/kernel/2.6.23.x/patches/gta02-core.patch        
2007-10-16 17:27:14 UTC (rev 3196)
+++ branches/src/target/kernel/2.6.23.x/patches/gta02-core.patch        
2007-10-16 17:54:28 UTC (rev 3197)
@@ -2,7 +2,7 @@
 ===================================================================
 --- /dev/null
 +++ linux-2.6.22/arch/arm/mach-s3c2440/mach-gta02.c
-@@ -0,0 +1,614 @@
+@@ -0,0 +1,636 @@
 +/*
 + * linux/arch/arm/mach-s3c2440/mach-gta02.c
 + *
@@ -440,16 +440,37 @@
 +      .board_info     = gta02_spi_board_info,
 +};
 +
-+static struct resource gta02_led_resources[] = {
++static struct resource gta01_led_resources[] = {
 +      [0] = {
 +              .start  = GTA02_GPIO_VIBRATOR_ON,
 +              .end    = GTA02_GPIO_VIBRATOR_ON,
 +      },
-+      /* FIXME */
 +};
 +
++static struct platform_device gta01_led_dev = {
++      .name           = "gta01-led",
++      .num_resources  = ARRAY_SIZE(gta01_led_resources),
++      .resource       = gta01_led_resources,
++};
++
++static struct resource gta02_led_resources[] = {
++      {
++              .name   = "gta02-power:color",
++              .start  = GTA02_GPIO_PWR_LED,
++              .end    = GTA02_GPIO_PWR_LED,
++      }, {
++              .name   = "gta02-aux:foo",
++              .start  = GTA02_GPIO_AUX_LED1,
++              .end    = GTA02_GPIO_AUX_LED1,
++      }, {
++              .name   = "gta02-aux:bar",
++              .start  = GTA02_GPIO_AUX_LED2,
++              .end    = GTA02_GPIO_AUX_LED2,
++      },
++};
++
 +struct platform_device gta02_led_dev = {
-+      .name           = "gta01-led",
++      .name           = "gta02-led",
 +      .num_resources  = ARRAY_SIZE(gta02_led_resources),
 +      .resource       = gta02_led_resources,
 +};
@@ -589,6 +610,7 @@
 +
 +      mangle_pmu_pdata_by_system_rev();
 +      platform_device_register(&gta02_pmu_dev);
++      platform_device_register(&gta01_led_dev);
 +      platform_device_register(&gta02_led_dev);
 +
 +      mangle_glamo_res_by_system_rev();
@@ -621,7 +643,7 @@
 ===================================================================
 --- /dev/null
 +++ linux-2.6.22/include/asm-arm/arch-s3c2410/gta02.h
-@@ -0,0 +1,94 @@
+@@ -0,0 +1,97 @@
 +#ifndef _GTA02_H
 +#define _GTA02_H
 +
@@ -636,6 +658,9 @@
 +
 +#define GTA02_GPIO_n3DL_GSM   S3C2410_GPA13   /* v1 + v2 + v3 only */
 +
++#define GTA02_GPIO_AUX_LED1   S3C2410_GPB0
++#define GTA02_GPIO_AUX_LED2   S3C2410_GPB1
++#define GTA02_GPIO_PWR_LED    S3C2410_GPB2
 +#define GTA02_GPIO_VIBRATOR_ON        S3C2410_GPB3
 +#define GTA02v1_GPIO_GPS_PWRON        S3C2410_GPB4    /* v1 only */
 +#define GTA02_GPIO_MODEM_RST  S3C2410_GPB5
@@ -978,9 +1003,9 @@
 +MODULE_DESCRIPTION("FIC Neo1973 GSM Power Management");
 Index: linux-2.6.22/drivers/leds/leds-gta01.c
 ===================================================================
---- linux-2.6.22.orig/drivers/leds/leds-gta01.c
-+++ linux-2.6.22/drivers/leds/leds-gta01.c
-@@ -71,7 +71,7 @@
+--- linux-2.6.22.5-moko.orig/drivers/leds/leds-gta01.c
++++ linux-2.6.22.5-moko/drivers/leds/leds-gta01.c
+@@ -111,7 +110,7 @@
        struct gta01_vib_priv *vp;
        struct resource *r;
  
@@ -993,7 +1018,7 @@
 ===================================================================
 --- linux-2.6.22.orig/sound/soc/s3c24xx/neo1973_wm8753.c
 +++ linux-2.6.22/sound/soc/s3c24xx/neo1973_wm8753.c
-@@ -638,6 +638,12 @@
+@@ -670,6 +670,12 @@
  {
        int ret;
  
@@ -1006,7 +1031,7 @@
        neo1973_snd_device = platform_device_alloc("soc-audio", -1);
        if (!neo1973_snd_device)
                return -ENOMEM;
-@@ -666,5 +672,5 @@
+@@ -698,5 +704,5 @@
  
  /* Module information */
  MODULE_AUTHOR("Graeme Gregory, [EMAIL PROTECTED], www.wolfsonmicro.com");

Deleted: branches/src/target/kernel/2.6.23.x/patches/gta02-leds.patch
===================================================================
--- branches/src/target/kernel/2.6.23.x/patches/gta02-leds.patch        
2007-10-16 17:27:14 UTC (rev 3196)
+++ branches/src/target/kernel/2.6.23.x/patches/gta02-leds.patch        
2007-10-16 17:54:28 UTC (rev 3197)
@@ -1,97 +0,0 @@
-Index: linux-2.6.22/arch/arm/mach-s3c2440/mach-gta02.c
-===================================================================
---- linux-2.6.22.orig/arch/arm/mach-s3c2440/mach-gta02.c
-+++ linux-2.6.22/arch/arm/mach-s3c2440/mach-gta02.c
-@@ -541,17 +541,57 @@
- #endif
- #endif
- 
--static struct s3c24xx_led_platdata gta02_led_pdata = {
--    .name       = "gta02-vib",
--    .gpio       = GTA02_GPIO_VIBRATOR_ON,
--    .def_trigger    = "",
-+static struct s3c24xx_led_platdata gta02_led_pdata[] = {
-+    [0] = {
-+        .name        = "gta02-led-pwr1",
-+        .gpio        = GTA02_GPIO_LED_PWR1_ON,
-+        .def_trigger = "",
-+    },
-+    [1] = {
-+        .name        = "gta02-led-pwr2",
-+        .gpio        = GTA02_GPIO_LED_PWR2_ON,
-+        .def_trigger = "",
-+    },
-+    [2] = {
-+        .name        = "gta02-led-aux",
-+        .gpio        = GTA02_GPIO_LED_AUX_ON,
-+        .def_trigger = "",
-+    },
-+    [3] = {
-+        .name        = "gta02-vib",
-+        .gpio        = GTA02_GPIO_VIBRATOR_ON,
-+        .def_trigger = "",
-+    },
- };
- 
--static struct platform_device gta02_led_dev = {
--    .name       = "s3c24xx_led",
--    .id     = 1,
--    .dev        = {
--        .platform_data  = &gta02_led_pdata,
-+static struct platform_device gta02_led_dev[] = {
-+    [0] = {
-+        .name = "s3c24xx_led",
-+        .id   = 0,
-+        .dev  = {
-+            .platform_data = &gta02_led_pdata[0],
-+        },
-+    },
-+    [1] = {
-+        .name = "s3c24xx_led",
-+        .id   = 1,
-+        .dev  = {
-+            .platform_data = &gta02_led_pdata[1],
-+        },
-+    },
-+    [2] = {
-+        .name = "s3c24xx_led",
-+        .id   = 2,
-+        .dev  = {
-+            .platform_data = &gta02_led_pdata[2],
-+        },
-+    },
-+    [3] = {
-+        .name = "s3c24xx_led",
-+        .id   = 3,
-+        .dev  = {
-+            .platform_data = &gta02_led_pdata[3],
-+        },
-     },
- };
- 
-@@ -681,7 +721,10 @@
- 
-       mangle_pmu_pdata_by_system_rev();
-       platform_device_register(&gta02_pmu_dev);
--      platform_device_register(&gta02_led_dev);
-+      platform_device_register(&gta02_led_dev[0]);
-+      platform_device_register(&gta02_led_dev[1]);
-+      platform_device_register(&gta02_led_dev[2]);
-+      platform_device_register(&gta02_led_dev[3]);
- 
-       mangle_glamo_res_by_system_rev();
-       platform_device_register(&gta02_glamo_dev);
-Index: linux-2.6.22/include/asm-arm/arch-s3c2410/gta02.h
-===================================================================
---- linux-2.6.22.orig/include/asm-arm/arch-s3c2410/gta02.h
-+++ linux-2.6.22/include/asm-arm/arch-s3c2410/gta02.h
-@@ -12,6 +12,9 @@
- #define GTA02_GPIO_3D_RESET   S3C2440_GPJ0
- #define GTA02_GPIO_nSD_DETECT S3C2410_GPF5
- #define GTA02_GPIO_USB_PULLUP S3C2410_GPB9
-+#define GTA02_GPIO_LED_PWR1_ON  S3C2410_GPB0
-+#define GTA02_GPIO_LED_PWR2_ON  S3C2410_GPB1
-+#define GTA02_GPIO_LED_AUX_ON   S3C2410_GPB2
- #define GTA02_GPIO_VIBRATOR_ON        S3C2410_GPB3
- #define GTA02_GPIO_HOLD_KEY   S3C2410_GPF7
- #define GTA02_GPIO_AUX_KEY    S3C2410_GPF6

Added: branches/src/target/kernel/2.6.23.x/patches/gta02-leds.patch
===================================================================
--- branches/src/target/kernel/2.6.23.x/patches/gta02-leds.patch        
2007-10-16 17:27:14 UTC (rev 3196)
+++ branches/src/target/kernel/2.6.23.x/patches/gta02-leds.patch        
2007-10-16 17:54:28 UTC (rev 3197)
@@ -0,0 +1,250 @@
+Index: linux-2.6.23/drivers/leds/Kconfig
+===================================================================
+--- linux-2.6.23.orig/drivers/leds/Kconfig
++++ linux-2.6.23/drivers/leds/Kconfig
+@@ -107,6 +107,12 @@
+       help
+         This option enables support for the Vibrator on the FIC Neo1973.
+ 
++config LEDS_GTA02
++      tristate "LED Support for the FIC Neo1973 (GTA02)"
++      depends on LEDS_CLASS && MACH_NEO1973_GTA02
++      help
++        This option enables support for the LEDs on the FIC Neo1973.
++
+ comment "LED Triggers"
+ 
+ config LEDS_TRIGGERS
+Index: linux-2.6.23/drivers/leds/Makefile
+===================================================================
+--- linux-2.6.23.orig/drivers/leds/Makefile
++++ linux-2.6.23/drivers/leds/Makefile
+@@ -18,6 +18,7 @@
+ obj-$(CONFIG_LEDS_COBALT)             += leds-cobalt.o
+ obj-$(CONFIG_LEDS_GPIO)                       += leds-gpio.o
+ obj-$(CONFIG_LEDS_GTA01)              += leds-gta01.o
++obj-$(CONFIG_LEDS_GTA02)              += leds-gta02.o
+ 
+ # LED Triggers
+ obj-$(CONFIG_LEDS_TRIGGER_TIMER)      += ledtrig-timer.o
+Index: linux-2.6.23/drivers/leds/leds-gta02.c
+===================================================================
+--- /dev/null
++++ linux-2.6.23/drivers/leds/leds-gta02.c
+@@ -0,0 +1,216 @@
++/*
++ * LED driver for the FIC GTA02 (Neo1973) GSM Phone
++ *
++ * (C) 2006-2007 by OpenMoko, Inc.
++ * Author: Harald Welte <[EMAIL PROTECTED]>
++ * All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ *
++ */
++
++#include <linux/kernel.h>
++#include <linux/init.h>
++#include <linux/platform_device.h>
++#include <linux/leds.h>
++#include <asm/hardware.h>
++#include <asm/mach-types.h>
++#include <asm/arch/pwm.h>
++#include <asm/arch/gta02.h>
++#include <asm/plat-s3c/regs-timer.h>
++
++#define MAX_LEDS 3
++#define COUNTER 256
++
++struct gta02_led_priv
++{
++      struct mutex mutex;
++      struct led_classdev cdev;
++      struct s3c2410_pwm pwm;
++      unsigned int gpio;
++      unsigned int has_pwm;
++};
++
++struct gta02_led_bundle
++{
++      int num_leds;
++      struct gta02_led_priv led[MAX_LEDS];
++};
++
++static inline struct gta02_led_priv *to_priv(struct led_classdev *led_cdev)
++{
++      return container_of(led_cdev, struct gta02_led_priv, cdev);
++}
++
++static inline struct gta02_led_bundle *to_bundle(struct led_classdev 
*led_cdev)
++{
++      return dev_get_drvdata(led_cdev->class_dev->dev);
++}
++
++static void gta02led_set(struct led_classdev *led_cdev,
++              enum led_brightness value)
++{
++      struct gta02_led_priv *lp = to_priv(led_cdev);
++
++      /*
++       * value == 255 -> 99% duty cycle (full power)
++       * value == 128 -> 50% duty cycle (medium power)
++       * value == 0 -> 0% duty cycle (zero power)
++       */
++      mutex_lock(&lp->mutex);
++      if (lp->has_pwm) {
++                      s3c2410_pwm_duty_cycle(value, &lp->pwm);
++      } else {
++              if (value)
++                      s3c2410_gpio_setpin(lp->gpio, 1);
++              else
++                      s3c2410_gpio_setpin(lp->gpio, 0);
++      }
++      mutex_unlock(&lp->mutex);
++}
++
++#ifdef CONFIG_PM
++static int gta02led_suspend(struct platform_device *pdev, pm_message_t state)
++{
++      struct gta02_led_bundle *bundle = platform_get_drvdata(pdev);
++      int i;
++
++      for (i = 0; i < bundle->num_leds; i++)
++              led_classdev_suspend(&bundle->led[i].cdev);
++
++      return 0;
++}
++
++static int gta02led_resume(struct platform_device *pdev)
++{
++      struct gta02_led_bundle *bundle = platform_get_drvdata(pdev);
++      int i;
++
++      for (i = 0; i < bundle->num_leds; i++)
++              led_classdev_resume(&bundle->led[i].cdev);
++
++      return 0;
++}
++#endif
++
++static int __init gta02led_probe(struct platform_device *pdev)
++{
++      int i, rc;
++      struct gta02_led_bundle *bundle;
++
++      if (!machine_is_neo1973_gta02())
++              return -EIO;
++
++      bundle = kzalloc(sizeof(struct gta02_led_bundle), GFP_KERNEL);
++      if (!bundle)
++              return -ENOMEM;
++      platform_set_drvdata(pdev, bundle);
++
++      for (i = 0; i < pdev->num_resources; i++) {
++              struct gta02_led_priv *lp;
++              struct resource *r;
++
++              if (i >= MAX_LEDS)
++                      break;
++
++              r = platform_get_resource(pdev, 0, i);
++              if (!r || !r->start || !r->name)
++                      continue;
++
++              lp = &bundle->led[i];
++
++              lp->gpio = r->start;
++              lp->cdev.name = r->name;
++              lp->cdev.brightness_set = gta02led_set;
++
++              switch (lp->gpio) {
++              case S3C2410_GPB0:
++                      lp->has_pwm = 1;
++                      lp->pwm.timerid = PWM0;
++                      s3c2410_gpio_cfgpin(lp->gpio, S3C2410_GPB0_TOUT0);
++                      break;
++              case S3C2410_GPB1:
++                      lp->has_pwm = 1;
++                      lp->pwm.timerid = PWM1;
++                      s3c2410_gpio_cfgpin(lp->gpio, S3C2410_GPB1_TOUT1);
++                      break;
++              case S3C2410_GPB2:
++                      lp->has_pwm = 1;
++                      lp->pwm.timerid = PWM2;
++                      s3c2410_gpio_cfgpin(lp->gpio, S3C2410_GPB2_TOUT2);
++                      break;
++              case S3C2410_GPB3:
++                      lp->has_pwm = 1;
++                      lp->pwm.timerid = PWM3;
++                      s3c2410_gpio_cfgpin(lp->gpio, S3C2410_GPB3_TOUT3);
++                      break;
++              default:
++                      break;
++              }
++
++              if (lp->has_pwm) {
++                      lp->pwm.prescaler = 0;
++                      lp->pwm.divider = S3C2410_TCFG1_MUX3_DIV8;
++                      lp->pwm.counter = COUNTER;
++                      lp->pwm.comparer = COUNTER;
++                      s3c2410_pwm_enable(&lp->pwm);
++                      s3c2410_pwm_start(&lp->pwm);
++              }
++
++              mutex_init(&lp->mutex);
++              rc = led_classdev_register(&pdev->dev, &lp->cdev);
++      }
++
++      return 0;
++}
++
++static int gta02led_remove(struct platform_device *pdev)
++{
++      struct gta02_led_bundle *bundle = platform_get_drvdata(pdev);
++      int i;
++
++      for (i = 0; i < bundle->num_leds; i++) {
++              struct gta02_led_priv *lp = &bundle->led[i];
++              if (lp->has_pwm)
++                      s3c2410_pwm_disable(&lp->pwm);
++
++              led_classdev_unregister(&lp->cdev);
++              mutex_destroy(&lp->mutex);
++      }
++
++      platform_set_drvdata(pdev, NULL);
++      kfree(bundle);
++
++      return 0;
++}
++
++static struct platform_driver gta02led_driver = {
++      .probe          = gta02led_probe,
++      .remove         = gta02led_remove,
++#ifdef CONFIG_PM
++      .suspend        = gta02led_suspend,
++      .resume         = gta02led_resume,
++#endif
++      .driver         = {
++              .name           = "gta02-led",
++      },
++};
++
++static int __init gta02led_init(void)
++{
++      return platform_driver_register(&gta02led_driver);
++}
++
++static void __exit gta02led_exit(void)
++{
++      platform_driver_unregister(&gta02led_driver);
++}
++
++module_init(gta02led_init);
++module_exit(gta02led_exit);
++
++MODULE_AUTHOR("Harald Welte <[EMAIL PROTECTED]>");
++MODULE_DESCRIPTION("FIC GTA02 LED driver");
++MODULE_LICENSE("GPL");

Modified: branches/src/target/kernel/2.6.23.x/patches/series
===================================================================
--- branches/src/target/kernel/2.6.23.x/patches/series  2007-10-16 17:27:14 UTC 
(rev 3196)
+++ branches/src/target/kernel/2.6.23.x/patches/series  2007-10-16 17:54:28 UTC 
(rev 3197)
@@ -51,4 +51,4 @@
 explicitly-link-notes-section.patch
 fix-s3c2410fb-register-access.patch
 lis302dl.patch
-#gta02-leds.patch
+gta02-leds.patch




--- End Message ---
_______________________________________________
commitlog mailing list
[email protected]
http://lists.openmoko.org/mailman/listinfo/commitlog

Reply via email to