hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/drivers/acpi/bus.c
....@@ -1,21 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * acpi_bus.c - ACPI Bus Driver ($Revision: 80 $)
34 *
45 * Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
5
- *
6
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7
- *
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License as published by
10
- * the Free Software Foundation; either version 2 of the License, or (at
11
- * your option) any later version.
12
- *
13
- * This program is distributed in the hope that it will be useful, but
14
- * WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
- * General Public License for more details.
17
- *
18
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
196 */
207
218 #include <linux/module.h>
....@@ -111,8 +98,8 @@
11198 acpi_status status;
11299 unsigned long long sta;
113100
114
- if (acpi_device_always_present(device)) {
115
- acpi_set_device_status(device, ACPI_STA_DEFAULT);
101
+ if (acpi_device_override_status(device, &sta)) {
102
+ acpi_set_device_status(device, sta);
116103 return 0;
117104 }
118105
....@@ -316,7 +303,11 @@
316303 capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_HOTPLUG_OST_SUPPORT;
317304 capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_PCLPI_SUPPORT;
318305
306
+#ifdef CONFIG_ARM64
307
+ capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_GENERIC_INITIATOR_SUPPORT;
308
+#endif
319309 #ifdef CONFIG_X86
310
+ capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_GENERIC_INITIATOR_SUPPORT;
320311 if (boot_cpu_has(X86_FEATURE_HWP)) {
321312 capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_CPC_SUPPORT;
322313 capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_CPCV2_SUPPORT;
....@@ -564,6 +555,7 @@
564555 mutex_unlock(physical_node_lock);
565556 return phys_dev;
566557 }
558
+EXPORT_SYMBOL_GPL(acpi_get_first_physical_node);
567559
568560 static struct acpi_device *acpi_primary_dev_companion(struct acpi_device *adev,
569561 const struct device *dev)
....@@ -799,9 +791,23 @@
799791 }
800792 EXPORT_SYMBOL_GPL(acpi_match_device);
801793
794
+static const void *acpi_of_device_get_match_data(const struct device *dev)
795
+{
796
+ struct acpi_device *adev = ACPI_COMPANION(dev);
797
+ const struct of_device_id *match = NULL;
798
+
799
+ if (!acpi_of_match_device(adev, dev->driver->of_match_table, &match))
800
+ return NULL;
801
+
802
+ return match->data;
803
+}
804
+
802805 const void *acpi_device_get_match_data(const struct device *dev)
803806 {
804807 const struct acpi_device_id *match;
808
+
809
+ if (!dev->driver->acpi_match_table)
810
+ return acpi_of_device_get_match_data(dev);
805811
806812 match = acpi_match_device(dev->driver->acpi_match_table, dev);
807813 if (!match)
....@@ -1237,7 +1243,6 @@
12371243 acpi_kobj = NULL;
12381244 }
12391245
1240
- init_acpi_device_notify();
12411246 result = acpi_bus_init();
12421247 if (result) {
12431248 kobject_put(acpi_kobj);