summaryrefslogtreecommitdiff
path: root/firmware/target/coldfire/iriver/h300
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2006-11-10 01:25:52 +0000
committerMichael Sevakis <jethead71@rockbox.org>2006-11-10 01:25:52 +0000
commitcf59a4fc1d21c2a1d6cfc019f97268275d4a8581 (patch)
treea00e4a8e6d6c993b4195c0e2291d3cbf93312989 /firmware/target/coldfire/iriver/h300
parentf64f589d2efeb2749314bb9f91523b4555ded2d5 (diff)
H300/X5: Moved backlight brightness code to target tree. Created __backlight_set_brightness in backlight-(target).c. backlight_set_brightness range clamps and calls the backlight driver.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11488 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/coldfire/iriver/h300')
-rw-r--r--firmware/target/coldfire/iriver/h300/backlight-h300.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/firmware/target/coldfire/iriver/h300/backlight-h300.c b/firmware/target/coldfire/iriver/h300/backlight-h300.c
index d5322c2cf7..50bd757612 100644
--- a/firmware/target/coldfire/iriver/h300/backlight-h300.c
+++ b/firmware/target/coldfire/iriver/h300/backlight-h300.c
@@ -38,6 +38,16 @@ void __backlight_off(void)
lcd_enable(false);
}
+/* set brightness by changing the PWM */
+void __backlight_set_brightness(int val)
+{
+ /* disable IRQs while bitbanging */
+ int old_irq_level = set_irq_level(HIGHEST_IRQ_LEVEL);
+ pcf50606_write(0x35, (val << 1) | 0x01); /* 512Hz, Enable PWM */
+ /* enable IRQs again */
+ set_irq_level(old_irq_level);
+}
+
void __remote_backlight_on(void)
{
and_l(~0x00000002, &GPIO1_OUT);