Lines Matching refs:adev
64 struct acpi_device *adev; member
240 struct acpi_device *adev; in acpi_power_resume_dependent() local
244 adev = dep->adev; in acpi_power_resume_dependent()
245 if (acpi_power_get_inferred_state(adev, &state)) in acpi_power_resume_dependent()
251 mutex_lock(&adev->physical_node_lock); in acpi_power_resume_dependent()
253 list_for_each_entry(pn, &adev->physical_node_list, node) in acpi_power_resume_dependent()
256 list_for_each_entry(pn, &adev->power_dependent, node) in acpi_power_resume_dependent()
259 mutex_unlock(&adev->physical_node_lock); in acpi_power_resume_dependent()
394 struct acpi_device *adev) in acpi_power_add_dependent() argument
401 if (dep->adev == adev) in acpi_power_add_dependent()
408 dep->adev = adev; in acpi_power_add_dependent()
417 struct acpi_device *adev) in acpi_power_remove_dependent() argument
425 if (dep->adev == adev) { in acpi_power_remove_dependent()
467 static void acpi_power_hide_list(struct acpi_device *adev, in acpi_power_hide_list() argument
479 sysfs_remove_link_from_group(&adev->dev.kobj, in acpi_power_hide_list()
483 sysfs_remove_group(&adev->dev.kobj, attr_group); in acpi_power_hide_list()
486 static void acpi_power_expose_list(struct acpi_device *adev, in acpi_power_expose_list() argument
496 ret = sysfs_create_group(&adev->dev.kobj, attr_group); in acpi_power_expose_list()
503 ret = sysfs_add_link_to_group(&adev->dev.kobj, in acpi_power_expose_list()
508 acpi_power_hide_list(adev, resources, attr_group); in acpi_power_expose_list()
514 static void acpi_power_expose_hide(struct acpi_device *adev, in acpi_power_expose_hide() argument
520 acpi_power_expose_list(adev, resources, attr_group); in acpi_power_expose_hide()
522 acpi_power_hide_list(adev, resources, attr_group); in acpi_power_expose_hide()
525 void acpi_power_add_remove_device(struct acpi_device *adev, bool add) in acpi_power_add_remove_device() argument
531 if (adev->wakeup.flags.valid) in acpi_power_add_remove_device()
532 acpi_power_expose_hide(adev, &adev->wakeup.resources, in acpi_power_add_remove_device()
535 if (!adev->power.flags.power_resources) in acpi_power_add_remove_device()
538 ps = &adev->power.states[ACPI_STATE_D0]; in acpi_power_add_remove_device()
543 acpi_power_add_dependent(resource, adev); in acpi_power_add_remove_device()
545 acpi_power_remove_dependent(resource, adev); in acpi_power_add_remove_device()
549 acpi_power_expose_hide(adev, in acpi_power_add_remove_device()
550 &adev->power.states[state].resources, in acpi_power_add_remove_device()