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()
107 * -----------------
130 void (*bind)(struct device *phys_dev);
131 void (*unbind)(struct device *phys_dev);
137 * --------------------
149 * -----------
152 typedef int (*acpi_op_add) (struct acpi_device * device);
153 typedef void (*acpi_op_remove) (struct acpi_device *device);
154 typedef void (*acpi_op_notify) (struct acpi_device * device, u32 event);
162 #define ACPI_DRIVER_ALL_NOTIFY_EVENTS 0x1 /* system AND device events */
175 * ACPI Device
176 * -----------
216 #define acpi_device_dir(d) ((d)->dir.entry)
245 acpi_device_name device_name; /* Driver-determined */
250 #define acpi_device_bid(d) ((d)->pnp.bus_id)
251 #define acpi_device_adr(d) ((d)->pnp.bus_address)
252 const char *acpi_device_hid(struct acpi_device *device);
253 #define acpi_device_uid(d) ((d)->pnp.unique_id)
254 #define acpi_device_name(d) ((d)->pnp.device_name)
255 #define acpi_device_class(d) ((d)->pnp.device_class)
262 u32 inrush_current:1; /* Serialize Dx->D0 */
263 u32 power_removed:1; /* Optimize Dx->D0 */
276 int latency; /* Dx->D0 time (microseconds) */
283 struct acpi_device_power_state states[ACPI_D_STATE_COUNT]; /* Power states (D0-D3Cold) */
309 int latency; /* Px->P0 time (microseconds) */
322 u8 notifier_present:1; /* Wake-up notify handler has been installed */
327 struct device *dev;
345 struct device *dev;
356 /* ACPI Device Specific Data (_DSD) */
366 /* Device */
370 acpi_handle handle; /* no handle for fixed hardware */ member
386 struct device dev;
394 /* Non-device subnode */
397 acpi_handle handle; member
441 fwnode->ops == &acpi_static_fwnode_ops; in is_acpi_static_node()
448 (!strcmp(to_acpi_data_node(fwnode)->name, name)) : false; in acpi_data_node_match()
453 return &adev->fwnode; in acpi_fwnode_handle()
458 return d->driver_data; in acpi_driver_data()
466 if (adev->dev.parent) in acpi_dev_parent()
467 return to_acpi_device(adev->dev.parent); in acpi_dev_parent()
474 *((u32 *)&adev->status) = sta; in acpi_set_device_status()
480 hp->self = adev; in acpi_set_hp_context()
481 adev->hp = hp; in acpi_set_hp_context()
492 int acpi_bus_for_each_dev(int (*fn)(struct device *, void *), void *data);
501 * ------
532 acpi_status acpi_bus_get_status_handle(acpi_handle handle,
534 int acpi_bus_get_status(struct acpi_device *device);
536 int acpi_bus_set_power(acpi_handle handle, int state);
538 int acpi_device_set_power(struct acpi_device *device, int state);
539 int acpi_bus_init_power(struct acpi_device *device);
540 int acpi_device_fix_up_power(struct acpi_device *device);
543 int acpi_bus_update_power(acpi_handle handle, int *state_p);
544 int acpi_device_update_power(struct acpi_device *device, int *state_p);
545 bool acpi_bus_power_manageable(acpi_handle handle);
549 struct device *dev);
551 struct device *dev);
554 bool acpi_bus_can_wakeup(acpi_handle handle);
556 static inline bool acpi_bus_can_wakeup(acpi_handle handle) { return false; } in acpi_bus_can_wakeup() argument
566 int acpi_bus_scan(acpi_handle handle);
568 acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd);
569 int acpi_match_device_ids(struct acpi_device *device,
576 return adev && adev->flags.initialized && adev->flags.visited; in acpi_device_enumerated()
580 * module_acpi_driver(acpi_driver) - Helper macro for registering an ACPI driver
597 bool (*match)(struct device *dev);
598 struct acpi_device * (*find_companion)(struct device *);
599 void (*setup)(struct device *);
603 int acpi_bind_one(struct device *dev, struct acpi_device *adev);
604 int acpi_unbind_one(struct device *dev);
612 struct acpi_device * device; member
629 int acpi_iommu_fwspec_init(struct device *dev, u32 id,
632 int acpi_dma_get_range(struct device *dev, const struct bus_dma_region **map);
633 int acpi_dma_configure_id(struct device *dev, enum dev_dma_attr attr,
635 static inline int acpi_dma_configure(struct device *dev, in acpi_dma_configure()
645 struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle);
653 int acpi_install_cmos_rtc_space_handler(acpi_handle handle);
654 void acpi_remove_cmos_rtc_space_handler(acpi_handle handle);
655 int acpi_quirk_skip_serdev_enumeration(struct device *controller_parent, bool *skip);
666 static inline int acpi_install_cmos_rtc_space_handler(acpi_handle handle) in acpi_install_cmos_rtc_space_handler() argument
670 static inline void acpi_remove_cmos_rtc_space_handler(acpi_handle handle) in acpi_remove_cmos_rtc_space_handler() argument
674 acpi_quirk_skip_serdev_enumeration(struct device *controller_parent, bool *skip) in acpi_quirk_skip_serdev_enumeration()
696 void acpi_pm_wakeup_event(struct device *dev);
697 acpi_status acpi_add_pm_notifier(struct acpi_device *adev, struct device *dev,
700 bool acpi_pm_device_can_wakeup(struct device *dev);
701 int acpi_pm_device_sleep_state(struct device *, int *, int);
702 int acpi_pm_set_device_wakeup(struct device *dev, bool enable);
704 static inline void acpi_pm_wakeup_event(struct device *dev) in acpi_pm_wakeup_event()
708 struct device *dev, in acpi_add_pm_notifier()
717 static inline bool acpi_pm_device_can_wakeup(struct device *dev) in acpi_pm_device_can_wakeup()
721 static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m) in acpi_pm_device_sleep_state()
729 static inline int acpi_pm_set_device_wakeup(struct device *dev, bool enable) in acpi_pm_set_device_wakeup()
731 return -ENODEV; in acpi_pm_set_device_wakeup()
749 return adev->flags.power_manageable; in acpi_device_power_manageable()
754 return adev->wakeup.flags.valid; in acpi_device_can_wakeup()
759 return adev->power.states[ACPI_STATE_D3_COLD].flags.valid || in acpi_device_can_poweroff()
761 adev->power.states[ACPI_STATE_D3_HOT].flags.explicit_set); in acpi_device_can_poweroff()
768 bool acpi_dev_ready_for_enumeration(const struct acpi_device *device);
773 * for_each_acpi_consumer_dev - iterate over the consumer ACPI devices for a
775 * @supplier: Pointer to the supplier's ACPI device
789 * for_each_acpi_dev_match - iterate over ACPI devices that matching the criteria
790 * @adev: pointer to the matching ACPI device, NULL at the end of the loop
791 * @hid: Hardware ID of the device.
792 * @uid: Unique ID of the device, pass NULL to not check _UID
793 * @hrv: Hardware Revision of the device, pass -1 to not check _HRV
795 * The caller is responsible for invoking acpi_dev_put() on the returned device.
804 return adev ? to_acpi_device(get_device(&adev->dev)) : NULL; in acpi_dev_get()
810 put_device(&adev->dev); in acpi_dev_put()
813 struct acpi_device *acpi_fetch_acpi_dev(acpi_handle handle);
814 struct acpi_device *acpi_get_acpi_dev(acpi_handle handle);