hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/acpi/internal.h
....@@ -1,18 +1,9 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * acpi/internal.h
34 * For use by Linux/ACPI infrastructure, not drivers
45 *
56 * Copyright (c) 2009, Intel Corporation.
6
- *
7
- * This program is free software; you can redistribute it and/or modify it
8
- * under the terms and conditions of the GNU General Public License,
9
- * version 2, as published by the Free Software Foundation.
10
- *
11
- * This program is distributed in the hope it will be useful, but WITHOUT
12
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14
- * more details.
15
- *
167 */
178
189 #ifndef _ACPI_INTERNAL_H_
....@@ -25,10 +16,14 @@
2516 int early_acpi_osi_init(void);
2617 int acpi_osi_init(void);
2718 acpi_status acpi_os_initialize1(void);
28
-void init_acpi_device_notify(void);
2919 int acpi_scan_init(void);
20
+#ifdef CONFIG_PCI
3021 void acpi_pci_root_init(void);
3122 void acpi_pci_link_init(void);
23
+#else
24
+static inline void acpi_pci_root_init(void) {}
25
+static inline void acpi_pci_link_init(void) {}
26
+#endif
3227 void acpi_processor_init(void);
3328 void acpi_platform_init(void);
3429 void acpi_pnp_init(void);
....@@ -79,7 +74,11 @@
7974 #else
8075 static inline void acpi_debugfs_init(void) { return; }
8176 #endif
77
+#ifdef CONFIG_PCI
8278 void acpi_lpss_init(void);
79
+#else
80
+static inline void acpi_lpss_init(void) {}
81
+#endif
8382
8483 void acpi_apd_init(void);
8584
....@@ -139,13 +138,20 @@
139138 void acpi_power_add_remove_device(struct acpi_device *adev, bool add);
140139 int acpi_power_wakeup_list_init(struct list_head *list, int *system_level);
141140 int acpi_device_sleep_wake(struct acpi_device *dev,
142
- int enable, int sleep_state, int dev_state);
141
+ int enable, int sleep_state, int dev_state);
143142 int acpi_power_get_inferred_state(struct acpi_device *device, int *state);
144143 int acpi_power_on_resources(struct acpi_device *device, int state);
145144 int acpi_power_transition(struct acpi_device *device, int state);
146145
146
+/* --------------------------------------------------------------------------
147
+ Device Power Management
148
+ -------------------------------------------------------------------------- */
149
+int acpi_device_get_power(struct acpi_device *device, int *state);
147150 int acpi_wakeup_device_init(void);
148151
152
+/* --------------------------------------------------------------------------
153
+ Processor
154
+ -------------------------------------------------------------------------- */
149155 #ifdef CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC
150156 void acpi_early_processor_set_pdc(void);
151157 #else
....@@ -163,7 +169,8 @@
163169 -------------------------------------------------------------------------- */
164170 struct acpi_ec {
165171 acpi_handle handle;
166
- u32 gpe;
172
+ int gpe;
173
+ int irq;
167174 unsigned long command_addr;
168175 unsigned long data_addr;
169176 bool global_lock;
....@@ -177,6 +184,8 @@
177184 struct work_struct work;
178185 unsigned long timestamp;
179186 unsigned long nr_pending_queries;
187
+ unsigned int events_in_progress;
188
+ unsigned int queries_in_progress;
180189 bool busy_polling;
181190 unsigned int polling_guard;
182191 };
....@@ -187,14 +196,11 @@
187196 /* External interfaces use first EC only, so remember */
188197 typedef int (*acpi_ec_query_func) (void *data);
189198
190
-int acpi_ec_init(void);
191
-int acpi_ec_ecdt_probe(void);
192
-int acpi_ec_dsdt_probe(void);
199
+void acpi_ec_init(void);
200
+void acpi_ec_ecdt_probe(void);
201
+void acpi_ec_dsdt_probe(void);
193202 void acpi_ec_block_transactions(void);
194203 void acpi_ec_unblock_transactions(void);
195
-void acpi_ec_mark_gpe_for_wake(void);
196
-void acpi_ec_set_gpe_wake_mask(u8 action);
197
-void acpi_ec_dispatch_gpe(void);
198204 int acpi_ec_add_query_handler(struct acpi_ec *ec, u8 query_bit,
199205 acpi_handle handle, acpi_ec_query_func func,
200206 void *data);
....@@ -202,6 +208,7 @@
202208
203209 #ifdef CONFIG_PM_SLEEP
204210 void acpi_ec_flush_work(void);
211
+bool acpi_ec_dispatch_gpe(void);
205212 #endif
206213
207214
....@@ -210,11 +217,9 @@
210217 -------------------------------------------------------------------------- */
211218 #ifdef CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT
212219 extern bool acpi_s2idle_wakeup(void);
213
-extern bool acpi_sleep_no_ec_events(void);
214220 extern int acpi_sleep_init(void);
215221 #else
216222 static inline bool acpi_s2idle_wakeup(void) { return false; }
217
-static inline bool acpi_sleep_no_ec_events(void) { return true; }
218223 static inline int acpi_sleep_init(void) { return -ENXIO; }
219224 #endif
220225