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. r3774 - in trunk/src: host/splash target/u-boot/patches
      ([EMAIL PROTECTED])
   2. r3775 - trunk/src/target/u-boot/patches ([EMAIL PROTECTED])
   3. r3776 - trunk/src/target/u-boot/patches ([EMAIL PROTECTED])
   4. r3777 - trunk/src/target/kernel/patches ([EMAIL PROTECTED])
--- Begin Message ---
Author: werner
Date: 2008-01-05 19:07:00 +0100 (Sat, 05 Jan 2008)
New Revision: 3774

Modified:
   trunk/src/host/splash/splashimg.pl
   trunk/src/target/u-boot/patches/uboot-20061030-neo1973.patch
Log:
target/u-boot/patches/uboot-20061030-neo1973.patch: disable HWSWP in LCDCON5 to
  make frame buffer organization consistent with what u-boot's CFB driver
  supports. Note that this requires pixels in swap screens to be swapped.

  This resolves
  http://bugzilla.openmoko.org/cgi-bin/bugzilla/show_bug.cgi?id=1140

- board/neo1973/common/jbt6k74.c (board_video_init): disable HWSWP in LCDCON5

host/splash/splashimg.pl: added option -swap to swap pixels
host/splash/splashimg.pl: added spaces after commas



Modified: trunk/src/host/splash/splashimg.pl
===================================================================
--- trunk/src/host/splash/splashimg.pl  2008-01-05 04:12:34 UTC (rev 3773)
+++ trunk/src/host/splash/splashimg.pl  2008-01-05 18:07:00 UTC (rev 3774)
@@ -2,7 +2,7 @@
 #
 # splashimg.pl - Convert a 480x640 PNG to a splash screen raw dump 
 #
-# Copyright (C) 2006-2007 by OpenMoko, Inc.
+# Copyright (C) 2006-2008 by OpenMoko, Inc.
 # Written by Werner Almesberger <[EMAIL PROTECTED]>
 # All Rights Reserved
 #
@@ -23,11 +23,12 @@
 
 
 $bpp = 16;
+$swap_pix = 0;
 
 
 sub usage
 {
-    print STDERR "usage: $0 [-32] [-pnm] [System_boot.png]\n";
+    print STDERR "usage: $0 [-32] [-pnm] [-swap] [System_boot.png]\n";
     exit(1);
 }
 
@@ -41,6 +42,10 @@
        $pnm = 1;
        shift @ARGV;
     }
+    elsif ($ARGV[0] eq "-swap") {
+       $swap_pix = 1;
+       shift @ARGV;
+    }
     else {
        die "unrecognized option: \"$ARGV[0]\"";
     }
@@ -64,27 +69,27 @@
 system($cmd) && die "system \"$cmd\": $?";
 
 for ("red", "grn", "blu") {
-    open(FILE,"noname.$_") || die "noname.$_";
-    $f = join("",<FILE>);
+    open(FILE, "noname.$_") || die "noname.$_";
+    $f = join("", <FILE>);
     close FILE;
     unlink("noname.$_");
     $f =~ s/^P5\s+(\d+)\s+(\d+)\s+(\d+)\s//s;
-    ($w,$h,$p) = ($1,$2,$3);
+    ($w, $h, $p) = ($1, $2, $3);
     $p{$_} = $f;
 }
 
 print STDERR "$w x $h ($p)\n";
 
 for ($i = 0; $i != $w*$h; $i++) {
-    $r = unpack("C",substr($p{"red"},$i,1));
-    $g = unpack("C",substr($p{"grn"},$i,1));
-    $b = unpack("C",substr($p{"blu"},$i,1));
+    $r = unpack("C", substr($p{"red"}, $i ^ $swap_pix, 1));
+    $g = unpack("C", substr($p{"grn"}, $i ^ $swap_pix, 1));
+    $b = unpack("C", substr($p{"blu"}, $i ^ $swap_pix, 1));
     if ($bpp == 16) {
        $v = ($r >> 3) << 11 | ($g >> 2) << 5 | ($b >> 3);
-       print pack("v",$v) || die "print: $!";
+       print pack("v", $v) || die "print: $!";
     }
     else {
        $v = ($r) << 16 | ($g) << 8 | $b;
-       print pack("V",$v) || die "print: $!";
+       print pack("V", $v) || die "print: $!";
     }
 }

