]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[ARM] pxafb: allow insertion of delay to the smart panel command sequence
authorEric Miao <eric.miao@marvell.com>
Mon, 8 Dec 2008 10:46:00 +0000 (18:46 +0800)
committerEric Miao <eric.miao@marvell.com>
Wed, 17 Dec 2008 14:50:52 +0000 (22:50 +0800)
Some smart panel requires a delay between command sequences, while PXA
LCD controller didn't provide such one, let's emulate this by software.

A software delay marker can be inserted into the command sequence, once
pxafb_smart_queue() detects this, it flushes the previous commands and
delay for a specified number of milliseconds.

Signed-off-by: Eric Miao <eric.miao@marvell.com>
arch/arm/mach-pxa/include/mach/regs-lcd.h
drivers/video/pxafb.c

index c689c4ea769cbf3892bac3d44134b4324052af8f..f817878d256b523a20a6095e689a9f9e16bd3784 100644 (file)
 
 #define SMART_CMD(x)   (SMART_CMD_WRITE_COMMAND | ((x) & 0xff))
 #define SMART_DAT(x)   (SMART_CMD_WRITE_DATA | ((x) & 0xff))
+
+/* SMART_DELAY() is introduced for software controlled delay primitive which
+ * can be inserted between command sequences, unused command 0x6 is used here
+ * and delay ranges from 0ms ~ 255ms
+ */
+#define SMART_CMD_DELAY                (0x6 << 9)
+#define SMART_DELAY(ms)                (SMART_CMD_DELAY | ((ms) & 0xff))
 #endif /* __ASM_ARCH_REGS_LCD_H */
index d6de84b420369e9ded1bf63ca5d3f7f4e9e1cb68..1e1c4ec0d3b935681cb6c9fce59cf2780d3b882c 100644 (file)
@@ -723,12 +723,19 @@ int pxafb_smart_queue(struct fb_info *info, uint16_t *cmds, int n_cmds)
        int i;
        struct pxafb_info *fbi = container_of(info, struct pxafb_info, fb);
 
-       /* leave 2 commands for INTERRUPT and WAIT_FOR_SYNC */
-       for (i = 0; i < n_cmds; i++) {
+       for (i = 0; i < n_cmds; i++, cmds++) {
+               /* if it is a software delay, flush and delay */
+               if ((*cmds & 0xff00) == SMART_CMD_DELAY) {
+                       pxafb_smart_flush(info);
+                       mdelay(*cmds & 0xff);
+                       continue;
+               }
+
+               /* leave 2 commands for INTERRUPT and WAIT_FOR_SYNC */
                if (fbi->n_smart_cmds == CMD_BUFF_SIZE - 8)
                        pxafb_smart_flush(info);
 
-               fbi->smart_cmds[fbi->n_smart_cmds++] = *cmds++;
+               fbi->smart_cmds[fbi->n_smart_cmds++] = *cmds;
        }
 
        return 0;