Lines Matching refs: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 void crc_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm,
161 struct crystalcove_pwm *pwm;
165 pwm = devm_kzalloc(&pdev->dev, sizeof(*pwm), GFP_KERNEL);
166 if (!pwm)
169 pwm->chip.dev = &pdev->dev;
170 pwm->chip.ops = &crc_pwm_ops;
171 pwm->chip.base = -1;
172 pwm->chip.npwm = 1;
175 pwm->regmap = pmic->regmap;
177 platform_set_drvdata(pdev, pwm);
179 return pwmchip_add(&pwm->chip);
184 struct crystalcove_pwm *pwm = platform_get_drvdata(pdev);
186 return pwmchip_remove(&pwm->chip);