From 9aabfcbadeb01a73f5d05bf98c03adaf86a90294 Mon Sep 17 00:00:00 2001 From: funman Date: Tue, 20 Jul 2010 05:55:32 +0000 Subject: [PATCH] buttonlight for new fuzev2 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27501 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/as3525/sansa-fuzev2/backlight-fuzev2.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/firmware/target/arm/as3525/sansa-fuzev2/backlight-fuzev2.c b/firmware/target/arm/as3525/sansa-fuzev2/backlight-fuzev2.c index 6797903ba..eebe9b945 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 */ + } } -- 2.11.4.GIT