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. r3126 - branches/src/target/kernel/2.6.23.x/patches
      ([EMAIL PROTECTED])
   2. r3127 - branches/src/target/kernel/2.6.23.x/patches
      ([EMAIL PROTECTED])
   3. r3128 - branches/src/target/kernel/2.6.23.x/patches
      ([EMAIL PROTECTED])
   4. r3129 - branches/src/target/kernel/2.6.23.x/patches
      ([EMAIL PROTECTED])
   5. r3130 - branches/src/target/kernel/2.6.23.x/patches
      ([EMAIL PROTECTED])
   6. r3131 - branches/src/target/kernel/2.6.23.x/patches
      ([EMAIL PROTECTED])
   7. r3132 - branches/src/target/kernel/2.6.23.x/patches
      ([EMAIL PROTECTED])
--- Begin Message ---
Author: shoragan
Date: 2007-10-09 17:14:59 +0200 (Tue, 09 Oct 2007)
New Revision: 3126

Modified:
   branches/src/target/kernel/2.6.23.x/patches/gta02-core.patch
   branches/src/target/kernel/2.6.23.x/patches/smedia-glamo.patch
Log:
Follow change in 2.6.22:
(orig r3112):  laforge | 2007-10-08 13:26:02 +0200

glamo/gta02: The end address of resouces should be minus by one.  This patch
also fixes a typo where glamo-3d uses glamo-2d's resources. (Chia-I Wu)

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-09 15:10:29 UTC (rev 3125)
+++ branches/src/target/kernel/2.6.23.x/patches/gta02-core.patch        
2007-10-09 15:14:59 UTC (rev 3126)
@@ -580,7 +580,7 @@
 +static struct resource gta02_glamo_resources[] = {
 +      [0] = {
 +              .start  = S3C2410_CS1,
-+              .end    = S3C2410_CS1 + 0x1000000,
++              .end    = S3C2410_CS1 + 0x1000000 - 1,
 +              .flags  = IORESOURCE_MEM,
 +      },
 +      [1] = {

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-09 15:10:29 UTC (rev 3125)
+++ branches/src/target/kernel/2.6.23.x/patches/smedia-glamo.patch      
2007-10-09 15:14:59 UTC (rev 3126)
@@ -73,7 +73,7 @@
 ===================================================================
 --- /dev/null
 +++ linux-2.6.23-rc8/drivers/video/glamo/glamo-regs.h
-@@ -0,0 +1,466 @@
+@@ -0,0 +1,467 @@
 +#ifndef _GLAMO_REGS_H
 +#define _GLAMO_REGS_H
 +
@@ -115,6 +115,7 @@
 +      GLAMO_REGOFS_RISC       = 0x1680,
 +      GLAMO_REGOFS_2D         = 0x1700,
 +      GLAMO_REGOFS_3D         = 0x1b00,
++      GLAMO_REGOFS_END        = 0x2400,
 +};
 +
 +
@@ -697,7 +698,7 @@
 +      {
 +              /* FIXME: those need to be incremented by parent base */
 +              .start  = GLAMO_REGOFS_MMC,
-+              .end    = GLAMO_REGOFS_MMC + 0x100,
++              .end    = GLAMO_REGOFS_MPROC0 - 1,
 +              .flags  = IORESOURCE_MEM
 +      }, {
 +              .start  = IRQ_GLAMO_MMC,
@@ -715,7 +716,7 @@
 +static struct resource glamo_jpeg_resources[] = {
 +      {
 +              .start  = GLAMO_REGOFS_JPEG,
-+              .end    = GLAMO_REGOFS_MPEG,
++              .end    = GLAMO_REGOFS_MPEG - 1,
 +              .flags  = IORESOURCE_MEM,
 +      }, {
 +              .start  = IRQ_GLAMO_JPEG,
@@ -733,7 +734,7 @@
 +static struct resource glamo_mpeg_resources[] = {
 +      {
 +              .start  = GLAMO_REGOFS_MPEG,
-+              .end    = GLAMO_REGOFS_LCD,
++              .end    = GLAMO_REGOFS_LCD - 1,
 +              .flags  = IORESOURCE_MEM,
 +      }, {
 +              .start  = IRQ_GLAMO_MPEG,
@@ -751,7 +752,7 @@
 +static struct resource glamo_2d_resources[] = {
 +      {
 +              .start  = GLAMO_REGOFS_2D,
-+              .end    = GLAMO_REGOFS_3D,
++              .end    = GLAMO_REGOFS_3D - 1,
 +              .flags  = IORESOURCE_MEM,
 +      }, {
 +              .start  = IRQ_GLAMO_2D,
@@ -769,15 +770,15 @@
 +static struct resource glamo_3d_resources[] = {
 +      {
 +              .start  = GLAMO_REGOFS_3D,
-+              .end    = GLAMO_REGOFS_3D + 0x600,
++              .end    = GLAMO_REGOFS_END - 1,
 +              .flags  = IORESOURCE_MEM,
 +      },
 +};
 +
 +static struct platform_device glamo_3d_dev = {
 +      .name           = "glamo-3d",
-+      .resource       = glamo_2d_resources,
-+      .num_resources  = ARRAY_SIZE(glamo_2d_resources),
++      .resource       = glamo_3d_resources,
++      .num_resources  = ARRAY_SIZE(glamo_3d_resources),
 +};
 +
 +static struct platform_device glamo_spigpio_dev = {
@@ -800,12 +801,12 @@
 +      {
 +              .name   = "glamo-fb-regs",
 +              .start  = GLAMO_REGOFS_LCD,
-+              .end    = GLAMO_REGOFS_LCD + 0x100,
++              .end    = GLAMO_REGOFS_MMC - 1,
 +              .flags  = IORESOURCE_MEM,
 +      }, {
 +              .name   = "glamo-fb-mem",
 +              .start  = GLAMO_OFFSET_FB,
-+              .end    = GLAMO_OFFSET_FB + GLAMO_FB_SIZE,
++              .end    = GLAMO_OFFSET_FB + GLAMO_FB_SIZE - 1,
 +              .flags  = IORESOURCE_MEM,
 +      },
 +};




--- End Message ---
--- Begin Message ---
Author: shoragan
Date: 2007-10-09 17:17:21 +0200 (Tue, 09 Oct 2007)
New Revision: 3127

Modified:
   branches/src/target/kernel/2.6.23.x/patches/smedia-glamo.patch
Log:
Follow change in 2.6.22:
(orig r3113):  laforge | 2007-10-08 13:28:08 +0200

glamo: raise frame rate from 40Hz to 60Hz: DCLK ration is now 2:1 instead of 
3:1 (Chia-I Wu)

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-09 15:14:59 UTC (rev 3126)
+++ branches/src/target/kernel/2.6.23.x/patches/smedia-glamo.patch      
2007-10-09 15:17:21 UTC (rev 3127)
@@ -1103,7 +1103,7 @@
 +              { 0xfffe, 300 },
 +      { GLAMO_REG_IRQ_ENABLE,         0xffff },
 +      { GLAMO_REG_CLOCK_GEN6,         0x2000 },
-+      { GLAMO_REG_CLOCK_GEN7,         0x0102 },
++      { GLAMO_REG_CLOCK_GEN7,         0x0101 },
 +      { GLAMO_REG_CLOCK_GEN8,         0x0100 },
 +      { GLAMO_REG_CLOCK_HOST,         0x000d },
 +      { 0x200,        0x0ef0 },




--- End Message ---
--- Begin Message ---
Author: shoragan
Date: 2007-10-09 17:22:07 +0200 (Tue, 09 Oct 2007)
New Revision: 3128

Added:
   
branches/src/target/kernel/2.6.23.x/patches/s3c2410_udc-2440_dual_packet-workaround.patch
Modified:
   branches/src/target/kernel/2.6.23.x/patches/series
Log:
Follow changes in 2.6.22:
(orig r3117):  laforge | 2007-10-08 15:40:41 +0200

add dual packet workaround to series

(orig r3116):  laforge | 2007-10-08 15:40:11 +0200

add patch from werner to work around s3c2440 dual packet mode usb hangs

Added: 
branches/src/target/kernel/2.6.23.x/patches/s3c2410_udc-2440_dual_packet-workaround.patch
===================================================================
--- 
branches/src/target/kernel/2.6.23.x/patches/s3c2410_udc-2440_dual_packet-workaround.patch
   2007-10-09 15:17:21 UTC (rev 3127)
+++ 
branches/src/target/kernel/2.6.23.x/patches/s3c2410_udc-2440_dual_packet-workaround.patch
   2007-10-09 15:22:07 UTC (rev 3128)
@@ -0,0 +1,51 @@
+This is a patch that seems to make the USB hangs on the S3C2440 go away. At
+least a good amount of ping torture didn't make them come back so far.
+
+The issue is that, if there are several back-to-back packets,
+sometimes no interrupt is generated for one of them. This
+seems to be caused by the mysterious dual packet mode, which
+the USB hardware enters automatically if the endpoint size is
+half that of the FIFO. (On the 2440, this is the normal
+situation for bulk data endpoints.)
+
+There is also a timing factor in this. I think what happens is
+that the USB hardware automatically sends an acknowledgement
+if there is only one packet in the FIFO (the FIFO has space
+for two). If another packet arrives before the host has
+retrieved and acknowledged the previous one, no interrupt is
+generated for that second one.
+
+However, there may be an indication. There is one undocumented
+bit (none of the 244x manuals document it), OUT_CRS1_REG[1],
+that seems to be set suspiciously often when this condition
+occurs. There is also CLR_DATA_TOGGLE, OUT_CRS1_REG[7], which
+may have a function related to this. (The Samsung manual is
+rather terse on that, as usual.)
+
+This needs to be examined further. For now, the patch seems to do the
+trick. 
+
+Note that this is not a clean solution by any means, because we
+might potentially get stuck in that interrupt for quite a while.
+
+Index: linux-2.6.22.5-moko/drivers/usb/gadget/s3c2410_udc.c
+===================================================================
+--- linux-2.6.22.5-moko.orig/drivers/usb/gadget/s3c2410_udc.c
++++ linux-2.6.22.5-moko/drivers/usb/gadget/s3c2410_udc.c
+@@ -845,6 +845,7 @@
+       u32                     ep_csr1;
+       u32                     idx;
+ 
++handle_ep_again:
+       if (likely (!list_empty(&ep->queue)))
+               req = list_entry(ep->queue.next,
+                               struct s3c2410_request, queue);
+@@ -884,6 +885,8 @@
+ 
+               if ((ep_csr1 & S3C2410_UDC_OCSR1_PKTRDY) && req) {
+                       s3c2410_udc_read_fifo(ep,req);
++                      if (s3c2410_udc_fifo_count_out())
++                              goto handle_ep_again;
+               }
+       }
+ }

Modified: branches/src/target/kernel/2.6.23.x/patches/series
===================================================================
--- branches/src/target/kernel/2.6.23.x/patches/series  2007-10-09 15:17:21 UTC 
(rev 3127)
+++ branches/src/target/kernel/2.6.23.x/patches/series  2007-10-09 15:22:07 UTC 
(rev 3128)
@@ -9,6 +9,7 @@
 g_ether-vendor_product.patch
 s3c2410_serial-nodebug.patch
 #s3c2410_udc_from_upstream.p (merged upstream)
+s3c2410_udc-2440_dual_packet-workaround.patch
 s3c2410_touchscreen.patch
 s3c2410-bbt.patch
 s3c_mci.patch




--- End Message ---
--- Begin Message ---
Author: shoragan
Date: 2007-10-09 17:27:56 +0200 (Tue, 09 Oct 2007)
New Revision: 3129

Modified:
   branches/src/target/kernel/2.6.23.x/patches/gta02-core.patch
Log:
Follow change in 2.6.22:
(orig r3119):  laforge | 2007-10-08 16:49:16 +0200

GTA02: add definitions for gsensor GPIO and IRQ
GTA02: vbus_draw is a void function, not int

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-09 15:22:07 UTC (rev 3128)
+++ branches/src/target/kernel/2.6.23.x/patches/gta02-core.patch        
2007-10-09 15:27:56 UTC (rev 3129)
@@ -2,7 +2,7 @@
 ===================================================================
 --- /dev/null
 +++ linux-2.6.22/arch/arm/mach-s3c2440/mach-gta02.c
-@@ -0,0 +1,668 @@
+@@ -0,0 +1,666 @@
 +/*
 + * linux/arch/arm/mach-s3c2440/mach-gta02.c
 + *
@@ -396,12 +396,10 @@
 +      }
 +}
 +
-+static int gta02_udc_vbus_draw(unsigned int ma)
++static void gta02_udc_vbus_draw(unsigned int ma)
 +{
 +      gta02_udc_vbus_drawer.ma = ma;
 +      schedule_work(&gta02_udc_vbus_drawer.work);
-+
-+      return 0;
 +}
 +
 +static struct s3c2410_udc_mach_info gta02_udc_cfg = {
@@ -675,7 +673,7 @@
 ===================================================================
 --- /dev/null
 +++ linux-2.6.22/include/asm-arm/arch-s3c2410/gta02.h
-@@ -0,0 +1,28 @@
+@@ -0,0 +1,32 @@
 +#ifndef _GTA02_H
 +#define _GTA02_H
 +
@@ -695,10 +693,14 @@
 +#define GTA02_GPIO_AUX_KEY    S3C2410_GPF6
 +#define GTA02_GPIO_JACK_INSERT        S3C2410_GPF4
 +#define GTA02_GPIO_BT_EN      S3C2410_GPB6
++#define GTA02_GPIO_GSENSOR1_CS        S3C2410_GPD12
++#define GTA02_GPIO_GSENSOR2_CS        S3C2410_GPD13
 +
 +#define GTA02_IRQ_MODEM               IRQ_EINT1
 +#define GTA02_IRQ_3D          IRQ_EINT12
 +#define GTA02_IRQ_PCF50633    IRQ_EINT9
++#define GTA02_IRQ_GSENSOR_1   IRQ_EINT0
++#define GTA02_IRQ_GSENSOR_2   IRQ_EINT16
 +
 +/* Changes in GTA02v2 */
 +#define GTA02v2_GPIO_3D_RESET S3C2440_GPJ4




--- End Message ---
--- Begin Message ---
Author: shoragan
Date: 2007-10-09 17:32:58 +0200 (Tue, 09 Oct 2007)
New Revision: 3130

Modified:
   branches/src/target/kernel/2.6.23.x/patches/lis302dl.patch
Log:
Follow change in 2.6.22:
(orig r3120):  laforge | 2007-10-08 16:50:08 +0200

use new #defines for gta02 gsensor IRQ and GPIO

Modified: branches/src/target/kernel/2.6.23.x/patches/lis302dl.patch
===================================================================
--- branches/src/target/kernel/2.6.23.x/patches/lis302dl.patch  2007-10-09 
15:27:56 UTC (rev 3129)
+++ branches/src/target/kernel/2.6.23.x/patches/lis302dl.patch  2007-10-09 
15:32:58 UTC (rev 3130)
@@ -6,7 +6,15 @@
 ===================================================================
 --- linux-2.6.22.5-moko.orig/arch/arm/mach-s3c2440/mach-gta02.c
 +++ linux-2.6.22.5-moko/arch/arm/mach-s3c2440/mach-gta02.c
-@@ -310,6 +310,7 @@
+@@ -44,6 +44,7 @@
+ #include <linux/mtd/partitions.h>
+ 
+ #include <linux/pcf50633.h>
++#include <linux/lis302dl.h>
+ 
+ #include <asm/mach/arch.h>
+ #include <asm/mach/map.h>
+@@ -310,6 +311,7 @@
        &s3c_device_usbgadget,
        &s3c_device_nand,
        &s3c_device_ts,
@@ -14,7 +22,7 @@
  };
  
  static struct s3c2410_nand_set gta02_nand_sets[] = {
-@@ -439,6 +440,47 @@
+@@ -437,6 +439,47 @@
        .board_info     = gta02_spi_board_info,
  };
  
@@ -23,7 +31,7 @@
 +      s3c2410_gpio_setpin(cs, pol);
 +}
 +
-+static struct lis302dl_platform_data lis302_pdata[] = {
++static const struct lis302dl_platform_data lis302_pdata[] = {
 +      {
 +              .name           = "lis302-1 (top)"
 +      }, {
@@ -34,8 +42,8 @@
 +static struct spi_board_info gta02_spi_acc_bdinfo[] = {
 +      {
 +              .modalias       = "lis302dl",
-+              .platform_data  = lis302_pdata[0],
-+              .irq            = S3C2410_EINT0,
++              .platform_data  = &lis302_pdata[0],
++              .irq            = GTA02_IRQ_GSENSOR_1,
 +              .max_speed_hz   = 400 * 1000,
 +              .bus_num        = 1,
 +              .chip_select    = S3C2410_GPD12,
@@ -43,8 +51,8 @@
 +      },
 +      {
 +              .modalias       = "lis302dl",
-+              .platform_data  = lis302_pdata[1],
-+              .irq            = S3C2410_EINT16,
++              .platform_data  = &lis302_pdata[1],
++              .irq            = GTA02_IRQ_GSENSOR_2,
 +              .max_speed_hz   = 400 * 1000,
 +              .bus_num        = 1,
 +              .chip_select    = S3C2410_GPD13,
@@ -62,7 +70,7 @@
  #if 0
  #ifdef SPI_HARD
  static struct s3c2410_spi_info spi_cfg = {
-@@ -628,6 +670,7 @@
+@@ -626,6 +669,7 @@
        s3c_device_usb.dev.platform_data = &gta02_usb_info;
        s3c_device_nand.dev.platform_data = &gta02_nand_info;
        s3c_device_sdi.dev.platform_data = &gta02_mmc_cfg;




--- End Message ---
--- Begin Message ---
Author: shoragan
Date: 2007-10-09 17:37:57 +0200 (Tue, 09 Oct 2007)
New Revision: 3131

Added:
   branches/src/target/kernel/2.6.23.x/patches/s3c2410-pwm.patch
Modified:
   branches/src/target/kernel/2.6.23.x/patches/series
Log:
Follow change in 2.6.22:
(orig r3121):  laforge | 2007-10-08 18:06:32 +0200

Add new S3C2410 PWM core (Javi Roman)

Added: 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-09 15:32:58 UTC (rev 3130)
+++ branches/src/target/kernel/2.6.23.x/patches/s3c2410-pwm.patch       
2007-10-09 15:37:57 UTC (rev 3131)
@@ -0,0 +1,308 @@
+Index: linux-2.6.22.5-moko/arch/arm/mach-s3c2410/Kconfig
+===================================================================
+--- linux-2.6.22.5-moko.orig/arch/arm/mach-s3c2410/Kconfig
++++ linux-2.6.22.5-moko/arch/arm/mach-s3c2410/Kconfig
+@@ -9,6 +9,7 @@
+       depends on ARCH_S3C2410
+       select S3C2410_CLOCK
+       select S3C2410_GPIO
++      select S3C2410_PWM
+       select S3C2410_PM if PM
+       help
+         Support for S3C2410 and S3C2410A family from the S3C24XX line
+@@ -36,6 +37,11 @@
+       help
+         Clock code for the S3C2410, and similar processors
+ 
++config S3C2410_PWM
++      bool
++      help
++        PWM timer code for the S3C2410, and similar processors
++
+ 
+ menu "S3C2410 Machines"
+ 
+Index: linux-2.6.22.5-moko/arch/arm/mach-s3c2410/Makefile
+===================================================================
+--- linux-2.6.22.5-moko.orig/arch/arm/mach-s3c2410/Makefile
++++ linux-2.6.22.5-moko/arch/arm/mach-s3c2410/Makefile
+@@ -16,6 +16,7 @@
+ obj-$(CONFIG_S3C2410_PM)      += pm.o sleep.o
+ obj-$(CONFIG_S3C2410_GPIO)    += gpio.o
+ obj-$(CONFIG_S3C2410_CLOCK)   += clock.o
++obj-$(CONFIG_S3C2410_PWM)     += pwm.o
+ 
+ # Machine support
+ 
+Index: linux-2.6.22.5-moko/arch/arm/mach-s3c2410/pwm.c
+===================================================================
+--- /dev/null
++++ linux-2.6.22.5-moko/arch/arm/mach-s3c2410/pwm.c
+@@ -0,0 +1,222 @@
++/*
++ * arch/arm/mach-s3c2410/3c2410-pwm.c
++ *
++ * Copyright (c) by Javi Roman <[EMAIL PROTECTED]>
++ *             for the OpenMoko Project.
++ *
++ *     S3C2410A SoC PWM support
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
++ *
++ */
++
++#include <linux/kernel.h>
++#include <linux/init.h>
++#include <linux/clk.h>
++#include <asm/hardware.h>
++#include <asm/arch/regs-timer.h>
++#include <asm/arch/pwm.h>
++
++struct s3c2410_pwm_t *s3c2410_pwm_alloc(void)
++{
++      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 */
++        tcon = __raw_readl(S3C2410_TCON);
++        tcon &= 0xffffff00;
++        __raw_writel(tcon, S3C2410_TCON);
++
++      clk_disable(s3c2410_pwm->pclk);
++      clk_put(s3c2410_pwm->pclk);
++
++      kfree(s3c2410_pwm);
++      return 0;
++}
++
++EXPORT_SYMBOL_GPL(s3c2410_pwm_disable);
++
++int s3c2410_pwm_enable(struct s3c2410_pwm_t *s3c2410_pwm)
++{
++      unsigned long tcfg0, tcfg1, tcnt, tcmp;
++
++      /* control registers bits */
++      tcfg1 = __raw_readl(S3C2410_TCFG1);
++      tcfg0 = __raw_readl(S3C2410_TCFG0);
++
++      /* divider & scaler slection */
++      switch(s3c2410_pwm->timerid) {
++      case PWM0:
++              tcfg1 &= ~S3C2410_TCFG1_MUX0_MASK;
++              tcfg0 &= ~S3C2410_TCFG_PRESCALER0_MASK;
++              break;
++      case PWM1:
++              tcfg1 &= ~S3C2410_TCFG1_MUX1_MASK;
++              tcfg0 &= ~S3C2410_TCFG_PRESCALER0_MASK;
++              break;
++      case PWM2:
++              tcfg1 &= ~S3C2410_TCFG1_MUX2_MASK;
++              tcfg0 &= ~S3C2410_TCFG_PRESCALER1_MASK;
++              break;
++      case PWM3:
++              tcfg1 &= ~S3C2410_TCFG1_MUX3_MASK;
++              tcfg0 &= ~S3C2410_TCFG_PRESCALER1_MASK;
++              break;
++      case PWM4:
++              tcfg1 &= ~S3C2410_TCFG1_MUX4_MASK;
++              tcfg0 &= ~S3C2410_TCFG_PRESCALER1_MASK;
++              break;
++      default:
++              return -1;
++      }
++
++      /* divider & scaler values */
++      tcfg1 |= s3c2410_pwm->divider;
++      tcfg0 |= s3c2410_pwm->prescaler;
++
++      __raw_writel(tcfg1, S3C2410_TCFG1);
++      __raw_writel(tcfg0, S3C2410_TCFG0);
++
++      /* timer count and compare buffer initial values */
++      tcnt = s3c2410_pwm->counter;
++      tcmp = s3c2410_pwm->comparer;
++
++      __raw_writel(tcnt, S3C2410_TCNTB(s3c2410_pwm->timerid));
++      __raw_writel(tcmp, S3C2410_TCMPB(s3c2410_pwm->timerid));
++
++      /* ensure timer is stopped */
++      s3c2410_pwm_stop(s3c2410_pwm);
++
++      return 0;
++}
++
++EXPORT_SYMBOL_GPL(s3c2410_pwm_enable);
++
++int s3c2410_pwm_start(struct s3c2410_pwm_t *s3c2410_pwm)
++{
++      unsigned long tcon;
++
++      tcon = __raw_readl(S3C2410_TCON);
++
++      switch (s3c2410_pwm->timerid) {
++      case PWM0:
++              tcon |= S3C2410_TCON_T0START;
++              tcon &= ~S3C2410_TCON_T0MANUALUPD;
++              break;
++      case PWM1:
++              tcon |= S3C2410_TCON_T1START;
++              tcon &= ~S3C2410_TCON_T1MANUALUPD;
++              break;
++      case PWM2:
++              tcon |= S3C2410_TCON_T2START;
++              tcon &= ~S3C2410_TCON_T2MANUALUPD;
++              break;
++      case PWM3:
++              tcon |= S3C2410_TCON_T3START;
++              tcon &= ~S3C2410_TCON_T3MANUALUPD;
++              break;
++      case PWM4:
++              tcon |= S3C2410_TCON_T4START;
++              tcon &= ~S3C2410_TCON_T4MANUALUPD;
++      }
++
++      __raw_writel(tcon, S3C2410_TCON);
++
++      return 0;
++}
++
++EXPORT_SYMBOL_GPL(s3c2410_pwm_start);
++
++int s3c2410_pwm_stop(struct s3c2410_pwm_t *s3c2410_pwm)
++{
++      unsigned long tcon;
++
++      tcon = __raw_readl(S3C2410_TCON);
++
++      switch (s3c2410_pwm->timerid) {
++      case PWM0:
++              tcon &= ~0x00000000;
++              tcon |= S3C2410_TCON_T0RELOAD;
++              tcon |= S3C2410_TCON_T0MANUALUPD;
++              break;
++      case PWM1:
++              tcon &= ~0x00000080;
++              tcon |= S3C2410_TCON_T1RELOAD;
++              tcon |= S3C2410_TCON_T1MANUALUPD;
++              break;
++      case PWM2:
++              tcon &= ~0x00000800;
++              tcon |= S3C2410_TCON_T2RELOAD;
++              tcon |= S3C2410_TCON_T2MANUALUPD;
++              break;
++      case PWM3:
++              tcon &= ~0x00008000;
++              tcon |= S3C2410_TCON_T3RELOAD;
++              tcon |= S3C2410_TCON_T3MANUALUPD;
++              break;
++      case PWM4:
++              tcon &= ~0x00080000;
++              tcon |= S3C2410_TCON_T4RELOAD;
++              tcon |= S3C2410_TCON_T3MANUALUPD;
++      }
++
++      __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)
++{
++      __raw_writel(reg_value, S3C2410_TCMPB(s3c2410_pwm->timerid));
++
++      return 0;
++}
++
++EXPORT_SYMBOL_GPL(s3c2410_pwm_duty_cycle);
++
++int s3c2410_pwm_dumpregs(void)
++{
++      printk(KERN_INFO "TCON: %08lx, TCFG0: %08lx, TCFG1: %08lx\n",
++                      (unsigned long) __raw_readl(S3C2410_TCON),
++                      (unsigned long) __raw_readl(S3C2410_TCFG0),
++                      (unsigned long) __raw_readl(S3C2410_TCFG1));
++
++      return 0;
++}
++
++EXPORT_SYMBOL_GPL(s3c2410_pwm_dumpregs);
++
+Index: linux-2.6.22.5-moko/include/asm-arm/arch-s3c2410/pwm.h
+===================================================================
+--- /dev/null
++++ linux-2.6.22.5-moko/include/asm-arm/arch-s3c2410/pwm.h
+@@ -0,0 +1,40 @@
++#ifndef __S3C2410_PWM_H
++#define __S3C2410_PWM_H
++
++#include <linux/err.h>
++#include <linux/platform_device.h>
++#include <linux/clk.h>
++
++#include <asm-arm/io.h>
++#include <asm/arch/hardware.h>
++#include <asm/mach-types.h>
++#include <asm/arch/regs-timer.h>
++#include <asm/arch/gta01.h>
++
++enum pwm_timer {
++      PWM0,
++      PWM1,
++      PWM2,
++      PWM3,
++      PWM4
++};
++
++struct s3c2410_pwm_t {
++      enum pwm_timer timerid;
++      struct clk *pclk;
++      unsigned long pclk_rate;
++      unsigned long prescaler;
++      unsigned long divider;
++      unsigned long counter;
++      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_dumpregs(void);
++
++#endif /* __S3C2410_PWM_H */

Modified: branches/src/target/kernel/2.6.23.x/patches/series
===================================================================
--- branches/src/target/kernel/2.6.23.x/patches/series  2007-10-09 15:32:58 UTC 
(rev 3130)
+++ branches/src/target/kernel/2.6.23.x/patches/series  2007-10-09 15:37:57 UTC 
(rev 3131)
@@ -18,6 +18,7 @@
 s3cmci-stop-fix.patch
 s3cmci-unfinished-write-fix.patch
 s3c_mci_platform.patch
+s3c2410-pwm.patch
 qt2410-base.patch
 qt2410-cs8900.patch
 qt2410-s3c_mci-pdata.patch




--- End Message ---
--- Begin Message ---
Author: shoragan
Date: 2007-10-09 17:49:27 +0200 (Tue, 09 Oct 2007)
New Revision: 3132

Modified:
   branches/src/target/kernel/2.6.23.x/patches/s3c2410-pwm.patch
Log:
Update s3c2410-pwm.patch to apply on 2.6.23-rc9

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-09 15:37:57 UTC (rev 3131)
+++ branches/src/target/kernel/2.6.23.x/patches/s3c2410-pwm.patch       
2007-10-09 15:49:27 UTC (rev 3132)
@@ -1,16 +1,16 @@
-Index: linux-2.6.22.5-moko/arch/arm/mach-s3c2410/Kconfig
+Index: linux-2.6.23-rc9/arch/arm/mach-s3c2410/Kconfig
 ===================================================================
---- linux-2.6.22.5-moko.orig/arch/arm/mach-s3c2410/Kconfig
-+++ linux-2.6.22.5-moko/arch/arm/mach-s3c2410/Kconfig
+--- linux-2.6.23-rc9.orig/arch/arm/mach-s3c2410/Kconfig
++++ linux-2.6.23-rc9/arch/arm/mach-s3c2410/Kconfig
 @@ -9,6 +9,7 @@
        depends on ARCH_S3C2410
        select S3C2410_CLOCK
        select S3C2410_GPIO
 +      select S3C2410_PWM
+       select CPU_LLSERIAL_S3C2410
        select S3C2410_PM if PM
        help
-         Support for S3C2410 and S3C2410A family from the S3C24XX line
-@@ -36,6 +37,11 @@
+@@ -37,6 +38,11 @@
        help
          Clock code for the S3C2410, and similar processors
  
@@ -22,10 +22,10 @@
  
  menu "S3C2410 Machines"
  
-Index: linux-2.6.22.5-moko/arch/arm/mach-s3c2410/Makefile
+Index: linux-2.6.23-rc9/arch/arm/mach-s3c2410/Makefile
 ===================================================================
---- linux-2.6.22.5-moko.orig/arch/arm/mach-s3c2410/Makefile
-+++ linux-2.6.22.5-moko/arch/arm/mach-s3c2410/Makefile
+--- linux-2.6.23-rc9.orig/arch/arm/mach-s3c2410/Makefile
++++ linux-2.6.23-rc9/arch/arm/mach-s3c2410/Makefile
 @@ -16,6 +16,7 @@
  obj-$(CONFIG_S3C2410_PM)      += pm.o sleep.o
  obj-$(CONFIG_S3C2410_GPIO)    += gpio.o
@@ -34,10 +34,10 @@
  
  # Machine support
  
-Index: linux-2.6.22.5-moko/arch/arm/mach-s3c2410/pwm.c
+Index: linux-2.6.23-rc9/arch/arm/mach-s3c2410/pwm.c
 ===================================================================
 --- /dev/null
-+++ linux-2.6.22.5-moko/arch/arm/mach-s3c2410/pwm.c
++++ linux-2.6.23-rc9/arch/arm/mach-s3c2410/pwm.c
 @@ -0,0 +1,222 @@
 +/*
 + * arch/arm/mach-s3c2410/3c2410-pwm.c
@@ -261,10 +261,10 @@
 +
 +EXPORT_SYMBOL_GPL(s3c2410_pwm_dumpregs);
 +
-Index: linux-2.6.22.5-moko/include/asm-arm/arch-s3c2410/pwm.h
+Index: linux-2.6.23-rc9/include/asm-arm/arch-s3c2410/pwm.h
 ===================================================================
 --- /dev/null
-+++ linux-2.6.22.5-moko/include/asm-arm/arch-s3c2410/pwm.h
++++ linux-2.6.23-rc9/include/asm-arm/arch-s3c2410/pwm.h
 @@ -0,0 +1,40 @@
 +#ifndef __S3C2410_PWM_H
 +#define __S3C2410_PWM_H




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

Reply via email to