summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorBertrik Sikken <bertrik@sikken.nl>2009-07-30 18:33:17 +0000
committerBertrik Sikken <bertrik@sikken.nl>2009-07-30 18:33:17 +0000
commit95d043b26dd043e76a4c6050941cdf4faebe7a8b (patch)
treecd24035d5ec28ee68916393ab553582cf8d30738 /firmware
parenta616f49f04cef85545d8ec54e9297aadf52502e6 (diff)
downloadrockbox-95d043b26dd043e76a4c6050941cdf4faebe7a8b.tar.gz
rockbox-95d043b26dd043e76a4c6050941cdf4faebe7a8b.tar.bz2
rockbox-95d043b26dd043e76a4c6050941cdf4faebe7a8b.zip
Meizu M3: check LCD_STATUS in the lcd driver instead of using delay loops
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22090 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/target/arm/s5l8700/meizu-m3/lcd-m3.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/firmware/target/arm/s5l8700/meizu-m3/lcd-m3.c b/firmware/target/arm/s5l8700/meizu-m3/lcd-m3.c
index 2c52faeb8c..3420e92d62 100644
--- a/firmware/target/arm/s5l8700/meizu-m3/lcd-m3.c
+++ b/firmware/target/arm/s5l8700/meizu-m3/lcd-m3.c
@@ -29,7 +29,9 @@
#include "s5l8700.h"
/*** definitions ***/
-
+#define STAT_BUS_IDLE (1<<8) /* Data bus idle */
+#define STAT_FULL (1<<4) /* FIFO full */
+#define STAT_READON (1<<0) /* Read operation done */
/** globals **/
static uint8_t lcd_type;
@@ -81,9 +83,13 @@ static uint8_t lcd_readdata(void)
static void lcd_writereg(uint32_t reg, uint32_t data)
{
+ while (LCD_STATUS & STAT_FULL);
LCD_WCMD = reg >> 8;
+ while (LCD_STATUS & STAT_FULL);
LCD_WCMD = reg & 0xff;
+ while (LCD_STATUS & STAT_FULL);
LCD_WDATA = data >> 8;
+ while (LCD_STATUS & STAT_FULL);
LCD_WDATA = data & 0xff;
}
@@ -290,10 +296,12 @@ void lcd_update(void)
LCD_WCMD = 0x22;
}
for(p=&lcd_framebuffer[0][0], i=0;i<LCD_WIDTH*LCD_FBHEIGHT;++i, ++p) {
+ while (LCD_STATUS & STAT_FULL);
LCD_WDATA = RGB_UNPACK_RED(*p);
+ while (LCD_STATUS & STAT_FULL);
LCD_WDATA = RGB_UNPACK_GREEN(*p);
+ while (LCD_STATUS & STAT_FULL);
LCD_WDATA = RGB_UNPACK_BLUE(*p);
- lcd_sleep(3); /* if data is sent too fast to lcdif, machine freezes */
}
}