Lines Matching defs:pwm
13 #include <linux/pwm.h>
46 static int cros_ec_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm)
54 pwm_set_chip_data(pwm, channel);
59 static void cros_ec_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm)
61 struct cros_ec_pwm *channel = pwm_get_chip_data(pwm);
157 static int cros_ec_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
161 struct cros_ec_pwm *channel = pwm_get_chip_data(pwm);
178 ret = cros_ec_pwm_set_duty(ec_pwm, pwm->hwpwm, duty_cycle);
187 static int cros_ec_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm,
191 struct cros_ec_pwm *channel = pwm_get_chip_data(pwm);
194 ret = cros_ec_pwm_get_duty(ec_pwm, pwm->hwpwm);
224 struct pwm_device *pwm;
229 pwm = pwm_request_from_chip(chip, args->args[0], NULL);
230 if (IS_ERR(pwm))
231 return pwm;
234 pwm->args.period = EC_PWM_MAX_DUTY;
236 return pwm;
249 * of PWMs it supports directly, so we have to read the pwm duty cycle for
300 if (of_device_is_compatible(np, "google,cros-ec-pwm-type"))
343 { .compatible = "google,cros-ec-pwm" },
344 { .compatible = "google,cros-ec-pwm-type" },
354 .name = "cros-ec-pwm",
360 MODULE_ALIAS("platform:cros-ec-pwm");