diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2011-12-16 23:40:39 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2011-12-16 23:40:39 +0000 |
commit | 95e6043d5e256df72c20db39c3be59a3ba977b19 (patch) | |
tree | 20a86cd626c43e92436459b6a408c4a13f4c21ef /firmware/target/arm/imx31 | |
parent | 13b2f5381310bc4e58d34f8dac0c8b9bdbd736d2 (diff) | |
download | rockbox-95e6043d5e256df72c20db39c3be59a3ba977b19.tar.gz rockbox-95e6043d5e256df72c20db39c3be59a3ba977b19.zip |
Convert remaining memframe LCDs that can be convert to common code.
Massage the way it interfaces a bit to make things more flexible.
The chroma_buf scheme on Sansa Connect and Creative ZVx calling the
lcd_write_yuv420_lines implementation in lcd-as-memframe.S with five params
with a chroma buffer that the function can't use wouldn't work anyway so just
have them use the stock implementation (really, how was that working?).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31335 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/imx31')
-rw-r--r-- | firmware/target/arm/imx31/gigabeat-s/lcd-gigabeat-s.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/firmware/target/arm/imx31/gigabeat-s/lcd-gigabeat-s.c b/firmware/target/arm/imx31/gigabeat-s/lcd-gigabeat-s.c index 1d27716d2a..f0a2764851 100644 --- a/firmware/target/arm/imx31/gigabeat-s/lcd-gigabeat-s.c +++ b/firmware/target/arm/imx31/gigabeat-s/lcd-gigabeat-s.c | |||
@@ -29,10 +29,9 @@ | |||
29 | #include "spi-imx31.h" | 29 | #include "spi-imx31.h" |
30 | #include "mc13783.h" | 30 | #include "mc13783.h" |
31 | 31 | ||
32 | extern void lcd_set_active(bool active); | ||
33 | |||
34 | #define MAIN_LCD_IDMAC_CHANNEL 14 | 32 | #define MAIN_LCD_IDMAC_CHANNEL 14 |
35 | 33 | ||
34 | extern bool lcd_on; /* lcd-memframe.c */ | ||
36 | static bool lcd_powered = true; | 35 | static bool lcd_powered = true; |
37 | 36 | ||
38 | /* Settings shadow regs */ | 37 | /* Settings shadow regs */ |
@@ -171,6 +170,8 @@ void INIT_ATTR lcd_init_device(void) | |||
171 | IPU_IPU_IMA_ADDR = ((0x1 << 16) | (MAIN_LCD_IDMAC_CHANNEL << 4)) + (1 << 3); | 170 | IPU_IPU_IMA_ADDR = ((0x1 << 16) | (MAIN_LCD_IDMAC_CHANNEL << 4)) + (1 << 3); |
172 | IPU_IPU_IMA_DATA = FRAME_PHYS_ADDR; | 171 | IPU_IPU_IMA_DATA = FRAME_PHYS_ADDR; |
173 | 172 | ||
173 | lcd_on = true; | ||
174 | |||
174 | lcd_enable_interface(true); | 175 | lcd_enable_interface(true); |
175 | lcd_sync_settings(); | 176 | lcd_sync_settings(); |
176 | } | 177 | } |
@@ -188,7 +189,7 @@ void lcd_sleep(void) | |||
188 | 189 | ||
189 | void lcd_enable(bool state) | 190 | void lcd_enable(bool state) |
190 | { | 191 | { |
191 | if (state == lcd_active()) | 192 | if (state == lcd_on) |
192 | return; | 193 | return; |
193 | 194 | ||
194 | if (state) | 195 | if (state) |
@@ -198,13 +199,13 @@ void lcd_enable(bool state) | |||
198 | IPU_IDMAC_CHA_EN |= 1ul << MAIN_LCD_IDMAC_CHANNEL; | 199 | IPU_IDMAC_CHA_EN |= 1ul << MAIN_LCD_IDMAC_CHANNEL; |
199 | lcd_sync_settings(); | 200 | lcd_sync_settings(); |
200 | sleep(HZ/50); | 201 | sleep(HZ/50); |
201 | lcd_set_active(true); | 202 | lcd_on = true; |
202 | lcd_update(); | 203 | lcd_update(); |
203 | send_event(LCD_EVENT_ACTIVATION, NULL); | 204 | send_event(LCD_EVENT_ACTIVATION, NULL); |
204 | } | 205 | } |
205 | else | 206 | else |
206 | { | 207 | { |
207 | lcd_set_active(false); | 208 | lcd_on = false; |
208 | } | 209 | } |
209 | } | 210 | } |
210 | 211 | ||
@@ -213,7 +214,7 @@ void lcd_set_contrast(int val) | |||
213 | { | 214 | { |
214 | reg0x0b = val & 0x3f; | 215 | reg0x0b = val & 0x3f; |
215 | 216 | ||
216 | if (!lcd_active()) | 217 | if (!lcd_on) |
217 | return; | 218 | return; |
218 | 219 | ||
219 | lcd_write_reg(0x0b, reg0x0b); | 220 | lcd_write_reg(0x0b, reg0x0b); |
@@ -230,7 +231,7 @@ void lcd_set_invert_display(bool yesno) | |||
230 | { | 231 | { |
231 | reg0x27 = yesno ? 0x10 : 0x00; | 232 | reg0x27 = yesno ? 0x10 : 0x00; |
232 | 233 | ||
233 | if (!lcd_active()) | 234 | if (!lcd_on) |
234 | return; | 235 | return; |
235 | 236 | ||
236 | lcd_write_reg(0x27, reg0x27); | 237 | lcd_write_reg(0x27, reg0x27); |
@@ -242,7 +243,7 @@ void lcd_set_flip(bool yesno) | |||
242 | { | 243 | { |
243 | reg0x06 = yesno ? 0x02 : 0x04; | 244 | reg0x06 = yesno ? 0x02 : 0x04; |
244 | 245 | ||
245 | if (!lcd_active()) | 246 | if (!lcd_on) |
246 | return; | 247 | return; |
247 | 248 | ||
248 | lcd_write_reg(0x06, reg0x06); | 249 | lcd_write_reg(0x06, reg0x06); |