summaryrefslogtreecommitdiff
path: root/firmware/target/arm
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm')
-rw-r--r--firmware/target/arm/rk27xx/lcd-hifiman.c8
-rw-r--r--firmware/target/arm/rk27xx/lcdif-rk27xx.c15
-rw-r--r--firmware/target/arm/rk27xx/lcdif-rk27xx.h7
-rw-r--r--firmware/target/arm/rk27xx/rk27generic/lcd-rk27generic.c8
4 files changed, 27 insertions, 11 deletions
diff --git a/firmware/target/arm/rk27xx/lcd-hifiman.c b/firmware/target/arm/rk27xx/lcd-hifiman.c
index dba6accd1d..d98ed5a1c3 100644
--- a/firmware/target/arm/rk27xx/lcd-hifiman.c
+++ b/firmware/target/arm/rk27xx/lcd-hifiman.c
@@ -29,7 +29,7 @@
29 29
30static bool display_on = false; 30static bool display_on = false;
31 31
32void lcd_display_init() 32static void lcd_display_init(void)
33{ 33{
34 unsigned int x, y; 34 unsigned int x, y;
35 35
@@ -108,6 +108,12 @@ void lcd_display_init()
108 display_on = true; 108 display_on = true;
109} 109}
110 110
111void lcd_init_device(void)
112{
113 lcdif_init(LCDIF_16BIT);
114 lcd_display_init();
115}
116
111void lcd_enable (bool on) 117void lcd_enable (bool on)
112{ 118{
113 if (on) 119 if (on)
diff --git a/firmware/target/arm/rk27xx/lcdif-rk27xx.c b/firmware/target/arm/rk27xx/lcdif-rk27xx.c
index ff60279315..affc49b213 100644
--- a/firmware/target/arm/rk27xx/lcdif-rk27xx.c
+++ b/firmware/target/arm/rk27xx/lcdif-rk27xx.c
@@ -123,27 +123,26 @@ static void lcdctrl_init(void)
123} 123}
124 124
125/* configure pins to drive lcd in 18bit mode (16bit mode for HiFiMAN's) */ 125/* configure pins to drive lcd in 18bit mode (16bit mode for HiFiMAN's) */
126static void iomux_lcd(void) 126static void iomux_lcd(enum lcdif_mode_t mode)
127{ 127{
128 unsigned long muxa; 128 unsigned long muxa;
129 129
130 muxa = SCU_IOMUXA_CON & ~(IOMUX_LCD_VSYNC|IOMUX_LCD_DEN|0xff); 130 muxa = SCU_IOMUXA_CON & ~(IOMUX_LCD_VSYNC|IOMUX_LCD_DEN|0xff);
131 131
132#if !defined(HM801) && !defined(HM60x) 132 if (mode == LCDIF_18BIT)
133 muxa |= IOMUX_LCD_D18|IOMUX_LCD_D20|IOMUX_LCD_D22|IOMUX_LCD_D17|IOMUX_LCD_D16; 133 {
134#endif 134 muxa |= IOMUX_LCD_D18|IOMUX_LCD_D20|IOMUX_LCD_D22|IOMUX_LCD_D17|IOMUX_LCD_D16;
135 }
135 136
136 SCU_IOMUXA_CON = muxa; 137 SCU_IOMUXA_CON = muxa;
137 SCU_IOMUXB_CON |= IOMUX_LCD_D815; 138 SCU_IOMUXB_CON |= IOMUX_LCD_D815;
138} 139}
139 140
140void lcd_init_device() 141void lcdif_init(enum lcdif_mode_t mode)
141{ 142{
142 iomux_lcd(); /* setup pins for 16bit lcd interface */ 143 iomux_lcd(mode); /* setup pins for lcd interface */
143 lcdctrl_init(); /* basic lcdc module configuration */ 144 lcdctrl_init(); /* basic lcdc module configuration */
144
145 lcdctrl_bypass(1); /* run in bypass mode - all writes goes directly to lcd controller */ 145 lcdctrl_bypass(1); /* run in bypass mode - all writes goes directly to lcd controller */
146 lcd_display_init();
147} 146}
148 147
149/* This is ugly hack. We drive lcd in bypass mode 148/* This is ugly hack. We drive lcd in bypass mode
diff --git a/firmware/target/arm/rk27xx/lcdif-rk27xx.h b/firmware/target/arm/rk27xx/lcdif-rk27xx.h
index caf97c8e94..1d7b810fa2 100644
--- a/firmware/target/arm/rk27xx/lcdif-rk27xx.h
+++ b/firmware/target/arm/rk27xx/lcdif-rk27xx.h
@@ -1,11 +1,16 @@
1#ifndef _LCDIF_RK27XX_H 1#ifndef _LCDIF_RK27XX_H
2#define _LCDIF_RK27XX_H 2#define _LCDIF_RK27XX_H
3 3
4enum lcdif_mode_t {
5 LCDIF_16BIT,
6 LCDIF_18BIT
7};
8
4unsigned int lcd_data_transform(unsigned int data); 9unsigned int lcd_data_transform(unsigned int data);
5 10
6void lcd_cmd(unsigned int cmd); 11void lcd_cmd(unsigned int cmd);
7void lcd_data(unsigned int data); 12void lcd_data(unsigned int data);
8void lcd_write_reg(unsigned int reg, unsigned int val); 13void lcd_write_reg(unsigned int reg, unsigned int val);
9void lcd_display_init(void); 14void lcdif_init(enum lcdif_mode_t mode);
10 15
11#endif /* _LCDIF_RK27XX_H */ 16#endif /* _LCDIF_RK27XX_H */
diff --git a/firmware/target/arm/rk27xx/rk27generic/lcd-rk27generic.c b/firmware/target/arm/rk27xx/rk27generic/lcd-rk27generic.c
index e15262398b..5eca87c6d8 100644
--- a/firmware/target/arm/rk27xx/rk27generic/lcd-rk27generic.c
+++ b/firmware/target/arm/rk27xx/rk27generic/lcd-rk27generic.c
@@ -71,7 +71,7 @@ static void lcd_sleep(bool sleep)
71 lcd_cmd(GRAM_WRITE); 71 lcd_cmd(GRAM_WRITE);
72} 72}
73 73
74void lcd_display_init() 74static void lcd_display_init(void)
75{ 75{
76 unsigned int x, y; 76 unsigned int x, y;
77 77
@@ -173,6 +173,12 @@ void lcd_display_init()
173 lcd_sleep(false); 173 lcd_sleep(false);
174} 174}
175 175
176void lcd_init_device(void)
177{
178 lcdif_init(LCDIF_18BIT);
179 lcd_display_init();
180}
181
176void lcd_update_rect(int x, int y, int width, int height) 182void lcd_update_rect(int x, int y, int width, int height)
177{ 183{
178 int px = x, py = y; 184 int px = x, py = y;