diff options
author | Andrew Ryabinin <ryabinin.a.a@gmail.com> | 2012-01-15 17:25:31 +0400 |
---|---|---|
committer | Andrew Ryabinin <ryabinin.a.a@gmail.com> | 2012-02-24 13:49:34 +0400 |
commit | 7b993187103c05aa87bca5393a17c3d737d2f160 (patch) | |
tree | 3b7b2f4fb91fe7585d373c60b25659a6c039ddbd /firmware/target/arm/rk27xx/lcd-hifiman.c | |
parent | cac98a5ebf89a2ab75acab10e8d81dbe5f87f65d (diff) |
HiFiMAN: Implement lcd powersave mode.
Change-Id: I0a22b436549047ac0c2f9e2c203cbe8b31cfc1cd
Diffstat (limited to 'firmware/target/arm/rk27xx/lcd-hifiman.c')
-rw-r--r-- | firmware/target/arm/rk27xx/lcd-hifiman.c | 47 |
1 files changed, 40 insertions, 7 deletions
diff --git a/firmware/target/arm/rk27xx/lcd-hifiman.c b/firmware/target/arm/rk27xx/lcd-hifiman.c index 932154da8d..91e55894e5 100644 --- a/firmware/target/arm/rk27xx/lcd-hifiman.c +++ b/firmware/target/arm/rk27xx/lcd-hifiman.c @@ -27,12 +27,7 @@ #include "cpu.h" #include "lcdif-rk27xx.h" - -/* TODO */ -static void lcd_sleep(unsigned int sleep) -{ - (void)sleep; -} +static bool display_on = false; void lcd_display_init() { @@ -110,9 +105,47 @@ void lcd_display_init() for(y=0; y<LCD_HEIGHT; y++) lcd_data(0x00); - lcd_sleep(0); + display_on = true; } +void lcd_enable (bool on) +{ + if (on) + { + lcd_write_reg(0x18, 0x44); + lcd_write_reg(0x21, 0x01); + lcd_write_reg(0x01, 0x00); + lcd_write_reg(0x1C, 0x03); + lcd_write_reg(0x19, 0x06); + udelay(5); + lcd_write_reg(0x26, 0x84); + udelay(40); + lcd_write_reg(0x26, 0xB8); + udelay(40); + lcd_write_reg(0x26, 0xBC); + } + else + { + lcd_write_reg(0x26, 0xB8); + udelay(40); + lcd_write_reg(0x19, 0x01); + udelay(40); + lcd_write_reg(0x26, 0xA4); + udelay(40); + lcd_write_reg(0x26, 0x84); + udelay(40); + lcd_write_reg(0x1C, 0x00); + lcd_write_reg(0x01, 0x02); + lcd_write_reg(0x21, 0x00); + } + display_on = on; + +} + +bool lcd_active() +{ + return display_on; +} void lcd_update_rect(int x, int y, int width, int height) |