summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-07-20 05:55:32 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-07-20 05:55:32 +0000
commited616c604a1e9a4cbd201aacaa7182d8f7174393 (patch)
tree3b409f0affcf902cf8a742bd8cd6ff269486f8da /firmware
parentc6b838695ccd141596140dfc9612a1fb07c1c832 (diff)
downloadrockbox-ed616c604a1e9a4cbd201aacaa7182d8f7174393.tar.gz
rockbox-ed616c604a1e9a4cbd201aacaa7182d8f7174393.tar.bz2
rockbox-ed616c604a1e9a4cbd201aacaa7182d8f7174393.zip
buttonlight for new fuzev2
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27501 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/target/arm/as3525/sansa-fuzev2/backlight-fuzev2.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/firmware/target/arm/as3525/sansa-fuzev2/backlight-fuzev2.c b/firmware/target/arm/as3525/sansa-fuzev2/backlight-fuzev2.c
index 6797903ba9..eebe9b945f 100644
--- a/firmware/target/arm/as3525/sansa-fuzev2/backlight-fuzev2.c
+++ b/firmware/target/arm/as3525/sansa-fuzev2/backlight-fuzev2.c
@@ -38,6 +38,10 @@ bool _backlight_init(void)
ascodec_write_pmu(AS3543_BACKLIGHT, 1, 0x80);
ascodec_write_pmu(AS3543_BACKLIGHT, 2, backlight_brightness * 10);
+ /* needed for button light */
+ if (fuzev2_variant == 1)
+ ascodec_write_pmu(0x1a, 1, 0x30); /* MUX_PWGD = PWM */
+
return true;
}
@@ -65,6 +69,10 @@ void _buttonlight_on(void)
GPIOB_PIN(5) = (1<<5);
buttonlight_is_on = 1;
}
+ else
+ {
+ ascodec_write_pmu(0x1a, 6, 0x80); /* PWM inverted */
+ }
}
void _buttonlight_off(void)
@@ -75,4 +83,8 @@ void _buttonlight_off(void)
GPIOB_DIR &= ~(1<<5);
buttonlight_is_on = 0;
}
+ else
+ {
+ ascodec_write_pmu(0x1a, 6, 0); /* PWM not inverted */
+ }
}