diff options
author | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2010-01-03 15:57:09 +0000 |
---|---|---|
committer | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2010-01-03 15:57:09 +0000 |
commit | 4fdf4ad728ac93336c850c7da8966e8d00bddbf8 (patch) | |
tree | f571a9f2f5049d7da50e614a51c968539b3d30e3 | |
parent | 5313bf52b54c7a02222b1787f8432f43a76e0056 (diff) | |
download | rockbox-4fdf4ad728ac93336c850c7da8966e8d00bddbf8.tar.gz rockbox-4fdf4ad728ac93336c850c7da8966e8d00bddbf8.zip |
Onda VX747/VX777: disable LCD when backlight is off (saves power)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24167 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/target/mips/ingenic_jz47xx/lcd-jz4740.c | 13 | ||||
-rw-r--r-- | firmware/target/mips/ingenic_jz47xx/onda_vx747/backlight-onda_vx7X7.c | 9 |
2 files changed, 18 insertions, 4 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/lcd-jz4740.c b/firmware/target/mips/ingenic_jz47xx/lcd-jz4740.c index 99ffcf2981..7561d593db 100644 --- a/firmware/target/mips/ingenic_jz47xx/lcd-jz4740.c +++ b/firmware/target/mips/ingenic_jz47xx/lcd-jz4740.c | |||
@@ -49,20 +49,27 @@ void lcd_init_device(void) | |||
49 | system_enable_irq(DMA_IRQ(DMA_LCD_CHANNEL)); | 49 | system_enable_irq(DMA_IRQ(DMA_LCD_CHANNEL)); |
50 | } | 50 | } |
51 | 51 | ||
52 | #ifdef HAVE_LCD_ENABLE | ||
52 | void lcd_enable(bool state) | 53 | void lcd_enable(bool state) |
53 | { | 54 | { |
55 | if(lcd_is_on == state) | ||
56 | return; | ||
57 | |||
58 | __cpm_start_lcd(); | ||
59 | |||
54 | if(state) | 60 | if(state) |
55 | { | 61 | { |
56 | lcd_on(); | 62 | lcd_on(); |
57 | #ifdef HAVE_LCD_ENABLE | ||
58 | send_event(LCD_EVENT_ACTIVATION, NULL); | 63 | send_event(LCD_EVENT_ACTIVATION, NULL); |
59 | #endif | ||
60 | } | 64 | } |
61 | else | 65 | else |
62 | lcd_off(); | 66 | lcd_off(); |
63 | 67 | ||
68 | __cpm_stop_lcd(); | ||
69 | |||
64 | lcd_is_on = state; | 70 | lcd_is_on = state; |
65 | } | 71 | } |
72 | #endif | ||
66 | 73 | ||
67 | bool lcd_active(void) | 74 | bool lcd_active(void) |
68 | { | 75 | { |
diff --git a/firmware/target/mips/ingenic_jz47xx/onda_vx747/backlight-onda_vx7X7.c b/firmware/target/mips/ingenic_jz47xx/onda_vx747/backlight-onda_vx7X7.c index 315432ef6b..7f834129b3 100644 --- a/firmware/target/mips/ingenic_jz47xx/onda_vx747/backlight-onda_vx7X7.c +++ b/firmware/target/mips/ingenic_jz47xx/onda_vx747/backlight-onda_vx7X7.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include "config.h" | 22 | #include "config.h" |
23 | #include "jz4740.h" | 23 | #include "jz4740.h" |
24 | #include "backlight-target.h" | 24 | #include "backlight-target.h" |
25 | #include "lcd.h" | ||
25 | 26 | ||
26 | /* PWM_CHN7 == GPIO(32*3 + 31) */ | 27 | /* PWM_CHN7 == GPIO(32*3 + 31) */ |
27 | #define BACKLIGHT_GPIO (32*3+31) | 28 | #define BACKLIGHT_GPIO (32*3+31) |
@@ -89,12 +90,18 @@ bool _backlight_init(void) | |||
89 | 90 | ||
90 | void _backlight_on(void) | 91 | void _backlight_on(void) |
91 | { | 92 | { |
93 | #ifdef HAVE_LCD_ENABLE | ||
94 | lcd_enable(true); /* power on lcd */ | ||
95 | #endif | ||
92 | set_backlight_on(); | 96 | set_backlight_on(); |
93 | } | 97 | } |
94 | 98 | ||
95 | void _backlight_off(void) | 99 | void _backlight_off(void) |
96 | { | 100 | { |
97 | set_backlight_off(); | 101 | set_backlight_off(); |
102 | #ifdef HAVE_LCD_ENABLE | ||
103 | lcd_enable(false); /* power off lcd */ | ||
104 | #endif | ||
98 | } | 105 | } |
99 | 106 | ||
100 | #ifdef HAVE_BACKLIGHT_BRIGHTNESS | 107 | #ifdef HAVE_BACKLIGHT_BRIGHTNESS |
@@ -108,6 +115,6 @@ void _backlight_set_brightness(int brightness) | |||
108 | /* Turn off LED supply */ | 115 | /* Turn off LED supply */ |
109 | void _backlight_lcd_sleep(void) | 116 | void _backlight_lcd_sleep(void) |
110 | { | 117 | { |
111 | set_backlight_off(); | 118 | _backlight_off(); |
112 | } | 119 | } |
113 | #endif | 120 | #endif |