summaryrefslogtreecommitdiff
path: root/firmware/backlight.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/backlight.c')
-rw-r--r--firmware/backlight.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/firmware/backlight.c b/firmware/backlight.c
index 291c5da..d118830 100644
--- a/firmware/backlight.c
+++ b/firmware/backlight.c
@@ -30,6 +30,10 @@
#include "timer.h"
#include "backlight.h"
+#ifdef HAVE_BACKLIGHT_BRIGHTNESS
+#include "pcf50606.h" /* iRiver brightness */
+#endif
+
#if CONFIG_BACKLIGHT == BL_IRIVER_H300
#include "lcd.h" /* for lcd_enable() */
#endif
@@ -538,3 +542,13 @@ void remote_backlight_set_timeout(int index) {(void)index;}
#endif
#endif /* #ifdef CONFIG_BACKLIGHT */
+#ifdef HAVE_BACKLIGHT_BRIGHTNESS
+void backlight_set_brightness(int val)
+{
+ /* set H300 brightness by changing the PWM
+ accepts 0..15 but note that 0 and 1 give a black display! */
+ unsigned char ucVal = (unsigned char)(val & 0x0F);
+ pcf50606_set_bl_pwm(ucVal);
+}
+#endif
+