From 95e6043d5e256df72c20db39c3be59a3ba977b19 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Fri, 16 Dec 2011 23:40:39 +0000 Subject: 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 --- firmware/target/arm/imx31/gigabeat-s/lcd-gigabeat-s.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'firmware/target/arm/imx31/gigabeat-s/lcd-gigabeat-s.c') 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 @@ #include "spi-imx31.h" #include "mc13783.h" -extern void lcd_set_active(bool active); - #define MAIN_LCD_IDMAC_CHANNEL 14 +extern bool lcd_on; /* lcd-memframe.c */ static bool lcd_powered = true; /* Settings shadow regs */ @@ -171,6 +170,8 @@ void INIT_ATTR lcd_init_device(void) IPU_IPU_IMA_ADDR = ((0x1 << 16) | (MAIN_LCD_IDMAC_CHANNEL << 4)) + (1 << 3); IPU_IPU_IMA_DATA = FRAME_PHYS_ADDR; + lcd_on = true; + lcd_enable_interface(true); lcd_sync_settings(); } @@ -188,7 +189,7 @@ void lcd_sleep(void) void lcd_enable(bool state) { - if (state == lcd_active()) + if (state == lcd_on) return; if (state) @@ -198,13 +199,13 @@ void lcd_enable(bool state) IPU_IDMAC_CHA_EN |= 1ul << MAIN_LCD_IDMAC_CHANNEL; lcd_sync_settings(); sleep(HZ/50); - lcd_set_active(true); + lcd_on = true; lcd_update(); send_event(LCD_EVENT_ACTIVATION, NULL); } else { - lcd_set_active(false); + lcd_on = false; } } @@ -213,7 +214,7 @@ void lcd_set_contrast(int val) { reg0x0b = val & 0x3f; - if (!lcd_active()) + if (!lcd_on) return; lcd_write_reg(0x0b, reg0x0b); @@ -230,7 +231,7 @@ void lcd_set_invert_display(bool yesno) { reg0x27 = yesno ? 0x10 : 0x00; - if (!lcd_active()) + if (!lcd_on) return; lcd_write_reg(0x27, reg0x27); @@ -242,7 +243,7 @@ void lcd_set_flip(bool yesno) { reg0x06 = yesno ? 0x02 : 0x04; - if (!lcd_active()) + if (!lcd_on) return; lcd_write_reg(0x06, reg0x06); -- cgit v1.2.3