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
This commit is contained in:
Amaury Pouly 2013-06-16 20:08:49 +02:00
parent 84fc327aeb
commit f5ac658d16
12 changed files with 154 additions and 245 deletions

View file

@ -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));