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 $)
14 #include <linux/device.h>
30 acpi_evaluate_integer(acpi_handle handle,
33 bool acpi_evaluate_reference(acpi_handle handle, acpi_string pathname,
43 acpi_evaluate_ost(acpi_handle handle, u32 source_event, u32 status_code,
47 acpi_get_physical_device_location(acpi_handle handle, struct acpi_pld_info **pld);
49 bool acpi_has_method(acpi_handle handle, char *name);
50 acpi_status acpi_execute_simple_method(acpi_handle handle, char *method,
52 acpi_status acpi_evaluate_ej0(acpi_handle handle);
53 acpi_status acpi_evaluate_lck(acpi_handle handle, int lock);
54 acpi_status acpi_evaluate_reg(acpi_handle handle, u8 space_id, u32 function);
55 bool acpi_ata_match(acpi_handle handle);
56 bool acpi_bay_match(acpi_handle handle);
57 bool acpi_dock_match(acpi_handle handle);
59 bool acpi_check_dsm(acpi_handle handle, const guid_t *guid, u64 rev, u64 funcs);
60 union acpi_object *acpi_evaluate_dsm(acpi_handle handle, const guid_t *guid,
64 acpi_evaluate_dsm_typed(acpi_handle handle, const guid_t *guid, u64 rev, in acpi_evaluate_dsm_typed() argument
70 obj = acpi_evaluate_dsm(handle, guid, rev, func, argv4); in acpi_evaluate_dsm_typed()
71 if (obj && obj->type != type) { in acpi_evaluate_dsm_typed()
114 * -----------------
138 void (*bind)(struct device *phys_dev);
139 void (*unbind)(struct device *phys_dev);
145 * --------------------
161 * -----------
164 typedef int (*acpi_op_add) (struct acpi_device * device);
165 typedef void (*acpi_op_remove) (struct acpi_device *device);
166 typedef void (*acpi_op_notify) (struct acpi_device * device, u32 event);
174 #define ACPI_DRIVER_ALL_NOTIFY_EVENTS 0x1 /* system AND device events */
186 * ACPI Device
187 * -----------
227 #define acpi_device_dir(d) ((d)->dir.entry)
258 acpi_device_name device_name; /* Driver-determined */
262 #define acpi_device_bid(d) ((d)->pnp.bus_id)
263 #define acpi_device_adr(d) ((d)->pnp.bus_address)
264 const char *acpi_device_hid(struct acpi_device *device);
265 #define acpi_device_uid(d) ((d)->pnp.unique_id)
266 #define acpi_device_name(d) ((d)->pnp.device_name)
267 #define acpi_device_class(d) ((d)->pnp.device_class)
274 u32 inrush_current:1; /* Serialize Dx->D0 */
275 u32 power_removed:1; /* Optimize Dx->D0 */
289 int latency; /* Dx->D0 time (microseconds) */
295 struct acpi_device_power_state states[ACPI_D_STATE_COUNT]; /* Power states (D0-D3Cold) */
321 int latency; /* Px->P0 time (microseconds) */
334 u8 notifier_present:1; /* Wake-up notify handler has been installed */
339 struct device *dev;
356 struct device *dev;
368 /* ACPI Device Specific Data (_DSD) */
381 * The maximum expected number of CSI-2 data lanes.
421 * Each device has a root software node plus two times as many nodes as the
422 * number of CSI-2 ports.
429 * struct acpi_device_software_node_port - MIPI DisCo for Imaging CSI-2 port
431 * @data_lanes: "data-lanes" property values.
432 * @lane_polarities: "lane-polarities" property values.
455 * struct acpi_device_software_nodes - Software nodes for an ACPI device
456 * @dev_props: Device properties.
470 /* Device */
474 acpi_handle handle; /* no handle for fixed hardware */ member
491 struct device dev;
499 /* Non-device subnode */
503 acpi_handle handle; member
546 fwnode->ops == &acpi_static_fwnode_ops; in is_acpi_static_node()
553 (!strcmp(to_acpi_data_node(fwnode)->name, name)) : false; in acpi_data_node_match()
558 return &adev->fwnode; in acpi_fwnode_handle()
563 return d->driver_data; in acpi_driver_data()
571 if (adev->dev.parent) in acpi_dev_parent()
572 return to_acpi_device(adev->dev.parent); in acpi_dev_parent()
579 *((u32 *)&adev->status) = sta; in acpi_set_device_status()
585 hp->self = adev; in acpi_set_hp_context()
586 adev->hp = hp; in acpi_set_hp_context()
596 int acpi_bus_for_each_dev(int (*fn)(struct device *, void *), void *data);
605 * ------
636 acpi_status acpi_bus_get_status_handle(acpi_handle handle,
638 int acpi_bus_get_status(struct acpi_device *device);
640 int acpi_bus_set_power(acpi_handle handle, int state);
642 int acpi_device_set_power(struct acpi_device *device, int state);
643 int acpi_bus_init_power(struct acpi_device *device);
644 int acpi_device_fix_up_power(struct acpi_device *device);
647 int acpi_bus_update_power(acpi_handle handle, int *state_p);
648 int acpi_device_update_power(struct acpi_device *device, int *state_p);
649 bool acpi_bus_power_manageable(acpi_handle handle);
653 struct device *dev);
655 struct device *dev);
658 bool acpi_bus_can_wakeup(acpi_handle handle);
660 static inline bool acpi_bus_can_wakeup(acpi_handle handle) { return false; } in acpi_bus_can_wakeup() argument
675 int acpi_bus_scan(acpi_handle handle);
677 acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd);
678 int acpi_match_device_ids(struct acpi_device *device,
685 return adev && adev->flags.initialized && adev->flags.visited; in acpi_device_enumerated()
689 * module_acpi_driver(acpi_driver) - Helper macro for registering an ACPI driver
706 bool (*match)(struct device *dev);
707 struct acpi_device * (*find_companion)(struct device *);
708 void (*setup)(struct device *);
712 int acpi_bind_one(struct device *dev, struct acpi_device *adev);
713 int acpi_unbind_one(struct device *dev);
721 struct acpi_device * device; member
740 int acpi_iommu_fwspec_init(struct device *dev, u32 id,
742 int acpi_dma_get_range(struct device *dev, const struct bus_dma_region **map);
743 int acpi_dma_configure_id(struct device *dev, enum dev_dma_attr attr,
745 static inline int acpi_dma_configure(struct device *dev, in acpi_dma_configure()
755 struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle);
763 int acpi_install_cmos_rtc_space_handler(acpi_handle handle);
764 void acpi_remove_cmos_rtc_space_handler(acpi_handle handle);
765 int acpi_quirk_skip_serdev_enumeration(struct device *controller_parent, bool *skip);
776 static inline int acpi_install_cmos_rtc_space_handler(acpi_handle handle) in acpi_install_cmos_rtc_space_handler() argument
780 static inline void acpi_remove_cmos_rtc_space_handler(acpi_handle handle) in acpi_remove_cmos_rtc_space_handler() argument
784 acpi_quirk_skip_serdev_enumeration(struct device *controller_parent, bool *skip) in acpi_quirk_skip_serdev_enumeration()
806 void acpi_pm_wakeup_event(struct device *dev);
807 acpi_status acpi_add_pm_notifier(struct acpi_device *adev, struct device *dev,
810 bool acpi_pm_device_can_wakeup(struct device *dev);
811 int acpi_pm_device_sleep_state(struct device *, int *, int);
812 int acpi_pm_set_device_wakeup(struct device *dev, bool enable);
814 static inline void acpi_pm_wakeup_event(struct device *dev) in acpi_pm_wakeup_event()
818 struct device *dev, in acpi_add_pm_notifier()
827 static inline bool acpi_pm_device_can_wakeup(struct device *dev) in acpi_pm_device_can_wakeup()
831 static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m) in acpi_pm_device_sleep_state()
839 static inline int acpi_pm_set_device_wakeup(struct device *dev, bool enable) in acpi_pm_set_device_wakeup()
841 return -ENODEV; in acpi_pm_set_device_wakeup()
859 return adev->flags.power_manageable; in acpi_device_power_manageable()
864 return adev->wakeup.flags.valid; in acpi_device_can_wakeup()
869 return adev->power.states[ACPI_STATE_D3_COLD].flags.valid || in acpi_device_can_poweroff()
871 adev->power.states[ACPI_STATE_D3_HOT].flags.explicit_set); in acpi_device_can_poweroff()
908 * acpi_dev_uid_match - Match device by supplied UID
909 * @adev: ACPI device to match.
910 * @uid2: Unique ID of the device.
924 * acpi_dev_hid_uid_match - Match device by supplied HID and UID
925 * @adev: ACPI device to match.
926 * @hid2: Hardware ID of the device.
927 * @uid2: Unique ID of the device, pass NULL to not check _UID.
942 bool acpi_dev_ready_for_enumeration(const struct acpi_device *device);
947 * for_each_acpi_consumer_dev - iterate over the consumer ACPI devices for a
949 * @supplier: Pointer to the supplier's ACPI device
963 * for_each_acpi_dev_match - iterate over ACPI devices that matching the criteria
964 * @adev: pointer to the matching ACPI device, NULL at the end of the loop
965 * @hid: Hardware ID of the device.
966 * @uid: Unique ID of the device, pass NULL to not check _UID
967 * @hrv: Hardware Revision of the device, pass -1 to not check _HRV
969 * The caller is responsible for invoking acpi_dev_put() on the returned device.
978 return adev ? to_acpi_device(get_device(&adev->dev)) : NULL; in acpi_dev_get()
984 put_device(&adev->dev); in acpi_dev_put()
987 struct acpi_device *acpi_fetch_acpi_dev(acpi_handle handle);
988 struct acpi_device *acpi_get_acpi_dev(acpi_handle handle);
997 int acpi_scan_add_dep(acpi_handle handle, struct acpi_handle_list *dep_devices);
998 u32 arch_acpi_add_auto_dep(acpi_handle handle);