summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/imx233/creative-zenxfi2/backlight-zenxfi2.c
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2013-06-16 20:15:32 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2013-06-17 00:29:24 +0200
commitf8d298487596fd48366ab9444dfbc85d705b7a29 (patch)
treea32dd3cc676f41eb414a2604efb34437938245f5 /firmware/target/arm/imx233/creative-zenxfi2/backlight-zenxfi2.c
parentf5ac658d160d11880c2affa9c5b669404c4fe207 (diff)
downloadrockbox-f8d298487596fd48366ab9444dfbc85d705b7a29.tar.gz
rockbox-f8d298487596fd48366ab9444dfbc85d705b7a29.tar.bz2
rockbox-f8d298487596fd48366ab9444dfbc85d705b7a29.zip
imx233: enhance pwm
The current pwm interface is too low-level. Introduce a higher level setup function which directly computes the parameters from the required frequency. Change-Id: Ie95c7522e9f42492fe872203f4cab46770a9649a
Diffstat (limited to 'firmware/target/arm/imx233/creative-zenxfi2/backlight-zenxfi2.c')
-rw-r--r--firmware/target/arm/imx233/creative-zenxfi2/backlight-zenxfi2.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/firmware/target/arm/imx233/creative-zenxfi2/backlight-zenxfi2.c b/firmware/target/arm/imx233/creative-zenxfi2/backlight-zenxfi2.c
index 3322098fa2..b01dc36063 100644
--- a/firmware/target/arm/imx233/creative-zenxfi2/backlight-zenxfi2.c
+++ b/firmware/target/arm/imx233/creative-zenxfi2/backlight-zenxfi2.c
@@ -28,10 +28,8 @@
void _backlight_set_brightness(int brightness)
{
- imx233_pwm_setup_channel(4, 1024, BV_PWM_PERIODn_CDIV__DIV_1,
- 0, BV_PWM_PERIODn_ACTIVE_STATE__1,
- (brightness * 1024) / 100, BV_PWM_PERIODn_INACTIVE_STATE__0);
- imx233_pwm_enable_channel(4, true);
+ imx233_pwm_setup_simple(4, 24000, brightness);
+ imx233_pwm_enable(4, true);
}
bool _backlight_init(void)