Lines Matching refs:pwm

15 #include <linux/pwm.h>
19 struct pwm_device *pwm;
33 return export->pwm;
40 const struct pwm_device *pwm = child_to_pwm_device(child);
43 pwm_get_state(pwm, &state);
53 struct pwm_device *pwm = export->pwm;
63 pwm_get_state(pwm, &state);
65 ret = pwm_apply_state(pwm, &state);
75 const struct pwm_device *pwm = child_to_pwm_device(child);
78 pwm_get_state(pwm, &state);
88 struct pwm_device *pwm = export->pwm;
98 pwm_get_state(pwm, &state);
100 ret = pwm_apply_state(pwm, &state);
110 const struct pwm_device *pwm = child_to_pwm_device(child);
113 pwm_get_state(pwm, &state);
123 struct pwm_device *pwm = export->pwm;
133 pwm_get_state(pwm, &state);
147 ret = pwm_apply_state(pwm, &state);
158 const struct pwm_device *pwm = child_to_pwm_device(child);
162 pwm_get_state(pwm, &state);
182 struct pwm_device *pwm = export->pwm;
195 pwm_get_state(pwm, &state);
197 ret = pwm_apply_state(pwm, &state);
207 struct pwm_device *pwm = child_to_pwm_device(child);
211 ret = pwm_capture(pwm, &result, jiffies_to_msecs(HZ));
232 ATTRIBUTE_GROUPS(pwm);
241 static int pwm_export_child(struct device *parent, struct pwm_device *pwm)
247 if (test_and_set_bit(PWMF_EXPORTED, &pwm->flags))
252 clear_bit(PWMF_EXPORTED, &pwm->flags);
256 export->pwm = pwm;
263 dev_set_name(&export->child, "pwm%u", pwm->hwpwm);
267 clear_bit(PWMF_EXPORTED, &pwm->flags);
272 pwm_prop[0] = kasprintf(GFP_KERNEL, "EXPORT=pwm%u", pwm->hwpwm);
285 static int pwm_unexport_child(struct device *parent, struct pwm_device *pwm)
290 if (!test_and_clear_bit(PWMF_EXPORTED, &pwm->flags))
293 child = device_find_child(parent, pwm, pwm_unexport_match);
297 pwm_prop[0] = kasprintf(GFP_KERNEL, "UNEXPORT=pwm%u", pwm->hwpwm);
305 pwm_put(pwm);
315 struct pwm_device *pwm;
326 pwm = pwm_request_from_chip(chip, hwpwm, "sysfs");
327 if (IS_ERR(pwm))
328 return PTR_ERR(pwm);
330 ret = pwm_export_child(parent, pwm);
332 pwm_put(pwm);
378 struct pwm_device *pwm,
384 if (!test_bit(PWMF_EXPORTED, &pwm->flags))
387 child = device_find_child(parent, pwm, pwm_unexport_match);
395 pwm_get_state(pwm, state);
401 struct pwm_device *pwm,
404 int ret = pwm_apply_state(pwm, state);
419 struct pwm_device *pwm = &chip->pwms[i];
423 export = pwm_class_get_state(parent, pwm, &state);
435 ret = pwm_class_apply_state(export, pwm, &state);
450 struct pwm_device *pwm = &chip->pwms[i];
454 export = pwm_class_get_state(parent, pwm, &state);
470 ret = pwm_class_apply_state(export, pwm, &state);
494 .name = "pwm",
531 struct pwm_device *pwm = &chip->pwms[i];
533 if (test_bit(PWMF_EXPORTED, &pwm->flags))
534 pwm_unexport_child(parent, pwm);