summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/imx233/pwm-imx233.c
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2013-06-16 20:08:49 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2013-06-17 00:29:24 +0200
commitf5ac658d160d11880c2affa9c5b669404c4fe207 (patch)
tree120f5e132430ea032d12d765fc6f407c020a908e /firmware/target/arm/imx233/pwm-imx233.c
parent84fc327aeb7be91e611520bb058a6c8d318401c3 (diff)
downloadrockbox-f5ac658d160d11880c2affa9c5b669404c4fe207.tar.gz
rockbox-f5ac658d160d11880c2affa9c5b669404c4fe207.tar.bz2
rockbox-f5ac658d160d11880c2affa9c5b669404c4fe207.zip
imx233: normalise clkctrl
The clkctrl functions were becoming a mess. Normalise the names, get rid of the xtal derived as special case and use the same interface. Change-Id: Ib954a8d30a6bd691914b5e0d97774ec9fc560c50
Diffstat (limited to 'firmware/target/arm/imx233/pwm-imx233.c')
-rw-r--r--firmware/target/arm/imx233/pwm-imx233.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/firmware/target/arm/imx233/pwm-imx233.c b/firmware/target/arm/imx233/pwm-imx233.c
index 00aba9320e..c434338a07 100644
--- a/firmware/target/arm/imx233/pwm-imx233.c
+++ b/firmware/target/arm/imx233/pwm-imx233.c
@@ -25,7 +25,7 @@
void imx233_pwm_init(void)
{
imx233_reset_block(&HW_PWM_CTRL);
- imx233_clkctrl_enable_xtal(XTAM_PWM, true);
+ imx233_clkctrl_enable(CLK_PWM, true);
}
bool imx233_pwm_is_channel_enable(int channel)
@@ -50,7 +50,8 @@ void imx233_pwm_setup_channel(int channel, int period, int cdiv, int active,
imx233_pwm_enable_channel(channel, false);
/* setup pin */
imx233_pinctrl_setup_vpin(VPIN_PWM(channel), "pwm", PINCTRL_DRIVE_4mA, false);
- /* watch the order ! active THEN period */
+ /* watch the order ! active THEN period
+ * NOTE: the register value is period-1 */
HW_PWM_ACTIVEn(channel) = BF_OR2(PWM_ACTIVEn, ACTIVE(active), INACTIVE(inactive));
HW_PWM_PERIODn(channel) = BF_OR4(PWM_PERIODn, PERIOD(period - 1),
ACTIVE_STATE(active_state), INACTIVE_STATE(inactive_state), CDIV(cdiv));