summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/imx233/creative-zen
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2014-06-22 12:55:41 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2014-06-24 18:07:55 +0200
commitd5591a2b28c4052c9cb7688ce09e66aa6add05bf (patch)
tree32957239734f2d44d456c51acb99864a7b67a460 /firmware/target/arm/imx233/creative-zen
parentcd4fb9ee798ccb11863aa98531852c2405bb6f8c (diff)
downloadrockbox-d5591a2b28c4052c9cb7688ce09e66aa6add05bf.tar.gz
rockbox-d5591a2b28c4052c9cb7688ce09e66aa6add05bf.zip
zen/zenxfi: switch lcd driver to 24-bit mode
Change-Id: I2c42f0e422130bcdaf1aaf92c7b56776752f4f64
Diffstat (limited to 'firmware/target/arm/imx233/creative-zen')
-rw-r--r--firmware/target/arm/imx233/creative-zen/lcd-target.h5
-rw-r--r--firmware/target/arm/imx233/creative-zen/lcd-zen.c41
-rw-r--r--firmware/target/arm/imx233/creative-zen/lcd-zenmozaic.c2
-rw-r--r--firmware/target/arm/imx233/creative-zen/lcd-zenv.c2
4 files changed, 14 insertions, 36 deletions
diff --git a/firmware/target/arm/imx233/creative-zen/lcd-target.h b/firmware/target/arm/imx233/creative-zen/lcd-target.h
index b28bda347a..299ffa3dfb 100644
--- a/firmware/target/arm/imx233/creative-zen/lcd-target.h
+++ b/firmware/target/arm/imx233/creative-zen/lcd-target.h
@@ -23,4 +23,9 @@
bool lcd_debug_screen(void);
+#if defined(CREATIVE_ZEN) || defined(CREATIVE_ZENXFI)
+#define LCD_FRAMEBUF_ADDR(col, row) (row*LCD_WIDTH + col + (fb_data *)FRAME)
+extern void lcd_set_active(bool active);
+#endif
+
#endif /* LCD_TARGET_H */
diff --git a/firmware/target/arm/imx233/creative-zen/lcd-zen.c b/firmware/target/arm/imx233/creative-zen/lcd-zen.c
index 6482c58787..c594209db9 100644
--- a/firmware/target/arm/imx233/creative-zen/lcd-zen.c
+++ b/firmware/target/arm/imx233/creative-zen/lcd-zen.c
@@ -30,16 +30,14 @@
#include "clkctrl-imx233.h"
#include "pinctrl-imx233.h"
#include "dma-imx233.h"
-#include "regs/regs-uartdbg.h"
#include "logf.h"
+#include "lcd-target.h"
#ifndef BOOTLOADER
#include "button.h"
#include "font.h"
#include "action.h"
#endif
-static bool lcd_on;
-
/**
* DMA
*/
@@ -170,7 +168,7 @@ static void lcd_power_seq(void)
static void lcd_init_seq(void)
{
/* NOTE I don't understand why I have to use BGR, logic would say I should not */
- spi_write_reg(0x1, 0x2b1d);// inversion
+ spi_write_reg(0x1, 0x231d);// no inversion
spi_write_reg(0x2, 0x300);
/* NOTE by default stmp3700 has vsync/hsync active low and data launch
* at negative edge of dotclk, reflect this in the polarity settings */
@@ -225,18 +223,13 @@ static void lcd_display_off_seq(void)
* Rockbox
*/
-bool lcd_active(void)
-{
- return lcd_on;
-}
-
void lcd_enable(bool enable)
{
- if(lcd_on == enable)
+ if(lcd_active() == enable)
return;
- lcd_on = enable;
- if(lcd_on)
+ lcd_set_active(enable);
+ if(lcd_active())
{
// enable spi
spi_enable(true);
@@ -341,27 +334,3 @@ void lcd_init_device(void)
// enable
lcd_enable(true);
}
-
-void lcd_update(void)
-{
- lcd_update_rect(0, 0, LCD_WIDTH, LCD_HEIGHT);
-}
-
-void lcd_update_rect(int x, int y, int w, int h)
-{
- #ifdef HAVE_LCD_ENABLE
- if(!lcd_on)
- return;
- #endif
- for(int yy = y; yy < y + h; yy++)
- {
- uint16_t *pix = FBADDR(x, yy);
- uint8_t *p = 3 * (yy * LCD_WIDTH + x) + (uint8_t *)FRAME;
- for(int xx = 0; xx < w; xx++, pix++)
- {
- *p++ = RGB_UNPACK_RED(*pix);
- *p++ = RGB_UNPACK_GREEN(*pix);
- *p++ = RGB_UNPACK_BLUE(*pix);
- }
- }
-}
diff --git a/firmware/target/arm/imx233/creative-zen/lcd-zenmozaic.c b/firmware/target/arm/imx233/creative-zen/lcd-zenmozaic.c
index eac36676ae..c1bc379a49 100644
--- a/firmware/target/arm/imx233/creative-zen/lcd-zenmozaic.c
+++ b/firmware/target/arm/imx233/creative-zen/lcd-zenmozaic.c
@@ -127,6 +127,8 @@ void lcd_enable(bool enable)
return;
lcd_on = enable;
+ if(enable)
+ send_event(LCD_EVENT_ACTIVATION, NULL);
}
#endif
diff --git a/firmware/target/arm/imx233/creative-zen/lcd-zenv.c b/firmware/target/arm/imx233/creative-zen/lcd-zenv.c
index 3bc8e67e5d..06b0f158f3 100644
--- a/firmware/target/arm/imx233/creative-zen/lcd-zenv.c
+++ b/firmware/target/arm/imx233/creative-zen/lcd-zenv.c
@@ -138,6 +138,8 @@ void lcd_enable(bool enable)
return;
lcd_on = enable;
+ if(enable)
+ send_event(LCD_EVENT_ACTIVATION, NULL);
}
#endif