summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c b/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c
index 35f06eae12..a063ae4db8 100644
--- a/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c
+++ b/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c
@@ -98,12 +98,11 @@ static unsigned short r_entry_mode = R_ENTRY_MODE_HORZ_NORMAL;
98#define R_DISP_CONTROL_REV 0x0000 98#define R_DISP_CONTROL_REV 0x0000
99static unsigned short r_disp_control_rev = R_DISP_CONTROL_NORMAL; 99static unsigned short r_disp_control_rev = R_DISP_CONTROL_NORMAL;
100 100
101/* TODO: Implement this function */ 101static inline void lcd_delay(int x)
102static void lcd_delay(int x)
103{ 102{
104 /* This is just arbitrary - the OF does something more complex */ 103 do {
105 x *= 1024; 104 asm volatile ("nop\n");
106 while (x--); 105 } while (x--);
107} 106}
108 107
109/* DBOP initialisation, do what OF does */ 108/* DBOP initialisation, do what OF does */
@@ -130,10 +129,13 @@ static void ams3525_dbop_init(void)
130 /* TODO: The OF calls some other functions here, but maybe not important */ 129 /* TODO: The OF calls some other functions here, but maybe not important */
131} 130}
132 131
133#define lcd_write_single_data16(value) do {\ 132static void lcd_write_single_data16(unsigned short value)
134 DBOP_CTRL &= ~(1<<14|1<<13); \ 133{
135 DBOP_DOUT16 = (fb_data)(value); \ 134 DBOP_CTRL &= ~(1<<14|1<<13);
136 } while(0) 135 lcd_delay(10);
136 DBOP_DOUT16 = value;
137 while ((DBOP_STAT & (1<<10)) == 0);
138}
137 139
138static void lcd_write_cmd(int cmd) 140static void lcd_write_cmd(int cmd)
139{ 141{