Lines Matching defs:pwm
11 #include <linux/pwm.h>
54 static int crc_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
69 if (pwm_is_enabled(pwm) && !state->enabled) {
77 if (pwm_get_duty_cycle(pwm) != state->duty_cycle ||
78 pwm_get_period(pwm) != state->period) {
90 if (pwm_is_enabled(pwm) && state->enabled &&
91 pwm_get_period(pwm) != state->period) {
100 if (pwm_get_period(pwm) != state->period ||
101 pwm_is_enabled(pwm) != state->enabled) {
113 if (!pwm_is_enabled(pwm) && state->enabled) {
124 static int crc_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm,
163 struct crystalcove_pwm *pwm;
167 pwm = devm_kzalloc(&pdev->dev, sizeof(*pwm), GFP_KERNEL);
168 if (!pwm)
171 pwm->chip.dev = &pdev->dev;
172 pwm->chip.ops = &crc_pwm_ops;
173 pwm->chip.npwm = 1;
176 pwm->regmap = pmic->regmap;
178 return devm_pwmchip_add(&pdev->dev, &pwm->chip);