Lines Matching full:export

509 	struct pwm_export *export = pwmexport_from_dev(pwm_dev);  in pwm_from_dev()  local
511 return export->pwm; in pwm_from_dev()
530 struct pwm_export *export = pwmexport_from_dev(pwm_dev); in period_store() local
531 struct pwm_device *pwm = export->pwm; in period_store()
540 guard(mutex)(&export->lock); in period_store()
565 struct pwm_export *export = pwmexport_from_dev(pwm_dev); in duty_cycle_store() local
566 struct pwm_device *pwm = export->pwm; in duty_cycle_store()
575 guard(mutex)(&export->lock); in duty_cycle_store()
600 struct pwm_export *export = pwmexport_from_dev(pwm_dev); in enable_store() local
601 struct pwm_device *pwm = export->pwm; in enable_store()
609 guard(mutex)(&export->lock); in enable_store()
656 struct pwm_export *export = pwmexport_from_dev(pwm_dev); in polarity_store() local
657 struct pwm_device *pwm = export->pwm; in polarity_store()
669 guard(mutex)(&export->lock); in polarity_store()
711 struct pwm_export *export = pwmexport_from_dev(pwm_dev); in pwm_export_release() local
713 kfree(export); in pwm_export_release()
718 struct pwm_export *export; in pwm_export_child() local
725 export = kzalloc(sizeof(*export), GFP_KERNEL); in pwm_export_child()
726 if (!export) { in pwm_export_child()
731 export->pwm = pwm; in pwm_export_child()
732 mutex_init(&export->lock); in pwm_export_child()
734 export->pwm_dev.release = pwm_export_release; in pwm_export_child()
735 export->pwm_dev.parent = pwmchip_dev; in pwm_export_child()
736 export->pwm_dev.devt = MKDEV(0, 0); in pwm_export_child()
737 export->pwm_dev.groups = pwm_groups; in pwm_export_child()
738 dev_set_name(&export->pwm_dev, "pwm%u", pwm->hwpwm); in pwm_export_child()
740 ret = device_register(&export->pwm_dev); in pwm_export_child()
743 put_device(&export->pwm_dev); in pwm_export_child()
744 export = NULL; in pwm_export_child()
747 pwm_prop[0] = kasprintf(GFP_KERNEL, "EXPORT=pwm%u", pwm->hwpwm); in pwm_export_child()
811 static DEVICE_ATTR_WO(export);
851 /* takes export->lock on success */
857 struct pwm_export *export; in pwm_class_get_state() local
866 export = pwmexport_from_dev(pwm_dev); in pwm_class_get_state()
869 mutex_lock(&export->lock); in pwm_class_get_state()
872 return export; in pwm_class_get_state()
875 static int pwm_class_apply_state(struct pwm_export *export, in pwm_class_apply_state() argument
882 mutex_unlock(&export->lock); in pwm_class_apply_state()
896 struct pwm_export *export; in pwm_class_resume_npwm() local
898 export = pwm_class_get_state(pwmchip_dev, pwm, &state); in pwm_class_resume_npwm()
899 if (!export) in pwm_class_resume_npwm()
903 if (!export->suspend.enabled) { in pwm_class_resume_npwm()
905 mutex_unlock(&export->lock); in pwm_class_resume_npwm()
909 state.enabled = export->suspend.enabled; in pwm_class_resume_npwm()
910 ret = pwm_class_apply_state(export, pwm, &state); in pwm_class_resume_npwm()
927 struct pwm_export *export; in pwm_class_suspend() local
929 export = pwm_class_get_state(pwmchip_dev, pwm, &state); in pwm_class_suspend()
930 if (!export) in pwm_class_suspend()
937 export->suspend = state; in pwm_class_suspend()
940 mutex_unlock(&export->lock); in pwm_class_suspend()
945 ret = pwm_class_apply_state(export, pwm, &state); in pwm_class_suspend()