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. r3586 - branches/src/target/kernel/2.6.24.x/patches
      ([EMAIL PROTECTED])
   2. r3587 - branches/src/target/kernel/2.6.24.x/patches
      ([EMAIL PROTECTED])
   3. r3588 - branches/src/target/kernel/2.6.24.x/patches
      ([EMAIL PROTECTED])
   4. r3589 - branches/src/target/kernel/2.6.24.x/patches
      ([EMAIL PROTECTED])
   5. r3590 - branches/src/target/kernel/2.6.24.x/patches
      ([EMAIL PROTECTED])
   6. r3591 - branches/src/target/kernel/2.6.24.x/patches
      ([EMAIL PROTECTED])
--- Begin Message ---
Author: laforge
Date: 2007-12-06 07:13:39 +0100 (Thu, 06 Dec 2007)
New Revision: 3586

Modified:
   branches/src/target/kernel/2.6.24.x/patches/gta02-core.patch
Log:
GTA02: Use S3C2442 as default CPU, offer S3C2440 support for backwards compat 
to early hardware


Modified: branches/src/target/kernel/2.6.24.x/patches/gta02-core.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/gta02-core.patch        
2007-12-06 06:02:36 UTC (rev 3585)
+++ branches/src/target/kernel/2.6.24.x/patches/gta02-core.patch        
2007-12-06 06:13:39 UTC (rev 3586)
@@ -745,17 +745,25 @@
 ===================================================================
 --- linux-2.6.orig/arch/arm/mach-s3c2440/Kconfig
 +++ linux-2.6/arch/arm/mach-s3c2440/Kconfig
-@@ -74,5 +74,12 @@
+@@ -74,5 +74,20 @@
        help
           Say Y here if you are using the FIC Neo1973 GSM Phone
  
 +config MACH_NEO1973_GTA02
 +      bool "FIC Neo1973 GSM Phone (GTA02 Hardware)"
-+      select CPU_S3C2440
++      select CPU_S3C2442
 +      select SENSORS_PCF50633
 +      help
 +         Say Y here if you are using the FIC Neo1973 GSM Phone
 +
++config NEO1973_GTA02_2440
++      bool "Old FIC Neo1973 GTA02 hardware using S3C2440 CPU"
++      depends on MACH_NEO1973_GTA02
++      select CPU_S3C2440
++      help
++         Say Y here if you are using an early hardware revision
++         of the FIC/OpenMoko Neo1973 GTA02 GSM Phone.
++
  endmenu
  
 Index: linux-2.6/arch/arm/mach-s3c2440/Makefile




--- End Message ---
--- Begin Message ---
Author: laforge
Date: 2007-12-06 07:14:02 +0100 (Thu, 06 Dec 2007)
New Revision: 3587

Modified:
   branches/src/target/kernel/2.6.24.x/patches/gta02-sound.patch
Log:
make gta02-sound.patch compile with 2.6.24.x


Modified: branches/src/target/kernel/2.6.24.x/patches/gta02-sound.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/gta02-sound.patch       
2007-12-06 06:13:39 UTC (rev 3586)
+++ branches/src/target/kernel/2.6.24.x/patches/gta02-sound.patch       
2007-12-06 06:14:02 UTC (rev 3587)
@@ -1,7 +1,7 @@
-Index: linux-2.6.22/sound/soc/s3c24xx/neo1973_gta02_wm8753.c
+Index: linux-2.6/sound/soc/s3c24xx/neo1973_gta02_wm8753.c
 ===================================================================
---- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/sound/soc/s3c24xx/neo1973_gta02_wm8753.c      2007-11-06 
16:35:52.000000000 +0000
+--- /dev/null
++++ linux-2.6/sound/soc/s3c24xx/neo1973_gta02_wm8753.c
 @@ -0,0 +1,662 @@
 +/*
 + * neo1973_gta02_wm8753.c  --  SoC audio for Neo1973
@@ -37,7 +37,7 @@
 +
 +#include <asm/mach-types.h>
 +#include <asm/hardware/scoop.h>
-+#include <asm/arch/regs-iis.h>
++#include <asm/plat-s3c24xx/regs-iis.h>
 +#include <asm/arch/regs-clock.h>
 +#include <asm/arch/regs-gpio.h>
 +#include <asm/hardware.h>
@@ -665,10 +665,10 @@
 +MODULE_DESCRIPTION("ALSA SoC WM8753 Neo1973 GTA02");
 +MODULE_LICENSE("GPL");
 +
-Index: linux-2.6.22/sound/soc/s3c24xx/Kconfig
+Index: linux-2.6/sound/soc/s3c24xx/Kconfig
 ===================================================================
---- linux-2.6.22.orig/sound/soc/s3c24xx/Kconfig        2007-11-06 
15:31:50.000000000 +0000
-+++ linux-2.6.22/sound/soc/s3c24xx/Kconfig     2007-11-06 15:31:55.000000000 
+0000
+--- linux-2.6.orig/sound/soc/s3c24xx/Kconfig
++++ linux-2.6/sound/soc/s3c24xx/Kconfig
 @@ -25,6 +25,15 @@
          Say Y if you want to add support for SoC audio on smdk2440
          with the WM8753.
@@ -685,10 +685,10 @@
  config SND_S3C24XX_SOC_SMDK2443_WM9710
        tristate "SoC AC97 Audio support for SMDK2443 - WM9710"
        depends on SND_S3C24XX_SOC && MACH_SMDK2443
-Index: linux-2.6.22/sound/soc/s3c24xx/Makefile
+Index: linux-2.6/sound/soc/s3c24xx/Makefile
 ===================================================================
---- linux-2.6.22.orig/sound/soc/s3c24xx/Makefile       2007-11-06 
15:31:49.000000000 +0000
-+++ linux-2.6.22/sound/soc/s3c24xx/Makefile    2007-11-06 15:31:55.000000000 
+0000
+--- linux-2.6.orig/sound/soc/s3c24xx/Makefile
++++ linux-2.6/sound/soc/s3c24xx/Makefile
 @@ -10,6 +10,9 @@
  # S3C24XX Machine Support
  snd-soc-neo1973-wm8753-objs := neo1973_wm8753.o
@@ -699,10 +699,10 @@
  obj-$(CONFIG_SND_S3C24XX_SOC_SMDK2443_WM9710) += snd-soc-smdk2443-wm9710.o
 +obj-$(CONFIG_SND_S3C24XX_SOC_NEO1973_GTA02_WM8753) += 
snd-soc-neo1973-gta02-wm8753.o
 +
-Index: linux-2.6.22/include/sound/soc-dapm.h
+Index: linux-2.6/include/sound/soc-dapm.h
 ===================================================================
---- linux-2.6.22.orig/include/sound/soc-dapm.h 2007-07-09 00:32:17.000000000 
+0100
-+++ linux-2.6.22/include/sound/soc-dapm.h      2007-11-06 15:31:55.000000000 
+0000
+--- linux-2.6.orig/include/sound/soc-dapm.h
++++ linux-2.6/include/sound/soc-dapm.h
 @@ -206,6 +206,8 @@
  /* dapm audio endpoint control */
  int snd_soc_dapm_set_endpoint(struct snd_soc_codec *codec,
@@ -712,10 +712,10 @@
  int snd_soc_dapm_sync_endpoints(struct snd_soc_codec *codec);
  
  /* dapm widget types */
-Index: linux-2.6.22/sound/soc/soc-dapm.c
+Index: linux-2.6/sound/soc/soc-dapm.c
 ===================================================================
---- linux-2.6.22.orig/sound/soc/soc-dapm.c     2007-07-09 00:32:17.000000000 
+0100
-+++ linux-2.6.22/sound/soc/soc-dapm.c  2007-11-06 15:31:55.000000000 +0000
+--- linux-2.6.orig/sound/soc/soc-dapm.c
++++ linux-2.6/sound/soc/soc-dapm.c
 @@ -1305,6 +1305,30 @@
  EXPORT_SYMBOL_GPL(snd_soc_dapm_set_endpoint);
  




--- End Message ---
--- Begin Message ---
Author: laforge
Date: 2007-12-06 07:32:14 +0100 (Thu, 06 Dec 2007)
New Revision: 3588

Added:
   branches/src/target/kernel/2.6.24.x/patches/asoc-core-suspend_resume.patch
   
branches/src/target/kernel/2.6.24.x/patches/asoc-s3c24xx-iis-suspend_resume.patch
Modified:
   branches/src/target/kernel/2.6.24.x/patches/series
Log:
add two more ASOC core fixes


Added: 
branches/src/target/kernel/2.6.24.x/patches/asoc-core-suspend_resume.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/asoc-core-suspend_resume.patch  
2007-12-06 06:14:02 UTC (rev 3587)
+++ branches/src/target/kernel/2.6.24.x/patches/asoc-core-suspend_resume.patch  
2007-12-06 06:32:14 UTC (rev 3588)
@@ -0,0 +1,47 @@
+From 6c868238a5e083dca4d74439a7fd467b5c7726b0 Mon Sep 17 00:00:00 2001
+From: Liam Girdwood <[EMAIL PROTECTED]>
+Date: Fri, 1 Jun 2007 12:56:55 +0100
+Subject: [PATCH] This fixes a bug whereby PCM's were not being suspended when 
the rest of the audio subsystem was suspended.
+
+---
+ include/sound/soc.h  |    3 +++
+ sound/soc/soc-core.c |    8 ++++++++
+ 2 files changed, 11 insertions(+), 0 deletions(-)
+
+Index: linux-2.6.22/include/sound/soc.h
+===================================================================
+--- linux-2.6.22.orig/include/sound/soc.h      2007-07-09 00:32:17.000000000 
+0100
++++ linux-2.6.22/include/sound/soc.h   2007-11-09 16:13:08.000000000 +0000
+@@ -411,6 +411,9 @@
+ 
+       /* codec/machine specific init - e.g. add machine controls */
+       int (*init)(struct snd_soc_codec *codec);
++      
++      /* DAI pcm */
++      struct snd_pcm *pcm;
+ };
+ 
+ /* SoC machine */
+Index: linux-2.6.22/sound/soc/soc-core.c
+===================================================================
+--- linux-2.6.22.orig/sound/soc/soc-core.c     2007-07-09 00:32:17.000000000 
+0100
++++ linux-2.6.22/sound/soc/soc-core.c  2007-11-09 16:18:45.000000000 +0000
+@@ -639,6 +639,10 @@
+                       dai->dai_ops.digital_mute(dai, 1);
+       }
+ 
++      /* suspend all pcm's */
++      for(i = 0; i < machine->num_links; i++)
++              snd_pcm_suspend_all(machine->dai_link[i].pcm);
++
+       if (machine->suspend_pre)
+               machine->suspend_pre(pdev, state);
+ 
+@@ -873,6 +877,7 @@
+               return ret;
+       }
+ 
++      dai_link->pcm = pcm;
+       pcm->private_data = rtd;
+       soc_pcm_ops.mmap = socdev->platform->pcm_ops->mmap;
+       soc_pcm_ops.pointer = socdev->platform->pcm_ops->pointer;

