diff options
Diffstat (limited to 'firmware/target/mips/ingenic_jz47xx/onda_vx747/backlight-onda_vx7X7.c')
-rw-r--r-- | firmware/target/mips/ingenic_jz47xx/onda_vx747/backlight-onda_vx7X7.c | 11 |
1 files changed, 2 insertions, 9 deletions
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 f2ef3f7dc1..e59f1812c1 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 | |||
@@ -35,9 +35,6 @@ | |||
35 | static int old_val; | 35 | static int old_val; |
36 | static void set_backlight(int val) | 36 | static void set_backlight(int val) |
37 | { | 37 | { |
38 | if(val == old_val) | ||
39 | return; | ||
40 | |||
41 | /* The pulse repetition frequency should be greater than 100Hz so | 38 | /* The pulse repetition frequency should be greater than 100Hz so |
42 | the flickering is not perceptible to the human eye but | 39 | the flickering is not perceptible to the human eye but |
43 | not greater than about 1kHz. */ | 40 | not greater than about 1kHz. */ |
@@ -62,15 +59,12 @@ static void set_backlight(int val) | |||
62 | static void set_backlight_on(void) | 59 | static void set_backlight_on(void) |
63 | { | 60 | { |
64 | set_backlight(old_val); | 61 | set_backlight(old_val); |
65 | |||
66 | __tcu_enable_pwm_output(BACKLIGHT_PWM); | ||
67 | __tcu_start_counter(BACKLIGHT_PWM); | ||
68 | } | 62 | } |
69 | 63 | ||
70 | static void set_backlight_off(void) | 64 | static void set_backlight_off(void) |
71 | { | 65 | { |
72 | __tcu_stop_counter(BACKLIGHT_PWM); | ||
73 | __tcu_disable_pwm_output(BACKLIGHT_PWM); | 66 | __tcu_disable_pwm_output(BACKLIGHT_PWM); |
67 | __tcu_stop_counter(BACKLIGHT_PWM); | ||
74 | } | 68 | } |
75 | 69 | ||
76 | bool _backlight_init(void) | 70 | bool _backlight_init(void) |
@@ -81,7 +75,7 @@ bool _backlight_init(void) | |||
81 | __tcu_stop_counter(BACKLIGHT_PWM); | 75 | __tcu_stop_counter(BACKLIGHT_PWM); |
82 | __tcu_init_pwm_output_low(BACKLIGHT_PWM); | 76 | __tcu_init_pwm_output_low(BACKLIGHT_PWM); |
83 | __tcu_set_pwm_output_shutdown_graceful(BACKLIGHT_PWM); | 77 | __tcu_set_pwm_output_shutdown_graceful(BACKLIGHT_PWM); |
84 | __tcu_enable_pwm_output(BACKLIGHT_PWM); | 78 | __tcu_disable_pwm_output(BACKLIGHT_PWM); |
85 | 79 | ||
86 | __tcu_select_rtcclk(BACKLIGHT_PWM); /* 32.768 kHz */ | 80 | __tcu_select_rtcclk(BACKLIGHT_PWM); /* 32.768 kHz */ |
87 | __tcu_select_clk_div1(BACKLIGHT_PWM); | 81 | __tcu_select_clk_div1(BACKLIGHT_PWM); |
@@ -90,7 +84,6 @@ bool _backlight_init(void) | |||
90 | __tcu_mask_full_match_irq(BACKLIGHT_PWM); | 84 | __tcu_mask_full_match_irq(BACKLIGHT_PWM); |
91 | 85 | ||
92 | old_val = MAX_BRIGHTNESS_SETTING; | 86 | old_val = MAX_BRIGHTNESS_SETTING; |
93 | set_backlight_on(); | ||
94 | 87 | ||
95 | return true; | 88 | return true; |
96 | } | 89 | } |