From f5ac658d160d11880c2affa9c5b669404c4fe207 Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Sun, 16 Jun 2013 20:08:49 +0200 Subject: 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 --- firmware/target/arm/imx233/pwm-imx233.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'firmware/target/arm/imx233/pwm-imx233.c') 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)); -- cgit