Added: 
branches/src/target/kernel/2.6.24.x/patches/asoc-s3c24xx-iis-suspend_resume.patch
===================================================================
--- 
branches/src/target/kernel/2.6.24.x/patches/asoc-s3c24xx-iis-suspend_resume.patch
   2007-12-06 06:14:02 UTC (rev 3587)
+++ 
branches/src/target/kernel/2.6.24.x/patches/asoc-s3c24xx-iis-suspend_resume.patch
   2007-12-06 06:32:14 UTC (rev 3588)
@@ -0,0 +1,63 @@
+Index: linux-2.6/sound/soc/s3c24xx/s3c24xx-i2s.c
+===================================================================
+--- linux-2.6.orig/sound/soc/s3c24xx/s3c24xx-i2s.c
++++ linux-2.6/sound/soc/s3c24xx/s3c24xx-i2s.c
+@@ -75,6 +75,10 @@
+ struct s3c24xx_i2s_info {
+       void __iomem    *regs;
+       struct clk      *iis_clk;
++      u32             iiscon;
++      u32             iismod;
++      u32             iisfcon;
++      u32             iispsr;
+ };
+ static struct s3c24xx_i2s_info s3c24xx_i2s;
+ 
+@@ -405,6 +409,38 @@
+       return 0;
+ }
+ 
++#ifdef CONFIG_PM
++static int s3c24xx_i2s_suspend(struct platform_device *pdev,
++                             struct snd_soc_cpu_dai *cpu_dai)
++{
++      s3c24xx_i2s.iiscon = readl(s3c24xx_i2s.regs + S3C2410_IISCON);
++      s3c24xx_i2s.iismod = readl(s3c24xx_i2s.regs + S3C2410_IISMOD);
++      s3c24xx_i2s.iisfcon = readl(s3c24xx_i2s.regs + S3C2410_IISFCON);
++      s3c24xx_i2s.iispsr = readl(s3c24xx_i2s.regs + S3C2410_IISPSR);
++
++      clk_disable(s3c24xx_i2s.iis_clk);
++
++      return 0;
++}
++
++static int s3c24xx_i2s_resume(struct platform_device *pdev,
++                            struct snd_soc_cpu_dai *cpu_dai)
++{
++      clk_enable(s3c24xx_i2s.iis_clk);
++
++      writel(s3c24xx_i2s.iiscon, s3c24xx_i2s.regs + S3C2410_IISCON);
++      writel(s3c24xx_i2s.iismod, s3c24xx_i2s.regs + S3C2410_IISMOD);
++      writel(s3c24xx_i2s.iisfcon, s3c24xx_i2s.regs + S3C2410_IISFCON);
++      writel(s3c24xx_i2s.iispsr, s3c24xx_i2s.regs + S3C2410_IISPSR);
++
++      return 0;
++}
++#else
++#define s3c24xx_i2s_suspend NULL
++#define s3c24xx_i2s_resume NULL
++#endif
++
++
+ #define S3C24XX_I2S_RATES \
+       (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 | SNDRV_PCM_RATE_16000 | \
+       SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \
+@@ -415,6 +451,8 @@
+       .id = 0,
+       .type = SND_SOC_DAI_I2S,
+       .probe = s3c24xx_i2s_probe,
++      .suspend = s3c24xx_i2s_suspend,
++      .resume = s3c24xx_i2s_resume,
+       .playback = {
+               .channels_min = 2,
+               .channels_max = 2,

Modified: branches/src/target/kernel/2.6.24.x/patches/series
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/series  2007-12-06 06:14:02 UTC 
(rev 3587)
+++ branches/src/target/kernel/2.6.24.x/patches/series  2007-12-06 06:32:14 UTC 
(rev 3588)
@@ -1,4 +1,6 @@
 asoc-neo1973_wm8753-power.patch
+asoc-s3c24xx-iis-suspend_resume.patch
+asoc-core-suspend_resume.patch
 missing_defs.patch
 openmoko-logo.patch
 yaffs2-20070905.patch




--- End Message ---
--- Begin Message ---
Author: laforge
Date: 2007-12-06 07:53:10 +0100 (Thu, 06 Dec 2007)
New Revision: 3589

Modified:
   branches/src/target/kernel/2.6.24.x/patches/gta02-core.patch
   branches/src/target/kernel/2.6.24.x/patches/smedia-glamo.patch
Log:
GLAMO: LCMs can run under VGA and QVGA mode.  The timing characteristics should 
be
provided to help driver initialization.  (Chia-I Wu <[EMAIL PROTECTED]>)


Modified: branches/src/target/kernel/2.6.24.x/patches/gta02-core.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/gta02-core.patch        
2007-12-06 06:32:14 UTC (rev 3588)
+++ branches/src/target/kernel/2.6.24.x/patches/gta02-core.patch        
2007-12-06 06:53:10 UTC (rev 3589)
@@ -2,7 +2,7 @@
 ===================================================================
 --- /dev/null
 +++ linux-2.6/arch/arm/mach-s3c2440/mach-gta02.c
-@@ -0,0 +1,636 @@
+@@ -0,0 +1,643 @@
 +/*
 + * linux/arch/arm/mach-s3c2440/mach-gta02.c
 + *
@@ -513,8 +513,15 @@
 +/* Smedia Glamo 3362 */
 +
 +static struct glamofb_platform_data gta02_glamo_pdata = {
-+      .width          = 480,
-+      .height         = 640,
++      .width          = 43,
++      .height         = 58,
++      .pixclock       = 50 * 1000, /* 50 ns */
++      .left_margin    = 8,
++      .right_margin   = 104,
++      .upper_margin   = 2,
++      .lower_margin   = 16,
++      .hsync_len      = 8,
++      .vsync_len      = 2,
 +      .xres           = {
 +              .min    = 240,
 +              .max    = 480,

Modified: branches/src/target/kernel/2.6.24.x/patches/smedia-glamo.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/smedia-glamo.patch      
2007-12-06 06:32:14 UTC (rev 3588)
+++ branches/src/target/kernel/2.6.24.x/patches/smedia-glamo.patch      
2007-12-06 06:53:10 UTC (rev 3589)
@@ -2243,7 +2243,7 @@
 ===================================================================
 --- /dev/null
 +++ linux-2.6/include/linux/glamofb.h
-@@ -0,0 +1,29 @@
+@@ -0,0 +1,33 @@
 +#ifndef _LINUX_GLAMOFB_H
 +#define _LINUX_GLAMOFB_H
 +
@@ -2259,6 +2259,10 @@
 +
 +struct glamofb_platform_data {
 +      int width, height;
++      int pixclock;
++      int left_margin, right_margin;
++      int upper_margin, lower_margin;
++      int hsync_len, vsync_len;
 +
 +      struct glamofb_val xres;
 +      struct glamofb_val yres;




--- End Message ---
--- Begin Message ---
Author: laforge
Date: 2007-12-06 08:00:19 +0100 (Thu, 06 Dec 2007)
New Revision: 3590

Modified:
   branches/src/target/kernel/2.6.24.x/patches/smedia-glamo.patch
Log:
GLAMO: Move modeline setting to a function of itself.  Call this function on
initialization and set_par.  (Chia-I Wu <[EMAIL PROTECTED]>)


Modified: branches/src/target/kernel/2.6.24.x/patches/smedia-glamo.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/smedia-glamo.patch      
2007-12-06 06:53:10 UTC (rev 3589)
+++ branches/src/target/kernel/2.6.24.x/patches/smedia-glamo.patch      
2007-12-06 07:00:19 UTC (rev 3590)
@@ -1614,7 +1614,7 @@
 ===================================================================
 --- /dev/null
 +++ linux-2.6/drivers/video/glamo/glamo-fb.c
-@@ -0,0 +1,624 @@
+@@ -0,0 +1,653 @@
 +/* Smedia Glamo 336x/337x driver
 + *
 + * (C) 2007 by OpenMoko, Inc.
@@ -1714,25 +1714,12 @@
 +      { GLAMO_REG_LCD_MODE3, 0x0b40 },
 +        /* src data rgb565, res, 18bit rgb666
 +         * 000 01 011 0100 0000 */
-+      { GLAMO_REG_LCD_WIDTH, 480 },
-+      { GLAMO_REG_LCD_HEIGHT, 640 },
 +      { GLAMO_REG_LCD_POLARITY, 0x440c },
 +        /* DE high active, no cpu/lcd if, cs0 force low, a0 low active,
 +         * np cpu if, 9bit serial data, sclk rising edge latch data
 +         * 01 00 0 100 0 000 01 0 0 */
 +      { GLAMO_REG_LCD_A_BASE1, 0x0000 }, /* display A base address 15:0 */
 +      { GLAMO_REG_LCD_A_BASE2, 0x0000 }, /* display A base address 22:16 */
-+      { GLAMO_REG_LCD_PITCH, 480*2 },
-+      { GLAMO_REG_LCD_HORIZ_TOTAL, 480 + 8 + 8 + 104 }, /* 600 */
-+      { GLAMO_REG_LCD_HORIZ_RETR_START, 0 },
-+      { GLAMO_REG_LCD_HORIZ_RETR_END, 8 },
-+      { GLAMO_REG_LCD_HORIZ_DISP_START, 8 + 104 },
-+      { GLAMO_REG_LCD_HORIZ_DISP_END, 8 + 104 + 480 },
-+      { GLAMO_REG_LCD_VERT_TOTAL, 640 + 2 + 2 + 16 }, /* 660 */
-+      { GLAMO_REG_LCD_VERT_RETR_START, 0 },
-+      { GLAMO_REG_LCD_VERT_RETR_END, 2 },
-+      { GLAMO_REG_LCD_VERT_DISP_START, 2 + 2 },
-+      { GLAMO_REG_LCD_VERT_DISP_END, 2 + 2 + 640 },
 +};
 +
 +static int glamofb_run_script(struct glamofb_handle *glamo,
@@ -1822,24 +1809,65 @@
 +      return 0;
 +}
 +
++static void glamofb_activate_var(struct glamofb_handle *glamo,
++                              struct fb_var_screeninfo *var)
++{
++      int sync, bp, disp, fp, total;
++
++      glamofb_cmd_mode(glamo, 1);
++
++      /* XXX highest bits of the following two regs have other meanings */
++      reg_write(glamo, GLAMO_REG_LCD_WIDTH, var->xres);
++      reg_write(glamo, GLAMO_REG_LCD_HEIGHT, var->yres);
++      reg_write(glamo, GLAMO_REG_LCD_PITCH,
++                      (var->xres * var->bits_per_pixel) / 8);
++
++      sync = 0;
++      bp = sync + var->hsync_len;
++      disp = bp + var->left_margin;
++      fp = disp + var->xres;
++      total = fp + var->right_margin;
++
++      reg_write(glamo, GLAMO_REG_LCD_HORIZ_TOTAL, total);
++      reg_write(glamo, GLAMO_REG_LCD_HORIZ_RETR_START, sync);
++      reg_write(glamo, GLAMO_REG_LCD_HORIZ_RETR_END, bp);
++      reg_write(glamo, GLAMO_REG_LCD_HORIZ_DISP_START, disp);
++      reg_write(glamo, GLAMO_REG_LCD_HORIZ_DISP_END, fp);
++
++      sync = 0;
++      bp = sync + var->vsync_len;
++      disp = bp + var->upper_margin;
++      fp = disp + var->yres;
++      total = fp + var->lower_margin;
++
++      reg_write(glamo, GLAMO_REG_LCD_VERT_TOTAL, total);
++      reg_write(glamo, GLAMO_REG_LCD_VERT_RETR_START, sync);
++      reg_write(glamo, GLAMO_REG_LCD_VERT_RETR_END, bp);
++      reg_write(glamo, GLAMO_REG_LCD_VERT_DISP_START, disp);
++      reg_write(glamo, GLAMO_REG_LCD_VERT_DISP_END, fp);
++
++      glamofb_cmd_mode(glamo, 0);
++}
++
 +static int glamofb_set_par(struct fb_info *info)
 +{
 +      struct glamofb_handle *glamo = info->par;
 +      struct fb_var_screeninfo *var = &info->var;
 +
-+      /* FIXME */
-+
 +      switch (var->bits_per_pixel) {
 +      case 16:
-+              glamo->fb->fix.visual = FB_VISUAL_TRUECOLOR;
++              info->fix.visual = FB_VISUAL_TRUECOLOR;
 +              break;
 +      default:
 +              printk("Smedia driver doens't support != 16bpp\n");
 +              return -EINVAL;
 +      }
 +
-+      glamo->fb->fix.line_length = (var->width * var->bits_per_pixel) / 8;
++      info->fix.line_length = (var->xres * var->bits_per_pixel) / 8;
++      info->fix.smem_len = info->fix.line_length * var->yres_virtual;
 +
++      glamofb_activate_var(glamo, var);
++
 +      return 0;
 +}
 +
@@ -1982,6 +2010,8 @@
 +              while (!reg_read(gfb, GLAMO_REG_LCD_STATUS2) & (1 << 12))
 +                      yield();
 +              dev_dbg(gfb->dev, "idle!\n");
++
++              msleep(90);
 +      } else {
 +              /* RGB interface needs vsync/hsync */
 +              if (reg_read(gfb, GLAMO_REG_LCD_MODE3) & GLAMO_LCD_MODE3_RGB)
@@ -1998,7 +2028,6 @@
 +
 +int glamofb_cmd_write(struct glamofb_handle *gfb, u_int16_t val)
 +{
-+
 +      dev_dbg(gfb->dev, "%s: waiting for cmdq empty\n",
 +              __FUNCTION__);
 +      while (!glamofb_cmdq_empty(gfb))
@@ -2023,6 +2052,18 @@
 +      .fb_imageblit   = cfb_imageblit,
 +};
 +
++static int glamofb_init_regs(struct glamofb_handle *glamo)
++{
++      struct fb_info *info = glamo->fb;
++      struct fb_var_screeninfo *var = &info->var;
++
++      glamofb_check_var(&info->var, info);
++      glamofb_run_script(glamo, glamo_regs, ARRAY_SIZE(glamo_regs));
++      glamofb_set_par(info);
++
++      return 0;
++}
++
 +static int __init glamofb_probe(struct platform_device *pdev)
 +{
 +      int rc = -EIO;
@@ -2119,33 +2160,21 @@
 +      fbinfo->var.yres_virtual = mach_info->yres.defval;
 +      fbinfo->var.bits_per_pixel = mach_info->bpp.defval;
 +
-+#if 0
-+      fbinfo->var.upper_margin =
-+      fbinfo->var.lower_margin =
-+      fbinfo->var.vsync_len = 2;
++      fbinfo->var.pixclock = mach_info->pixclock;
++      fbinfo->var.left_margin = mach_info->left_margin;
++      fbinfo->var.right_margin = mach_info->right_margin;
++      fbinfo->var.upper_margin = mach_info->upper_margin;
++      fbinfo->var.lower_margin = mach_info->lower_margin;
++      fbinfo->var.hsync_len = mach_info->hsync_len;
++      fbinfo->var.vsync_len = mach_info->vsync_len;
 +
-+      fbinfo->var.left_margin =
-+      fbinfo->var.right_margin =
-+      fbinfo->var.hsync_len = 8;
-+#endif
-+
-+      fbinfo->var.red.offset = 11;
-+      fbinfo->var.green.offset = 5;
-+      fbinfo->var.blue.offset = 0;
-+      fbinfo->var.transp.offset = 0;
-+      fbinfo->var.red.length = 5;
-+      fbinfo->var.green.length = 6;
-+      fbinfo->var.blue.length = 5;
-+      fbinfo->var.transp.length = 0;
-+
 +      memset(fbinfo->screen_base, 0, mach_info->xres.max *
 +                                     mach_info->yres.max *
 +                                     mach_info->bpp.max / 8);
 +
 +      glamo_engine_enable(mach_info->glamo, GLAMO_ENGINE_LCD);
 +      glamo_engine_reset(mach_info->glamo, GLAMO_ENGINE_LCD);
-+      glamofb_run_script(glamofb, glamo_regs, ARRAY_SIZE(glamo_regs));
-+      glamofb_cmd_mode(glamofb, 0);
++      glamofb_init_regs(glamofb);
 +
 +      rc = register_framebuffer(fbinfo);
 +      if (rc < 0) {




--- End Message ---
--- Begin Message ---
Author: laforge
Date: 2007-12-06 08:05:30 +0100 (Thu, 06 Dec 2007)
New Revision: 3591

Modified:
   branches/src/target/kernel/2.6.24.x/patches/smedia-glamo.patch
Log:
GLAMO: Adjust DCLK ratio to match the desired pixclock. (Chia-I Wu <[EMAIL 
PROTECTED]>)


Modified: branches/src/target/kernel/2.6.24.x/patches/smedia-glamo.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/smedia-glamo.patch      
2007-12-06 07:00:19 UTC (rev 3590)
+++ branches/src/target/kernel/2.6.24.x/patches/smedia-glamo.patch      
2007-12-06 07:05:30 UTC (rev 3591)
@@ -545,7 +545,7 @@
 ===================================================================
 --- /dev/null
 +++ linux-2.6/drivers/video/glamo/glamo-core.c
-@@ -0,0 +1,1020 @@
+@@ -0,0 +1,1067 @@
 +/* Smedia Glamo 336x/337x driver
 + *
 + * (C) 2007 by OpenMoko, Inc.
@@ -1036,9 +1036,85 @@
 +      spin_lock(&glamo->lock);
 +      __reg_clear_bit(glamo, rst->reg, rst->val);
 +      spin_unlock(&glamo->lock);
++
++      msleep(1);
 +}
 +EXPORT_SYMBOL_GPL(glamo_engine_reset);
 +
++enum glamo_pll {
++      GLAMO_PLL1,
++      GLAMO_PLL2,
++};
++
++static int glamo_pll_rate(struct glamo_core *glamo,
++                        enum glamo_pll pll)
++{
++      u_int16_t reg;
++      unsigned int div = 512;
++      /* FIXME: move osci into platform_data */
++      unsigned int osci = 32768;
++
++      if (osci == 32768)
++              div = 1;
++
++      switch (pll) {
++      case GLAMO_PLL1:
++              reg = __reg_read(glamo, GLAMO_REG_PLL_GEN1);
++              break;
++      case GLAMO_PLL2:
++              reg = __reg_read(glamo, GLAMO_REG_PLL_GEN3);
++              break;
++      default:
++              return -EINVAL;
++      }
++      return (osci/div)*reg;
++}
++
++int glamo_engine_reclock(struct glamo_core *glamo,
++                       enum glamo_engine engine,
++                       int ps)
++{
++      int pll, khz;
++      u_int16_t reg, mask, val = 0;
++
++      if (!ps)
++              return 0;
++
++      switch (engine) {
++      case GLAMO_ENGINE_LCD:
++              pll = GLAMO_PLL1;
++              reg = GLAMO_REG_CLOCK_GEN7;
++              mask = 0xff;
++              break;
++      default:
++              dev_warn(&glamo->pdev->dev,
++                       "reclock of engine 0x%x not supported\n", engine);
++              return -EINVAL;
++              break;
++      }
++
++      pll = glamo_pll_rate(glamo, pll);
++      khz = 1000000000UL / ps;
++
++      if (khz)
++              val = (pll / khz) / 1000;
++
++      dev_dbg(&glamo->pdev->dev,
++                      "PLL %d, kHZ %d, div %d\n", pll, khz, val);
++
++      if (val) {
++              val--;
++
++              reg_set_bit_mask(glamo, reg, mask, val);
++              msleep(5); /* wait some time to stabilize */
++
++              return 0;
++      } else {
++              return -EINVAL;
++      }
++}
++EXPORT_SYMBOL_GPL(glamo_engine_reclock);
++
 +/***********************************************************************
 + * script support
 + ***********************************************************************/
@@ -1191,35 +1267,6 @@
 +};
 +#endif
 +
-+enum glamo_pll {
-+      GLAMO_PLL1,
-+      GLAMO_PLL2,
-+};
-+
-+static int glamo_pll_rate(struct glamo_core *glamo,
-+                                 enum glamo_pll pll)
-+{
-+      u_int16_t reg;
-+      unsigned int div = 512;
-+      /* FIXME: move osci into platform_data */
-+      unsigned int osci = 32768;
-+
-+      if (osci == 32768)
-+              div = 1;
-+
-+      switch (pll) {
-+      case GLAMO_PLL1:
-+              reg = __reg_read(glamo, GLAMO_REG_PLL_GEN1);
-+              break;
-+      case GLAMO_PLL2:
-+              reg = __reg_read(glamo, GLAMO_REG_PLL_GEN3);
-+              break;
-+      default:
-+              return -EINVAL;
-+      }
-+      return (osci/div)*reg;
-+}
-+
 +enum glamo_power {
 +      GLAMO_POWER_ON,
 +      GLAMO_POWER_STANDBY,
@@ -1614,7 +1661,7 @@
 ===================================================================
 --- /dev/null
 +++ linux-2.6/drivers/video/glamo/glamo-fb.c
-@@ -0,0 +1,653 @@
+@@ -0,0 +1,658 @@
 +/* Smedia Glamo 336x/337x driver
 + *
 + * (C) 2007 by OpenMoko, Inc.
@@ -1816,6 +1863,11 @@
 +
 +      glamofb_cmd_mode(glamo, 1);
 +
++      if (var->pixclock)
++              glamo_engine_reclock(glamo->mach_info->glamo,
++                                   GLAMO_ENGINE_LCD,
++                                   var->pixclock);
++
 +      /* XXX highest bits of the following two regs have other meanings */
 +      reg_write(glamo, GLAMO_REG_LCD_WIDTH, var->xres);
 +      reg_write(glamo, GLAMO_REG_LCD_HEIGHT, var->yres);
@@ -2343,7 +2395,7 @@
 ===================================================================
 --- /dev/null
 +++ linux-2.6/drivers/video/glamo/glamo-core.h
-@@ -0,0 +1,51 @@
+@@ -0,0 +1,53 @@
 +#ifndef __GLAMO_CORE_H
 +#define __GLAMO_CORE_H
 +
@@ -2393,6 +2445,8 @@
 +int glamo_engine_enable(struct glamo_core *glamo, enum glamo_engine engine);
 +int glamo_engine_disable(struct glamo_core *glamo, enum glamo_engine engine);
 +void glamo_engine_reset(struct glamo_core *glamo, enum glamo_engine engine);
++int glamo_engine_reclock(struct glamo_core *glamo,
++                       enum glamo_engine engine, int ps);
 +
 +#endif /* __GLAMO_CORE_H */
 Index: linux-2.6/drivers/video/glamo/glamo-gpio.c




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

Reply via email to