Lines Matching defs:device
15 #include <linux/device.h>
96 int acpi_bus_get_status(struct acpi_device *device)
101 if (acpi_device_override_status(device, &sta)) {
102 acpi_set_device_status(device, sta);
107 if (acpi_device_is_battery(device) && device->dep_unmet) {
108 acpi_set_device_status(device, 0);
112 status = acpi_bus_get_status_handle(device->handle, &sta);
116 acpi_set_device_status(device, sta);
118 if (device->status.functional && !device->status.present) {
121 device->pnp.bus_id, (u32)sta));
125 device->pnp.bus_id, (u32)sta));
144 acpi_handle_debug(handle, "Error attaching device data\n");
344 * Callback for all 'system-level' device notifications (values 0x00-0x7F).
422 struct acpi_device *device = data;
424 device->driver->ops.notify(device, event);
429 struct acpi_device *device = data;
432 acpi_device_notify(NULL, ACPI_FIXED_HARDWARE_EVENT, device);
441 static int acpi_device_install_notify_handler(struct acpi_device *device)
445 if (device->device_type == ACPI_BUS_TYPE_POWER_BUTTON)
449 device);
450 else if (device->device_type == ACPI_BUS_TYPE_SLEEP_BUTTON)
454 device);
456 status = acpi_install_notify_handler(device->handle,
459 device);
466 static void acpi_device_remove_notify_handler(struct acpi_device *device)
468 if (device->device_type == ACPI_BUS_TYPE_POWER_BUTTON)
471 else if (device->device_type == ACPI_BUS_TYPE_SLEEP_BUTTON)
475 acpi_remove_notify_handler(device->handle, ACPI_DEVICE_NOTIFY,
479 /* Handle events targeting \_SB device (at present only graceful shutdown) */
512 pr_warn("event %x is not supported by \\_SB device\n", event);
534 * acpi_get_first_physical_node - Get first physical node of an ACPI device
535 * @adev: ACPI device in question
537 * Return: First physical node of ACPI device @adev
539 struct device *acpi_get_first_physical_node(struct acpi_device *adev)
542 struct device *phys_dev;
561 const struct device *dev)
563 const struct device *phys_dev = acpi_get_first_physical_node(adev);
570 * @adev: ACPI companion device
571 * @dev: Physical device to check
574 * the ACPI companion device. This distinction is needed in some cases
575 * where the same companion device is shared between many physical devices.
580 const struct device *dev)
586 * acpi_companion_match() - Can we match via ACPI companion device
589 * Check if the given device has an ACPI companion and if that companion has
590 * a valid list of PNP IDs, and if the device is the first (primary) physical
591 * device associated with it. Return the companion pointer if that's the case
597 * companion. A typical case is an MFD device where all the sub-devices share
599 * (first) physical device to be matched with the help of the companion's PNP
606 struct acpi_device *acpi_companion_match(const struct device *dev)
621 * acpi_of_match_device - Match device object using the "compatible" property.
622 * @adev: ACPI device object to match.
623 * @of_match_table: List of device IDs to match against.
691 * @adev: ACPI device object to match
731 static bool __acpi_match_device(struct acpi_device *device,
741 * If the device is not present, it is unnecessary to load device
744 if (!device || !device->status.present)
747 list_for_each_entry(hwid, &device->pnp.ids, list) {
763 return acpi_of_match_device(device, of_ids, of_id);
774 * acpi_match_device - Match a struct device against a given list of ACPI IDs
776 * @dev: The device structure to match.
780 * device IDs.
785 const struct device *dev)
794 static const void *acpi_of_device_get_match_data(const struct device *dev)
805 const void *acpi_device_get_match_data(const struct device *dev)
820 int acpi_match_device_ids(struct acpi_device *device,
823 return __acpi_match_device(device, ids, NULL, NULL, NULL) ? 0 : -ENOENT;
827 bool acpi_driver_match_device(struct device *dev,
887 static int acpi_bus_match(struct device *dev, struct device_driver *drv)
896 static int acpi_device_uevent(struct device *dev, struct kobj_uevent_env *env)
901 static int acpi_device_probe(struct device *dev)
919 "Driver [%s] successfully bound to device [%s]\n",
934 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found driver [%s] for device [%s]\n",
940 static int acpi_device_remove(struct device *dev)
1144 * device is found in the namespace.
1205 * Register the for all standard device notifications.
1212 "Unable to register for device notifications\n");