Lines Matching +full:device +full:- +full:handle

1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * acpi_bus.h - ACPI Bus Driver ($Revision: 22 $)
12 #include <linux/device.h>
27 acpi_evaluate_integer(acpi_handle handle,
31 acpi_evaluate_reference(acpi_handle handle,
36 acpi_evaluate_ost(acpi_handle handle, u32 source_event, u32 status_code,
40 acpi_get_physical_device_location(acpi_handle handle, struct acpi_pld_info **pld);
42 bool acpi_has_method(acpi_handle handle, char *name);
43 acpi_status acpi_execute_simple_method(acpi_handle handle, char *method,
45 acpi_status acpi_evaluate_ej0(acpi_handle handle);
46 acpi_status acpi_evaluate_lck(acpi_handle handle, int lock);
47 acpi_status acpi_evaluate_reg(acpi_handle handle, u8 space_id, u32 function);
48 bool acpi_ata_match(acpi_handle handle);
49 bool acpi_bay_match(acpi_handle handle);
50 bool acpi_dock_match(acpi_handle handle);
52 bool acpi_check_dsm(acpi_handle handle, const guid_t *guid, u64 rev, u64 funcs);
53 union acpi_object *acpi_evaluate_dsm(acpi_handle handle, const guid_t *guid,
57 acpi_evaluate_dsm_typed(acpi_handle handle, const guid_t *guid, u64 rev, in acpi_evaluate_dsm_typed() argument
63 obj = acpi_evaluate_dsm(handle, guid, rev, func, argv4); in acpi_evaluate_dsm_typed()
64 if (obj && obj->type != type) { in acpi_evaluate_dsm_typed()
106 * -----------------
129 void (*bind)(struct device *phys_dev);
130 void (*unbind)(struct device *phys_dev);
136 * --------------------
148 * -----------
151 typedef int (*acpi_op_add) (struct acpi_device * device);
152 typedef int (*acpi_op_remove) (struct acpi_device * device);
153 typedef void (*acpi_op_notify) (struct acpi_device * device, u32 event);
161 #define ACPI_DRIVER_ALL_NOTIFY_EVENTS 0x1 /* system AND device events */
174 * ACPI Device
175 * -----------
214 #define acpi_device_dir(d) ((d)->dir.entry)
242 acpi_device_name device_name; /* Driver-determined */
247 #define acpi_device_bid(d) ((d)->pnp.bus_id)
248 #define acpi_device_adr(d) ((d)->pnp.bus_address)
249 const char *acpi_device_hid(struct acpi_device *device);
250 #define acpi_device_uid(d) ((d)->pnp.unique_id)
251 #define acpi_device_name(d) ((d)->pnp.device_name)
252 #define acpi_device_class(d) ((d)->pnp.device_class)
259 u32 inrush_current:1; /* Serialize Dx->D0 */
260 u32 power_removed:1; /* Optimize Dx->D0 */
273 int latency; /* Dx->D0 time (microseconds) */
280 struct acpi_device_power_state states[ACPI_D_STATE_COUNT]; /* Power states (D0-D3Cold) */
302 int latency; /* Px->P0 time (microseconds) */
315 u8 notifier_present:1; /* Wake-up notify handler has been installed */
320 struct device *dev;
338 struct device *dev;
348 /* ACPI Device Specific Data (_DSD) */
358 /* Device */
361 acpi_handle handle; /* no handle for fixed hardware */ member
381 struct device dev;
389 /* Non-device subnode */
392 acpi_handle handle; member
436 fwnode->ops == &acpi_static_fwnode_ops; in is_acpi_static_node()
443 (!strcmp(to_acpi_data_node(fwnode)->name, name)) : false; in acpi_data_node_match()
448 return &adev->fwnode; in acpi_fwnode_handle()
453 return d->driver_data; in acpi_driver_data()
461 *((u32 *)&adev->status) = sta; in acpi_set_device_status()
467 hp->self = adev; in acpi_set_hp_context()
468 adev->hp = hp; in acpi_set_hp_context()
481 * ------
506 int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device);
507 acpi_status acpi_bus_get_status_handle(acpi_handle handle,
509 int acpi_bus_get_status(struct acpi_device *device);
511 int acpi_bus_set_power(acpi_handle handle, int state);
513 int acpi_device_set_power(struct acpi_device *device, int state);
514 int acpi_bus_init_power(struct acpi_device *device);
515 int acpi_device_fix_up_power(struct acpi_device *device);
516 int acpi_bus_update_power(acpi_handle handle, int *state_p);
517 int acpi_device_update_power(struct acpi_device *device, int *state_p);
518 bool acpi_bus_power_manageable(acpi_handle handle);
520 struct device *dev);
522 struct device *dev);
525 bool acpi_bus_can_wakeup(acpi_handle handle);
527 static inline bool acpi_bus_can_wakeup(acpi_handle handle) { return false; } in acpi_bus_can_wakeup() argument
537 int acpi_bus_scan(acpi_handle handle);
539 acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd);
540 int acpi_match_device_ids(struct acpi_device *device,
549 return adev && adev->flags.initialized && adev->flags.visited; in acpi_device_enumerated()
553 * module_acpi_driver(acpi_driver) - Helper macro for registering an ACPI driver
570 bool (*match)(struct device *dev);
571 struct acpi_device * (*find_companion)(struct device *);
572 void (*setup)(struct device *);
573 void (*cleanup)(struct device *);
577 int acpi_bind_one(struct device *dev, struct acpi_device *adev);
578 int acpi_unbind_one(struct device *dev);
581 struct acpi_device * device; member
595 int acpi_iommu_fwspec_init(struct device *dev, u32 id,
598 int acpi_dma_get_range(struct device *dev, u64 *dma_addr, u64 *offset,
600 int acpi_dma_configure_id(struct device *dev, enum dev_dma_attr attr,
602 static inline int acpi_dma_configure(struct device *dev, in acpi_dma_configure()
610 struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle);
625 void acpi_pm_wakeup_event(struct device *dev);
626 acpi_status acpi_add_pm_notifier(struct acpi_device *adev, struct device *dev,
629 bool acpi_pm_device_can_wakeup(struct device *dev);
630 int acpi_pm_device_sleep_state(struct device *, int *, int);
631 int acpi_pm_set_device_wakeup(struct device *dev, bool enable);
633 static inline void acpi_pm_wakeup_event(struct device *dev) in acpi_pm_wakeup_event()
637 struct device *dev, in acpi_add_pm_notifier()
646 static inline bool acpi_pm_device_can_wakeup(struct device *dev) in acpi_pm_device_can_wakeup()
650 static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m) in acpi_pm_device_sleep_state()
658 static inline int acpi_pm_set_device_wakeup(struct device *dev, bool enable) in acpi_pm_set_device_wakeup()
660 return -ENODEV; in acpi_pm_set_device_wakeup()
678 return adev->flags.power_manageable; in acpi_device_power_manageable()
683 return adev->wakeup.flags.valid; in acpi_device_can_wakeup()
688 return adev->power.states[ACPI_STATE_D3_COLD].flags.valid || in acpi_device_can_poweroff()
690 adev->power.states[ACPI_STATE_D3_HOT].flags.explicit_set); in acpi_device_can_poweroff()
703 * for_each_acpi_dev_match - iterate over ACPI devices that matching the criteria
704 * @adev: pointer to the matching ACPI device, NULL at the end of the loop
705 * @hid: Hardware ID of the device.
706 * @uid: Unique ID of the device, pass NULL to not check _UID
707 * @hrv: Hardware Revision of the device, pass -1 to not check _HRV
709 * The caller is responsible for invoking acpi_dev_put() on the returned device.
718 return adev ? to_acpi_device(get_device(&adev->dev)) : NULL; in acpi_dev_get()
724 put_device(&adev->dev); in acpi_dev_put()
727 struct acpi_device *acpi_bus_get_acpi_device(acpi_handle handle);