[go: nahoru, domu]

Lines Matching refs:pwm

24 #include <linux/pwm.h>
28 struct pwm_device *pwm;
40 return export->pwm;
47 const struct pwm_device *pwm = child_to_pwm_device(child);
49 return sprintf(buf, "%u\n", pwm->period);
56 struct pwm_device *pwm = child_to_pwm_device(child);
64 ret = pwm_config(pwm, pwm->duty_cycle, val);
73 const struct pwm_device *pwm = child_to_pwm_device(child);
75 return sprintf(buf, "%u\n", pwm->duty_cycle);
82 struct pwm_device *pwm = child_to_pwm_device(child);
90 ret = pwm_config(pwm, val, pwm->period);
99 const struct pwm_device *pwm = child_to_pwm_device(child);
100 int enabled = test_bit(PWMF_ENABLED, &pwm->flags);
109 struct pwm_device *pwm = child_to_pwm_device(child);
118 pwm_disable(pwm);
121 ret = pwm_enable(pwm);
135 const struct pwm_device *pwm = child_to_pwm_device(child);
137 return sprintf(buf, "%s\n", pwm->polarity ? "inversed" : "normal");
144 struct pwm_device *pwm = child_to_pwm_device(child);
155 ret = pwm_set_polarity(pwm, polarity);
172 ATTRIBUTE_GROUPS(pwm);
181 static int pwm_export_child(struct device *parent, struct pwm_device *pwm)
186 if (test_and_set_bit(PWMF_EXPORTED, &pwm->flags))
191 clear_bit(PWMF_EXPORTED, &pwm->flags);
195 export->pwm = pwm;
201 dev_set_name(&export->child, "pwm%u", pwm->hwpwm);
205 clear_bit(PWMF_EXPORTED, &pwm->flags);
218 static int pwm_unexport_child(struct device *parent, struct pwm_device *pwm)
222 if (!test_and_clear_bit(PWMF_EXPORTED, &pwm->flags))
225 child = device_find_child(parent, pwm, pwm_unexport_match);
232 pwm_put(pwm);
242 struct pwm_device *pwm;
253 pwm = pwm_request_from_chip(chip, hwpwm, "sysfs");
254 if (IS_ERR(pwm))
255 return PTR_ERR(pwm);
257 ret = pwm_export_child(parent, pwm);
259 pwm_put(pwm);
304 .name = "pwm",