diff options
Diffstat (limited to 'firmware')
-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 |