summaryrefslogtreecommitdiff
path: root/firmware/backlight.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/backlight.c')
-rw-r--r--firmware/backlight.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/firmware/backlight.c b/firmware/backlight.c
index 25a91632cd..5e79e4e479 100644
--- a/firmware/backlight.c
+++ b/firmware/backlight.c
@@ -547,13 +547,29 @@ void remote_backlight_set_timeout(int index) {(void)index;}
547#endif /* #ifdef CONFIG_BACKLIGHT */ 547#endif /* #ifdef CONFIG_BACKLIGHT */
548 548
549#ifdef HAVE_BACKLIGHT_BRIGHTNESS 549#ifdef HAVE_BACKLIGHT_BRIGHTNESS
550#ifdef IRIVER_H300_SERIES
550void backlight_set_brightness(int val) 551void backlight_set_brightness(int val)
551{ 552{
552 /* set H300 brightness by changing the PWM 553 /* set H300 brightness by changing the PWM
553 accepts 0..15 but note that 0 and 1 gives a black display! */ 554 accepts 0..15 but note that 0 and 1 give a black display! */
554 if(val < MIN_BRIGHTNESS_SETTING) 555 val &= 0x0F;
555 val = MIN_BRIGHTNESS_SETTING; 556 if(val<MIN_BRIGHTNESS_SETTING)
556 pcf50606_set_bl_pwm(val & 0xf); 557 val=MIN_BRIGHTNESS_SETTING;
558
559 /* shift one bit left */
560 val <<= 1;
561
562 /* enable PWM */
563 val |= 0x01;
564
565 /* disable IRQs while bitbanging */
566 int old_irq_level = set_irq_level(HIGHEST_IRQ_LEVEL);
567
568 pcf50606_write(0x35, val);
569
570 /* enable IRQs again */
571 set_irq_level(old_irq_level);
557} 572}
558#endif 573#endif
574#endif
559 575