Lines Matching refs:parent
241 static int pwm_export_child(struct device *parent, struct pwm_device *pwm) in pwm_export_child() argument
260 export->child.parent = parent; in pwm_export_child()
274 kobject_uevent_env(&parent->kobj, KOBJ_CHANGE, pwm_prop); in pwm_export_child()
285 static int pwm_unexport_child(struct device *parent, struct pwm_device *pwm) in pwm_unexport_child() argument
293 child = device_find_child(parent, pwm, pwm_unexport_match); in pwm_unexport_child()
299 kobject_uevent_env(&parent->kobj, KOBJ_CHANGE, pwm_prop); in pwm_unexport_child()
310 static ssize_t export_store(struct device *parent, in export_store() argument
314 struct pwm_chip *chip = dev_get_drvdata(parent); in export_store()
330 ret = pwm_export_child(parent, pwm); in export_store()
338 static ssize_t unexport_store(struct device *parent, in unexport_store() argument
342 struct pwm_chip *chip = dev_get_drvdata(parent); in unexport_store()
353 ret = pwm_unexport_child(parent, &chip->pwms[hwpwm]); in unexport_store()
359 static ssize_t npwm_show(struct device *parent, struct device_attribute *attr, in npwm_show() argument
362 const struct pwm_chip *chip = dev_get_drvdata(parent); in npwm_show()
377 static struct pwm_export *pwm_class_get_state(struct device *parent, in pwm_class_get_state() argument
387 child = device_find_child(parent, pwm, pwm_unexport_match); in pwm_class_get_state()
412 static int pwm_class_resume_npwm(struct device *parent, unsigned int npwm) in pwm_class_resume_npwm() argument
414 struct pwm_chip *chip = dev_get_drvdata(parent); in pwm_class_resume_npwm()
423 export = pwm_class_get_state(parent, pwm, &state); in pwm_class_resume_npwm()
443 static int pwm_class_suspend(struct device *parent) in pwm_class_suspend() argument
445 struct pwm_chip *chip = dev_get_drvdata(parent); in pwm_class_suspend()
454 export = pwm_class_get_state(parent, pwm, &state); in pwm_class_suspend()
476 pwm_class_resume_npwm(parent, i); in pwm_class_suspend()
484 static int pwm_class_resume(struct device *parent) in pwm_class_resume() argument
486 struct pwm_chip *chip = dev_get_drvdata(parent); in pwm_class_resume()
488 return pwm_class_resume_npwm(parent, chip->npwm); in pwm_class_resume()
499 static int pwmchip_sysfs_match(struct device *parent, const void *data) in pwmchip_sysfs_match() argument
501 return dev_get_drvdata(parent) == data; in pwmchip_sysfs_match()
506 struct device *parent; in pwmchip_sysfs_export() local
512 parent = device_create(&pwm_class, chip->dev, MKDEV(0, 0), chip, in pwmchip_sysfs_export()
514 if (IS_ERR(parent)) { in pwmchip_sysfs_export()
522 struct device *parent; in pwmchip_sysfs_unexport() local
525 parent = class_find_device(&pwm_class, NULL, chip, in pwmchip_sysfs_unexport()
527 if (!parent) in pwmchip_sysfs_unexport()
534 pwm_unexport_child(parent, pwm); in pwmchip_sysfs_unexport()
537 put_device(parent); in pwmchip_sysfs_unexport()
538 device_unregister(parent); in pwmchip_sysfs_unexport()