summaryrefslogtreecommitdiff
path: root/firmware/target/mips/ingenic_x1000/fiiom3k/lcd-fiiom3k.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/mips/ingenic_x1000/fiiom3k/lcd-fiiom3k.c')
-rw-r--r--firmware/target/mips/ingenic_x1000/fiiom3k/lcd-fiiom3k.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/firmware/target/mips/ingenic_x1000/fiiom3k/lcd-fiiom3k.c b/firmware/target/mips/ingenic_x1000/fiiom3k/lcd-fiiom3k.c
index 96f794d7df..29e72286ff 100644
--- a/firmware/target/mips/ingenic_x1000/fiiom3k/lcd-fiiom3k.c
+++ b/firmware/target/mips/ingenic_x1000/fiiom3k/lcd-fiiom3k.c
@@ -25,9 +25,6 @@
25#include "gpio-x1000.h" 25#include "gpio-x1000.h"
26#include "system.h" 26#include "system.h"
27 27
28#define CS_PIN (1 << 18)
29#define RD_PIN (1 << 16)
30
31static const uint32_t fiio_lcd_cmd_enable[] = { 28static const uint32_t fiio_lcd_cmd_enable[] = {
32 /* Software reset */ 29 /* Software reset */
33 LCD_INSTR_CMD, 0x01, 30 LCD_INSTR_CMD, 0x01,
@@ -169,17 +166,27 @@ const struct lcd_tgt_config lcd_tgt_config = {
169void lcd_tgt_enable(bool enable) 166void lcd_tgt_enable(bool enable)
170{ 167{
171 if(enable) { 168 if(enable) {
172 gpio_config(GPIO_A, 0xffff, GPIO_DEVICE(1)); 169 /* reset controller, probably */
173 gpio_config(GPIO_B, 0x1f << 16, GPIO_DEVICE(1)); 170 gpio_set_level(GPIO_LCD_CE, 1);
174 gpio_config(GPIO_B, CS_PIN|RD_PIN, GPIO_OUTPUT(1)); 171 gpio_set_level(GPIO_LCD_RD, 1);
175 mdelay(5); 172 mdelay(5);
176 gpio_out_level(GPIO_B, CS_PIN, 0); 173 gpio_set_level(GPIO_LCD_CE, 0);
174
175 /* set the clock whatever it is... */
177 lcd_set_clock(X1000_CLK_SCLK_A, 30000000); 176 lcd_set_clock(X1000_CLK_SCLK_A, 30000000);
177
178 /* program the initial configuration */
178 lcd_exec_commands(&fiio_lcd_cmd_enable[0]); 179 lcd_exec_commands(&fiio_lcd_cmd_enable[0]);
179 } else { 180 } else {
181 /* go to sleep mode first */
180 lcd_exec_commands(&fiio_lcd_cmd_sleep[0]); 182 lcd_exec_commands(&fiio_lcd_cmd_sleep[0]);
181 mdelay(115); /* ensure we wait a total of 120ms before power off */ 183
182 gpio_config(GPIO_B, CS_PIN|RD_PIN, 0); 184 /* ensure we wait a total of 120ms before power off */
185 mdelay(115);
186
187 /* this is intended to power off the panel but I'm not sure it does */
188 gpio_set_level(GPIO_LCD_CE, 0);
189 gpio_set_level(GPIO_LCD_RD, 0);
183 } 190 }
184} 191}
185 192