Lines Matching refs:pwm

39 static int stmpe_24xx_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)  in stmpe_24xx_pwm_enable()  argument
48 pwm->hwpwm); in stmpe_24xx_pwm_enable()
52 value = ret | BIT(pwm->hwpwm); in stmpe_24xx_pwm_enable()
57 pwm->hwpwm); in stmpe_24xx_pwm_enable()
65 struct pwm_device *pwm) in stmpe_24xx_pwm_disable() argument
74 pwm->hwpwm); in stmpe_24xx_pwm_disable()
78 value = ret & ~BIT(pwm->hwpwm); in stmpe_24xx_pwm_disable()
83 pwm->hwpwm); in stmpe_24xx_pwm_disable()
98 static int stmpe_24xx_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, in stmpe_24xx_pwm_config() argument
112 if (pwm_is_enabled(pwm)) { in stmpe_24xx_pwm_config()
113 ret = stmpe_24xx_pwm_disable(chip, pwm); in stmpe_24xx_pwm_config()
118 pin = pwm->hwpwm; in stmpe_24xx_pwm_config()
129 pwm->hwpwm); in stmpe_24xx_pwm_config()
135 switch (pwm->hwpwm) { in stmpe_24xx_pwm_config()
154 pwm->hwpwm, duty_ns, period_ns); in stmpe_24xx_pwm_config()
193 if (pwm_is_enabled(pwm)) in stmpe_24xx_pwm_config()
194 stmpe_24xx_pwm_enable(chip, pwm); in stmpe_24xx_pwm_config()
221 pwm->hwpwm, value, last, program[0], program[1], in stmpe_24xx_pwm_config()
252 if (pwm_is_enabled(pwm)) in stmpe_24xx_pwm_config()
253 stmpe_24xx_pwm_enable(chip, pwm); in stmpe_24xx_pwm_config()
258 dev_dbg(chip->dev, "programmed PWM#%u, %u bytes\n", pwm->hwpwm, i); in stmpe_24xx_pwm_config()
263 static int stmpe_24xx_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm, in stmpe_24xx_pwm_apply() argument
272 if (pwm->state.enabled) in stmpe_24xx_pwm_apply()
273 return stmpe_24xx_pwm_disable(chip, pwm); in stmpe_24xx_pwm_apply()
278 err = stmpe_24xx_pwm_config(pwm->chip, pwm, state->duty_cycle, state->period); in stmpe_24xx_pwm_apply()
282 if (!pwm->state.enabled) in stmpe_24xx_pwm_apply()
283 err = stmpe_24xx_pwm_enable(chip, pwm); in stmpe_24xx_pwm_apply()