hc
2024-01-31 f9004dbfff8a3fbbd7e2a88c8a4327c7f2f8e5b2
kernel/include/acpi/acpi_bus.h
....@@ -1,22 +1,9 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * acpi_bus.h - ACPI Bus Driver ($Revision: 22 $)
34 *
45 * Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
56 * Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
6
- *
7
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8
- *
9
- * This program is free software; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License as published by
11
- * the Free Software Foundation; either version 2 of the License, or (at
12
- * your option) any later version.
13
- *
14
- * This program is distributed in the hope that it will be useful, but
15
- * WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
- * General Public License for more details.
18
- *
19
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
207 */
218
229 #ifndef __ACPI_BUS_H__
....@@ -57,6 +44,7 @@
5744 u64 arg);
5845 acpi_status acpi_evaluate_ej0(acpi_handle handle);
5946 acpi_status acpi_evaluate_lck(acpi_handle handle, int lock);
47
+acpi_status acpi_evaluate_reg(acpi_handle handle, u8 space_id, u32 function);
6048 bool acpi_ata_match(acpi_handle handle);
6149 bool acpi_bay_match(acpi_handle handle);
6250 bool acpi_dock_match(acpi_handle handle);
....@@ -91,12 +79,9 @@
9179 bool acpi_dev_found(const char *hid);
9280 bool acpi_dev_present(const char *hid, const char *uid, s64 hrv);
9381
94
-const char *
95
-acpi_dev_get_first_match_name(const char *hid, const char *uid, s64 hrv);
96
-
9782 #ifdef CONFIG_ACPI
9883
99
-#include <linux/proc_fs.h>
84
+struct proc_dir_entry;
10085
10186 #define ACPI_BUS_FILE_ROOT "acpi"
10287 extern struct proc_dir_entry *acpi_root_dir;
....@@ -230,7 +215,7 @@
230215 /* Plug and Play */
231216
232217 typedef char acpi_bus_id[8];
233
-typedef unsigned long acpi_bus_address;
218
+typedef u64 acpi_bus_address;
234219 typedef char acpi_device_name[40];
235220 typedef char acpi_device_class[20];
236221
....@@ -347,10 +332,16 @@
347332 bool put_online:1;
348333 };
349334
335
+struct acpi_device_properties {
336
+ const guid_t *guid;
337
+ const union acpi_object *properties;
338
+ struct list_head list;
339
+};
340
+
350341 /* ACPI Device Specific Data (_DSD) */
351342 struct acpi_device_data {
352343 const union acpi_object *pointer;
353
- const union acpi_object *properties;
344
+ struct list_head properties;
354345 const union acpi_object *of_compatible;
355346 struct list_head subnodes;
356347 };
....@@ -514,13 +505,16 @@
514505
515506 int acpi_bus_set_power(acpi_handle handle, int state);
516507 const char *acpi_power_state_string(int state);
517
-int acpi_device_get_power(struct acpi_device *device, int *state);
518508 int acpi_device_set_power(struct acpi_device *device, int state);
519509 int acpi_bus_init_power(struct acpi_device *device);
520510 int acpi_device_fix_up_power(struct acpi_device *device);
521511 int acpi_bus_update_power(acpi_handle handle, int *state_p);
522512 int acpi_device_update_power(struct acpi_device *device, int *state_p);
523513 bool acpi_bus_power_manageable(acpi_handle handle);
514
+int acpi_device_power_add_dependent(struct acpi_device *adev,
515
+ struct device *dev);
516
+void acpi_device_power_remove_dependent(struct acpi_device *adev,
517
+ struct device *dev);
524518
525519 #ifdef CONFIG_PM
526520 bool acpi_bus_can_wakeup(acpi_handle handle);
....@@ -595,9 +589,13 @@
595589 enum dev_dma_attr acpi_get_dma_attr(struct acpi_device *adev);
596590 int acpi_dma_get_range(struct device *dev, u64 *dma_addr, u64 *offset,
597591 u64 *size);
598
-int acpi_dma_configure(struct device *dev, enum dev_dma_attr attr);
599
-void acpi_dma_deconfigure(struct device *dev);
600
-
592
+int acpi_dma_configure_id(struct device *dev, enum dev_dma_attr attr,
593
+ const u32 *input_id);
594
+static inline int acpi_dma_configure(struct device *dev,
595
+ enum dev_dma_attr attr)
596
+{
597
+ return acpi_dma_configure_id(dev, attr, NULL);
598
+}
601599 struct acpi_device *acpi_find_child_device(struct acpi_device *parent,
602600 u64 address, bool check_children);
603601 int acpi_is_root_bridge(acpi_handle);
....@@ -607,9 +605,10 @@
607605 int acpi_disable_wakeup_device_power(struct acpi_device *dev);
608606
609607 #ifdef CONFIG_X86
610
-bool acpi_device_always_present(struct acpi_device *adev);
608
+bool acpi_device_override_status(struct acpi_device *adev, unsigned long long *status);
611609 #else
612
-static inline bool acpi_device_always_present(struct acpi_device *adev)
610
+static inline bool acpi_device_override_status(struct acpi_device *adev,
611
+ unsigned long long *status)
613612 {
614613 return false;
615614 }
....@@ -655,6 +654,12 @@
655654 }
656655 #endif
657656
657
+#ifdef CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT
658
+bool acpi_sleep_state_supported(u8 sleep_state);
659
+#else
660
+static inline bool acpi_sleep_state_supported(u8 sleep_state) { return false; }
661
+#endif
662
+
658663 #ifdef CONFIG_ACPI_SLEEP
659664 u32 acpi_target_system_state(void);
660665 #else
....@@ -678,6 +683,16 @@
678683 adev->power.states[ACPI_STATE_D3_HOT].flags.explicit_set);
679684 }
680685
686
+bool acpi_dev_hid_uid_match(struct acpi_device *adev, const char *hid2, const char *uid2);
687
+
688
+struct acpi_device *
689
+acpi_dev_get_first_match_dev(const char *hid, const char *uid, s64 hrv);
690
+
691
+static inline void acpi_dev_put(struct acpi_device *adev)
692
+{
693
+ if (adev)
694
+ put_device(&adev->dev);
695
+}
681696 #else /* CONFIG_ACPI */
682697
683698 static inline int register_acpi_bus_type(void *bus) { return 0; }