Modified: trunk/src/target/u-boot/patches/uboot-20061030-neo1973.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-20061030-neo1973.patch        
2008-01-05 04:12:34 UTC (rev 3773)
+++ trunk/src/target/u-boot/patches/uboot-20061030-neo1973.patch        
2008-01-05 18:07:00 UTC (rev 3774)
@@ -8,7 +8,7 @@
 ===================================================================
 --- u-boot.orig/Makefile
 +++ u-boot/Makefile
-@@ -2244,6 +2244,14 @@
+@@ -2270,6 +2270,14 @@
  sbc2410x_config: unconfig
        @$(MKCONFIG) $(@:_config=) arm arm920t sbc2410x NULL s3c24x0
  
@@ -873,7 +873,7 @@
 +      lcd->LCDCON2 = 0x019fc3c1;
 +      lcd->LCDCON3 = 0x0039df67;
 +      lcd->LCDCON4 = 0x00000007;
-+      lcd->LCDCON5 = 0x0001cf09;
++      lcd->LCDCON5 = 0x0001cf08;
 +      lcd->LPCSEL  = 0x00000000;
 +}
 Index: u-boot/board/neo1973/common/jbt6k74.h




--- End Message ---
--- Begin Message ---
Author: werner
Date: 2008-01-05 20:15:31 +0100 (Sat, 05 Jan 2008)
New Revision: 3775

Modified:
   trunk/src/target/u-boot/patches/eabi-toolchain.patch
   trunk/src/target/u-boot/patches/series
Log:
- series: enabled eabi-toolchain.patch (and moved it further up)
- eabi-toolchain.patch: for "raise", use "hang" instead of "_start"



Modified: trunk/src/target/u-boot/patches/eabi-toolchain.patch
===================================================================
--- trunk/src/target/u-boot/patches/eabi-toolchain.patch        2008-01-05 
18:07:00 UTC (rev 3774)
+++ trunk/src/target/u-boot/patches/eabi-toolchain.patch        2008-01-05 
19:15:31 UTC (rev 3775)
@@ -38,7 +38,7 @@
 -PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-mabi=apcs-gnu)
 +#PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-mabi=apcs-gnu)
  PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call 
cc-option,-malignment-traps,))
-+PLATFORM_LDFLAGS += --defsym raise=_start
++PLATFORM_LDFLAGS += --defsym raise=hang
 Index: u-boot/board/neo1973/gta01/Makefile
 ===================================================================
 --- u-boot.orig/board/neo1973/gta01/Makefile

Modified: trunk/src/target/u-boot/patches/series
===================================================================
--- trunk/src/target/u-boot/patches/series      2008-01-05 18:07:00 UTC (rev 
3774)
+++ trunk/src/target/u-boot/patches/series      2008-01-05 19:15:31 UTC (rev 
3775)
@@ -74,11 +74,12 @@
 uboot-s3c2443.patch
 uboot-smdk2443.patch
 
+# need to find out how upstream feels about this one
+eabi-toolchain.patch
+
 # for review, merge soon
 unbusy-i2c.patch 
 usbtty-irq-racecondition-fix.patch
 neo1973-gsmver.patch
 uboot-nand_write_yaffs.patch
 uboot-neo1973_defaultconsole_usbtty.patch
-# consider merging after checking OE resolution for bug P#180
-#eabi-toolchain.patch




--- End Message ---
--- Begin Message ---
Author: werner
Date: 2008-01-05 21:16:09 +0100 (Sat, 05 Jan 2008)
New Revision: 3776

Modified:
   trunk/src/target/u-boot/patches/uboot-usbtty-acm.patch
Log:
This fixes the hang at boot time if usbtty is set but no USB is connected.
http://bugzilla.openmoko.org/cgi-bin/bugzilla/show_bug.cgi?id=887

The problem surfaced in the first place because upstream changed
USBTTY_BUFFER_SIZE from 2048 bytes, which was apparently always big enough, to
256 bytes, which isn't. The logic of the fix is slightly ugly since we could
already exit in usbtty_puts if there is no USB. However, this kills the slight
chance that someone might connect and see the buffered messages.

uboot-usbtty-acm.patch:
- drivers/serial/usbtty.c (__usbtty_puts): allow overwriting of the circular
  buffer if usbtty is not configured. This is a slight variation of
  http://bugzilla.openmoko.org/cgi-bin/bugzilla/attachment.cgi?id=462



