Lines Matching refs:pwm

28 	struct pwm_device *pwm;  member
40 return export->pwm; in child_to_pwm_device()
47 const struct pwm_device *pwm = child_to_pwm_device(child); in period_show() local
49 return sprintf(buf, "%u\n", pwm_get_period(pwm)); in period_show()
56 struct pwm_device *pwm = child_to_pwm_device(child); in period_store() local
64 ret = pwm_config(pwm, pwm_get_duty_cycle(pwm), val); in period_store()
73 const struct pwm_device *pwm = child_to_pwm_device(child); in duty_cycle_show() local
75 return sprintf(buf, "%u\n", pwm_get_duty_cycle(pwm)); in duty_cycle_show()
82 struct pwm_device *pwm = child_to_pwm_device(child); in duty_cycle_store() local
90 ret = pwm_config(pwm, val, pwm_get_period(pwm)); in duty_cycle_store()
99 const struct pwm_device *pwm = child_to_pwm_device(child); in enable_show() local
101 return sprintf(buf, "%d\n", pwm_is_enabled(pwm)); in enable_show()
108 struct pwm_device *pwm = child_to_pwm_device(child); in enable_store() local
117 pwm_disable(pwm); in enable_store()
120 ret = pwm_enable(pwm); in enable_store()
134 const struct pwm_device *pwm = child_to_pwm_device(child); in polarity_show() local
137 switch (pwm_get_polarity(pwm)) { in polarity_show()
154 struct pwm_device *pwm = child_to_pwm_device(child); in polarity_store() local
165 ret = pwm_set_polarity(pwm, polarity); in polarity_store()
182 ATTRIBUTE_GROUPS(pwm);
191 static int pwm_export_child(struct device *parent, struct pwm_device *pwm) in pwm_export_child() argument
196 if (test_and_set_bit(PWMF_EXPORTED, &pwm->flags)) in pwm_export_child()
201 clear_bit(PWMF_EXPORTED, &pwm->flags); in pwm_export_child()
205 export->pwm = pwm; in pwm_export_child()
211 dev_set_name(&export->child, "pwm%u", pwm->hwpwm); in pwm_export_child()
215 clear_bit(PWMF_EXPORTED, &pwm->flags); in pwm_export_child()
228 static int pwm_unexport_child(struct device *parent, struct pwm_device *pwm) in pwm_unexport_child() argument
232 if (!test_and_clear_bit(PWMF_EXPORTED, &pwm->flags)) in pwm_unexport_child()
235 child = device_find_child(parent, pwm, pwm_unexport_match); in pwm_unexport_child()
242 pwm_put(pwm); in pwm_unexport_child()
252 struct pwm_device *pwm; in export_store() local
263 pwm = pwm_request_from_chip(chip, hwpwm, "sysfs"); in export_store()
264 if (IS_ERR(pwm)) in export_store()
265 return PTR_ERR(pwm); in export_store()
267 ret = pwm_export_child(parent, pwm); in export_store()
269 pwm_put(pwm); in export_store()