summaryrefslogtreecommitdiff
path: root/firmware/target
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2009-06-16 11:41:48 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2009-06-16 11:41:48 +0000
commit143f62e8cc2404cf6b208caca795d5b31477dd60 (patch)
tree8b7a29456150f136058c44510f7f7e21985f2f51 /firmware/target
parentd6ad019af3ebb38a026821f7c34fe1c8818f14e6 (diff)
downloadrockbox-143f62e8cc2404cf6b208caca795d5b31477dd60.tar.gz
rockbox-143f62e8cc2404cf6b208caca795d5b31477dd60.zip
Onda VX747: fix backlight driver so it doesn't 'flicker' upon init
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21310 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/mips/ingenic_jz47xx/onda_vx747/backlight-onda_vx7X7.c11
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 @@
35static int old_val; 35static int old_val;
36static void set_backlight(int val) 36static 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)
62static void set_backlight_on(void) 59static 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
70static void set_backlight_off(void) 64static 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
76bool _backlight_init(void) 70bool _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}