Modified: trunk/src/target/u-boot/patches/uboot-usbtty-acm.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-usbtty-acm.patch      2008-01-05 
19:15:31 UTC (rev 3775)
+++ trunk/src/target/u-boot/patches/uboot-usbtty-acm.patch      2008-01-05 
20:16:09 UTC (rev 3776)
@@ -25,7 +25,20 @@
  #include <circbuf.h>
  #include <devices.h>
  #include "usbtty.h"
-@@ -544,6 +545,14 @@
+@@ -474,6 +475,12 @@
+               usbtty_poll ();
+ 
+               space = maxlen - usbtty_output.size;
++
++              /* If the USB is not configured, allow the circular buffer to
++                 be overwritten. Otherwise this while() will loop forever. */
++              if (!usbtty_configured())
++                      space = maxlen;
++
+               /* Empty buffer here, if needed, to ensure space... */
+               if (space) {
+                       write_buffer (&usbtty_output);
+@@ -544,6 +551,14 @@
        }
        usbtty_init_terminal_type(strcmp(tt,"cdc_acm"));
  
@@ -68,7 +81,7 @@
  
  #define CONFIG_USBD_CONFIGURATION_STR "TTY via USB"
  
-Index: u-boot/drivers/usbdcore_omap1510.c
+Index: u-boot/drivers/usb/usbdcore_omap1510.c
 ===================================================================
 --- u-boot.orig/drivers/usb/usbdcore_omap1510.c
 +++ u-boot/drivers/usb/usbdcore_omap1510.c




--- End Message ---
--- Begin Message ---
Author: werner
Date: 2008-01-06 02:02:26 +0100 (Sun, 06 Jan 2008)
New Revision: 3777

Added:
   trunk/src/target/kernel/patches/fbset-gta02-core.patch
   trunk/src/target/kernel/patches/fbset-smedia-glamo.patch
Modified:
   trunk/src/target/kernel/patches/series
Log:
These are the fbset support patches olv submitted a month ago:
http://lists.openmoko.org/pipermail/openmoko-kernel/2007-December/000322.html

The patches are commented out in "series", since they're still untested
| This patchset adds fbset support to glamofb.  This means, it can now
| switch between VGA and QVGA at runtime like GTA01 does.
|
| Stefan has wrote up a howto for GTA01:
|
| http://lists.openmoko.org/pipermail/neo1973-hardware/2007-October/000267.html
|
| It is almost the same for GTA02.  The only difference is that the LCM is
| controlled by:
|
| /sys/devices/platform/glamo3362.0/glamo-spi-gpio.0/spi2.0/state

fbset-gta02-core.patch:
- arch/arm/mach-s3c2440/mach-gta02.c (gta02_glamo_pdata): initialize fields for
  timing data

fbset-smedia-glamo.patch:
- include/linux/glamofb.h (struct glamofb_platform_data): add fields for timing
  data
- drivers/video/glamo/glamo-fb.c: move modeline setting to a function of
  itself. Call this function on initialization and set_par.
- drivers/video/glamo/glamo-fb.c (glamofb_cmd_mode): glamo fails to return to
  display mode if we switch to and back from cmd mode too quickly. Add a
  certain amount of delay after entering cmd mode.
- drivers/video/glamo/glamo-core.c (glamo_engine_reset, glamo_pll_rate,
  glamo_engine_reclock), drivers/video/glamo/glamo-core.h
  (glamo_engine_reclock), drivers/video/glamo/glamo-fb.c
  (glamofb_activate_var): adjust DCLK ratio to match the desired pixclock.

series: added fbset-gta02-core.patch and fbset-smedia-glamo.patch



Added: trunk/src/target/kernel/patches/fbset-gta02-core.patch
===================================================================
--- trunk/src/target/kernel/patches/fbset-gta02-core.patch      2008-01-05 
20:16:09 UTC (rev 3776)
+++ trunk/src/target/kernel/patches/fbset-gta02-core.patch      2008-01-06 
01:02:26 UTC (rev 3777)
@@ -0,0 +1,28 @@
+- arch/arm/mach-s3c2440/mach-gta02.c (gta02_glamo_pdata): initialize fields for
+  timing data
+
+Signed-off-by: Chia-I Wu <[EMAIL PROTECTED]>
+Acked-by: Werner Almesberger <[EMAIL PROTECTED]>
+
+Index: linux-2.6.22.5/arch/arm/mach-s3c2440/mach-gta02.c
+===================================================================
+--- linux-2.6.22.5.orig/arch/arm/mach-s3c2440/mach-gta02.c
++++ linux-2.6.22.5/arch/arm/mach-s3c2440/mach-gta02.c
+@@ -514,8 +514,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,

