Lines Matching full:export
31 struct pwm_export *export = child_to_pwm_export(child); in child_to_pwm_device() local
33 return export->pwm; in child_to_pwm_device()
52 struct pwm_export *export = child_to_pwm_export(child); in period_store() local
53 struct pwm_device *pwm = export->pwm; in period_store()
62 mutex_lock(&export->lock); in period_store()
66 mutex_unlock(&export->lock); in period_store()
87 struct pwm_export *export = child_to_pwm_export(child); in duty_cycle_store() local
88 struct pwm_device *pwm = export->pwm; in duty_cycle_store()
97 mutex_lock(&export->lock); in duty_cycle_store()
101 mutex_unlock(&export->lock); in duty_cycle_store()
122 struct pwm_export *export = child_to_pwm_export(child); in enable_store() local
123 struct pwm_device *pwm = export->pwm; in enable_store()
131 mutex_lock(&export->lock); in enable_store()
150 mutex_unlock(&export->lock); in enable_store()
181 struct pwm_export *export = child_to_pwm_export(child); in polarity_store() local
182 struct pwm_device *pwm = export->pwm; in polarity_store()
194 mutex_lock(&export->lock); in polarity_store()
198 mutex_unlock(&export->lock); in polarity_store()
236 struct pwm_export *export = child_to_pwm_export(child); in pwm_export_release() local
238 kfree(export); in pwm_export_release()
243 struct pwm_export *export; in pwm_export_child() local
250 export = kzalloc(sizeof(*export), GFP_KERNEL); in pwm_export_child()
251 if (!export) { in pwm_export_child()
256 export->pwm = pwm; in pwm_export_child()
257 mutex_init(&export->lock); in pwm_export_child()
259 export->child.release = pwm_export_release; in pwm_export_child()
260 export->child.parent = parent; in pwm_export_child()
261 export->child.devt = MKDEV(0, 0); in pwm_export_child()
262 export->child.groups = pwm_groups; in pwm_export_child()
263 dev_set_name(&export->child, "pwm%u", pwm->hwpwm); in pwm_export_child()
265 ret = device_register(&export->child); in pwm_export_child()
268 put_device(&export->child); in pwm_export_child()
269 export = NULL; in pwm_export_child()
272 pwm_prop[0] = kasprintf(GFP_KERNEL, "EXPORT=pwm%u", pwm->hwpwm); in pwm_export_child()
336 static DEVICE_ATTR_WO(export);
376 /* takes export->lock on success */
382 struct pwm_export *export; in pwm_class_get_state() local
391 export = child_to_pwm_export(child); in pwm_class_get_state()
394 mutex_lock(&export->lock); in pwm_class_get_state()
397 return export; in pwm_class_get_state()
400 static int pwm_class_apply_state(struct pwm_export *export, in pwm_class_apply_state() argument
407 mutex_unlock(&export->lock); in pwm_class_apply_state()
421 struct pwm_export *export; in pwm_class_resume_npwm() local
423 export = pwm_class_get_state(parent, pwm, &state); in pwm_class_resume_npwm()
424 if (!export) in pwm_class_resume_npwm()
427 state.enabled = export->suspend.enabled; in pwm_class_resume_npwm()
428 ret = pwm_class_apply_state(export, pwm, &state); in pwm_class_resume_npwm()
445 struct pwm_export *export; in pwm_class_suspend() local
447 export = pwm_class_get_state(parent, pwm, &state); in pwm_class_suspend()
448 if (!export) in pwm_class_suspend()
451 export->suspend = state; in pwm_class_suspend()
453 ret = pwm_class_apply_state(export, pwm, &state); in pwm_class_suspend()
500 "device_create failed for pwm_chip sysfs export\n"); in pwmchip_sysfs_export()