Lines Matching defs:pwm
18 #include <linux/pwm.h>
48 /* This value is valid iff a pwm is running */
89 static int fsl_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm)
97 regmap_update_bits(fpc->regmap, FTM_SC, BIT(pwm->hwpwm + 16),
98 BIT(pwm->hwpwm + 16));
105 static void fsl_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm)
111 regmap_update_bits(fpc->regmap, FTM_SC, BIT(pwm->hwpwm + 16),
205 struct pwm_device *pwm)
217 struct pwm_device *pwm)
222 if (~(val | BIT(pwm->hwpwm)) & 0xFF)
229 struct pwm_device *pwm,
243 if (!fsl_pwm_is_any_pwm_enabled(fpc, pwm))
249 * we allow to change the period only if no other pwm is running.
252 if (fsl_pwm_is_other_pwm_enabled(fpc, pwm)) {
255 pwm->hwpwm);
285 regmap_write(fpc->regmap, FTM_CSC(pwm->hwpwm),
287 regmap_write(fpc->regmap, FTM_CV(pwm->hwpwm), duty);
291 reg_polarity = BIT(pwm->hwpwm);
293 regmap_update_bits(fpc->regmap, FTM_POL, BIT(pwm->hwpwm), reg_polarity);
300 static int fsl_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
304 struct pwm_state *oldstate = &pwm->state;
321 BIT(pwm->hwpwm), BIT(pwm->hwpwm));
329 ret = fsl_pwm_apply_config(fpc, pwm, newstate);
345 regmap_update_bits(fpc->regmap, FTM_OUTMASK, BIT(pwm->hwpwm),
489 struct pwm_device *pwm = &fpc->chip.pwms[i];
491 if (!test_bit(PWMF_REQUESTED, &pwm->flags))
496 if (!pwm_is_enabled(pwm))
512 struct pwm_device *pwm = &fpc->chip.pwms[i];
514 if (!test_bit(PWMF_REQUESTED, &pwm->flags))
519 if (!pwm_is_enabled(pwm))
547 { .compatible = "fsl,vf610-ftm-pwm", .data = &vf610_ftm_pwm },
548 { .compatible = "fsl,imx8qm-ftm-pwm", .data = &imx8qm_ftm_pwm },
555 .name = "fsl-ftm-pwm",
566 MODULE_ALIAS("platform:fsl-ftm-pwm");