diff options
author | Eric Miao <eric.miao@marvell.com> | 2008-12-08 05:46:00 -0500 |
---|---|---|
committer | Eric Miao <eric.miao@marvell.com> | 2008-12-17 09:50:52 -0500 |
commit | 69bdea7047fbac88beb8b7ba9e428c4f0e53f563 (patch) | |
tree | db4b378ef239087317cd0b4f8ba4c9d7ed8d638a | |
parent | c1f99c215c58111629984a49ba87b2b145dd1f5b (diff) |
[ARM] pxafb: allow insertion of delay to the smart panel command sequence
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>
-rw-r--r-- | arch/arm/mach-pxa/include/mach/regs-lcd.h | 7 | ||||
-rw-r--r-- | drivers/video/pxafb.c | 13 |
2 files changed, 17 insertions, 3 deletions
diff --git a/arch/arm/mach-pxa/include/mach/regs-lcd.h b/arch/arm/mach-pxa/include/mach/regs-lcd.h index c689c4ea769c..f817878d256b 100644 --- a/arch/arm/mach-pxa/include/mach/regs-lcd.h +++ b/arch/arm/mach-pxa/include/mach/regs-lcd.h | |||
@@ -177,4 +177,11 @@ | |||
177 | 177 | ||
178 | #define SMART_CMD(x) (SMART_CMD_WRITE_COMMAND | ((x) & 0xff)) | 178 | #define SMART_CMD(x) (SMART_CMD_WRITE_COMMAND | ((x) & 0xff)) |
179 | #define SMART_DAT(x) (SMART_CMD_WRITE_DATA | ((x) & 0xff)) | 179 | #define SMART_DAT(x) (SMART_CMD_WRITE_DATA | ((x) & 0xff)) |
180 | |||
181 | /* SMART_DELAY() is introduced for software controlled delay primitive which | ||
182 | * can be inserted between command sequences, unused command 0x6 is used here | ||
183 | * and delay ranges from 0ms ~ 255ms | ||
184 | */ | ||
185 | #define SMART_CMD_DELAY (0x6 << 9) | ||
186 | #define SMART_DELAY(ms) (SMART_CMD_DELAY | ((ms) & 0xff)) | ||
180 | #endif /* __ASM_ARCH_REGS_LCD_H */ | 187 | #endif /* __ASM_ARCH_REGS_LCD_H */ |
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c index d6de84b42036..1e1c4ec0d3b9 100644 --- a/drivers/video/pxafb.c +++ b/drivers/video/pxafb.c | |||
@@ -723,12 +723,19 @@ int pxafb_smart_queue(struct fb_info *info, uint16_t *cmds, int n_cmds) | |||
723 | int i; | 723 | int i; |
724 | struct pxafb_info *fbi = container_of(info, struct pxafb_info, fb); | 724 | struct pxafb_info *fbi = container_of(info, struct pxafb_info, fb); |
725 | 725 | ||
726 | /* leave 2 commands for INTERRUPT and WAIT_FOR_SYNC */ | 726 | for (i = 0; i < n_cmds; i++, cmds++) { |
727 | for (i = 0; i < n_cmds; i++) { | 727 | /* if it is a software delay, flush and delay */ |
728 | if ((*cmds & 0xff00) == SMART_CMD_DELAY) { | ||
729 | pxafb_smart_flush(info); | ||
730 | mdelay(*cmds & 0xff); | ||
731 | continue; | ||
732 | } | ||
733 | |||
734 | /* leave 2 commands for INTERRUPT and WAIT_FOR_SYNC */ | ||
728 | if (fbi->n_smart_cmds == CMD_BUFF_SIZE - 8) | 735 | if (fbi->n_smart_cmds == CMD_BUFF_SIZE - 8) |
729 | pxafb_smart_flush(info); | 736 | pxafb_smart_flush(info); |
730 | 737 | ||
731 | fbi->smart_cmds[fbi->n_smart_cmds++] = *cmds++; | 738 | fbi->smart_cmds[fbi->n_smart_cmds++] = *cmds; |
732 | } | 739 | } |
733 | 740 | ||
734 | return 0; | 741 | return 0; |