Lines Matching refs:pwm_id
15 int pwm_enable(int pwm_id) in pwm_enable() argument
26 tcon |= TCON_START(pwm_id); in pwm_enable()
33 void pwm_disable(int pwm_id) in pwm_disable() argument
44 tcon &= ~TCON_START(pwm_id); in pwm_disable()
49 static unsigned long pwm_calc_tin(int pwm_id, unsigned long freq) in pwm_calc_tin() argument
70 if (pwm_id < 2) in pwm_calc_tin()
77 val = (val >> MUX_DIV_SHIFT(pwm_id)) & 0xF; in pwm_calc_tin()
95 int pwm_config(int pwm_id, int duty_ns, int period_ns) in pwm_config() argument
125 tin_rate = pwm_calc_tin(pwm_id, frequency); in pwm_config()
140 offset = pwm_id * 3; in pwm_config()
141 if (pwm_id < 4) { in pwm_config()
147 tcon |= TCON_UPDATE(pwm_id); in pwm_config()
148 if (pwm_id < 4) in pwm_config()
149 tcon |= TCON_AUTO_RELOAD(pwm_id); in pwm_config()
154 tcon &= ~TCON_UPDATE(pwm_id); in pwm_config()
160 int pwm_init(int pwm_id, int div, int invert) in pwm_init() argument
178 if (pwm_id < 2) { in pwm_init()
189 val &= ~(0xf << MUX_DIV_SHIFT(pwm_id)); in pwm_init()
190 val |= (div & 0xf) << MUX_DIV_SHIFT(pwm_id); in pwm_init()
193 if (pwm_id == 4) { in pwm_init()
213 offset = pwm_id * 3; in pwm_init()
217 val = readl(&pwm->tcon) & ~(0xf << TCON_OFFSET(pwm_id)); in pwm_init()
218 if (invert && (pwm_id < 4)) in pwm_init()
219 val |= TCON_INVERTER(pwm_id); in pwm_init()
222 pwm_enable(pwm_id); in pwm_init()