Added: trunk/src/target/kernel/patches/fbset-smedia-glamo.patch
===================================================================
--- trunk/src/target/kernel/patches/fbset-smedia-glamo.patch    2008-01-05 
20:16:09 UTC (rev 3776)
+++ trunk/src/target/kernel/patches/fbset-smedia-glamo.patch    2008-01-06 
01:02:26 UTC (rev 3777)
@@ -0,0 +1,339 @@
+- include/linux/glamofb.h (struct glamofb_platform_data): add fields for timing
+  data
+- drivers/video/glamo/glamo-fb.c: move modeline setting to a function of 
+  itself. Call this function on initialization and set_par.
+- drivers/video/glamo/glamo-fb.c (glamofb_cmd_mode): glamo fails to return to 
+  display mode if we switch to and back from cmd mode too quickly. Add a 
+  certain amount of delay after entering cmd mode.
+- drivers/video/glamo/glamo-core.c (glamo_engine_reset, glamo_pll_rate, 
+  glamo_engine_reclock), drivers/video/glamo/glamo-core.h 
+  (glamo_engine_reclock), drivers/video/glamo/glamo-fb.c 
+  (glamofb_activate_var): adjust DCLK ratio to match the desired pixclock.
+
+Signed-off-by: Chia-I Wu <[EMAIL PROTECTED]>
+Acked-by: Werner Almesberger <[EMAIL PROTECTED]>
+
+Index: linux-2.6.22.5/include/linux/glamofb.h
+===================================================================
+--- linux-2.6.22.5.orig/include/linux/glamofb.h
++++ linux-2.6.22.5/include/linux/glamofb.h
+@@ -13,6 +13,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;
+Index: linux-2.6.22.5/drivers/video/glamo/glamo-fb.c
+===================================================================
+--- linux-2.6.22.5.orig/drivers/video/glamo/glamo-fb.c
++++ linux-2.6.22.5/drivers/video/glamo/glamo-fb.c
+@@ -99,25 +99,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,
+@@ -207,24 +194,69 @@
+       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);
++
++      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);
++      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;
+-      glamo->fb->fix.smem_len = info->fix.line_length * var->yres_virtual;
++      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;
+ }
+@@ -368,6 +400,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)
+@@ -384,7 +418,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))
+@@ -409,6 +442,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;
+@@ -504,24 +549,14 @@
+       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.left_margin =
+-      fbinfo->var.right_margin =
+-      fbinfo->var.hsync_len = 8;
+-#endif
++      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.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;
+       fbinfo->fix.smem_len = mach_info->xres.max *
+                              mach_info->yres.max *
+                              mach_info->bpp.max / 8;
+@@ -530,8 +565,7 @@
+ 
+       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) {
+Index: linux-2.6.22.5/drivers/video/glamo/glamo-core.c
+===================================================================
+--- linux-2.6.22.5.orig/drivers/video/glamo/glamo-core.c
++++ linux-2.6.22.5/drivers/video/glamo/glamo-core.c
+@@ -488,9 +488,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
+  ***********************************************************************/
+@@ -643,35 +719,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,

Modified: trunk/src/target/kernel/patches/series
===================================================================
--- trunk/src/target/kernel/patches/series      2008-01-05 20:16:09 UTC (rev 
3776)
+++ trunk/src/target/kernel/patches/series      2008-01-06 01:02:26 UTC (rev 
3777)
@@ -45,9 +45,13 @@
 hxd8-tsl256x.patch
 pcf50633.patch
 smedia-glamo.patch
+# test, then merge
+#fbset-smedia-glamo.patch
 s3c24xx-nand-largepage.patch
 s3c2442b-cpuid.patch
 gta02-core.patch
+# test, then merge
+#fbset-gta02-core.patch
 # merge into gta02-core as soon as compatibility issues are resolved
 gta02-nor.patch
 lis302dl.patch




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

Reply via email to