r3888 - branches/src/target/kernel/2.6.24.x/patches
werner at sita.openmoko.org
werner at sita.openmoko.org
Mon Jan 21 03:04:52 CET 2008
Author: werner
Date: 2008-01-21 03:04:49 +0100 (Mon, 21 Jan 2008)
New Revision: 3888
Modified:
branches/src/target/kernel/2.6.24.x/patches/smedia-glamo.patch
Log:
Glamo is picky about when a register may be accessed, so we have to spin for a
few cycles. (Note: this hasn't been tested yet. May need tuning.)
smedia-glamo.patch:
- drivers/mfd/glamo/glamo-core.h (glamo_reg_access_delay): delay function for
register access
- drivers/mfd/glamo/glamo-fb.c (reg_read, reg_write): added access delay
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 2008-01-21 01:33:31 UTC (rev 3887)
+++ branches/src/target/kernel/2.6.24.x/patches/smedia-glamo.patch 2008-01-21 02:04:49 UTC (rev 3888)
@@ -1664,7 +1664,7 @@
===================================================================
--- /dev/null
+++ linux-2.6.24-rc7/drivers/mfd/glamo/glamo-fb.c
-@@ -0,0 +1,820 @@
+@@ -0,0 +1,822 @@
+/* Smedia Glamo 336x/337x driver
+ *
+ * (C) 2007 by OpenMoko, Inc.
@@ -1687,8 +1687,6 @@
+ * MA 02111-1307 USA
+ */
+
-+#define DEBUG
-+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/errno.h>
@@ -1748,15 +1746,18 @@
+ .name = "glamo-lcm-spi",
+};
+
-+static inline int reg_read(struct glamofb_handle *glamo,
++
++static int reg_read(struct glamofb_handle *glamo,
+ u_int16_t reg)
+{
++ glamo_reg_access_delay();
+ return readw(glamo->base + reg);
+}
+
-+static inline void reg_write(struct glamofb_handle *glamo,
++static void reg_write(struct glamofb_handle *glamo,
+ u_int16_t reg, u_int16_t val)
+{
++ glamo_reg_access_delay();
+ writew(val, glamo->base + reg);
+}
+
@@ -1861,7 +1862,8 @@
+ case 32:
+ default:
+ /* The Smedia Glamo doesn't support anything but 16bit color */
-+ printk("Smedia driver doesn't [yet?] support 24/32bpp\n");
++ printk(KERN_ERR
++ "Smedia driver does not [yet?] support 24/32bpp\n");
+ return -EINVAL;
+ break;
+ }
@@ -2566,10 +2568,13 @@
===================================================================
--- /dev/null
+++ linux-2.6.24-rc7/drivers/mfd/glamo/glamo-core.h
-@@ -0,0 +1,79 @@
+@@ -0,0 +1,91 @@
+#ifndef __GLAMO_CORE_H
+#define __GLAMO_CORE_H
+
++#include <asm/system.h>
++
++
+/* for the time being, we put the on-screen framebuffer into the lowest
+ * VRAM space. This should make the code easily compatible with the various
+ * 2MB/4MB/8MB variants of the Smedia chips */
@@ -2639,6 +2644,15 @@
+};
+
+
++static inline void glamo_reg_access_delay(void)
++{
++ int n;
++
++ for (n = 0; n != 2; n++)
++ nop();
++}
++
++
+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);
More information about the commitlog
mailing list