Lines Matching refs:ec_pwm
80 static int cros_ec_pwm_set_duty(struct cros_ec_pwm_device *ec_pwm, u8 index, in cros_ec_pwm_set_duty() argument
83 struct cros_ec_device *ec = ec_pwm->ec; in cros_ec_pwm_set_duty()
101 if (ec_pwm->use_pwm_type) { in cros_ec_pwm_set_duty()
116 static int cros_ec_pwm_get_duty(struct cros_ec_pwm_device *ec_pwm, u8 index) in cros_ec_pwm_get_duty() argument
118 struct cros_ec_device *ec = ec_pwm->ec; in cros_ec_pwm_get_duty()
138 if (ec_pwm->use_pwm_type) { in cros_ec_pwm_get_duty()
160 struct cros_ec_pwm_device *ec_pwm = pwm_to_cros_ec_pwm(chip); in cros_ec_pwm_apply() local
178 ret = cros_ec_pwm_set_duty(ec_pwm, pwm->hwpwm, duty_cycle); in cros_ec_pwm_apply()
190 struct cros_ec_pwm_device *ec_pwm = pwm_to_cros_ec_pwm(chip); in cros_ec_pwm_get_state() local
194 ret = cros_ec_pwm_get_duty(ec_pwm, pwm->hwpwm); in cros_ec_pwm_get_state()
252 static int cros_ec_num_pwms(struct cros_ec_pwm_device *ec_pwm) in cros_ec_num_pwms() argument
258 ret = cros_ec_pwm_get_duty(ec_pwm, i); in cros_ec_num_pwms()
285 struct cros_ec_pwm_device *ec_pwm; in cros_ec_pwm_probe() local
294 ec_pwm = devm_kzalloc(dev, sizeof(*ec_pwm), GFP_KERNEL); in cros_ec_pwm_probe()
295 if (!ec_pwm) in cros_ec_pwm_probe()
297 chip = &ec_pwm->chip; in cros_ec_pwm_probe()
298 ec_pwm->ec = ec; in cros_ec_pwm_probe()
301 ec_pwm->use_pwm_type = true; in cros_ec_pwm_probe()
309 if (ec_pwm->use_pwm_type) { in cros_ec_pwm_probe()
312 ret = cros_ec_num_pwms(ec_pwm); in cros_ec_pwm_probe()
328 platform_set_drvdata(pdev, ec_pwm); in cros_ec_pwm_probe()
335 struct cros_ec_pwm_device *ec_pwm = platform_get_drvdata(dev); in cros_ec_pwm_remove() local
336 struct pwm_chip *chip = &ec_pwm->chip; in cros_ec_pwm_remove()