.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * acpi_bus.c - ACPI Bus Driver ($Revision: 80 $) |
---|
3 | 4 | * |
---|
4 | 5 | * 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 | | - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
19 | 6 | */ |
---|
20 | 7 | |
---|
21 | 8 | #include <linux/module.h> |
---|
.. | .. |
---|
111 | 98 | acpi_status status; |
---|
112 | 99 | unsigned long long sta; |
---|
113 | 100 | |
---|
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); |
---|
116 | 103 | return 0; |
---|
117 | 104 | } |
---|
118 | 105 | |
---|
.. | .. |
---|
316 | 303 | capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_HOTPLUG_OST_SUPPORT; |
---|
317 | 304 | capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_PCLPI_SUPPORT; |
---|
318 | 305 | |
---|
| 306 | +#ifdef CONFIG_ARM64 |
---|
| 307 | + capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_GENERIC_INITIATOR_SUPPORT; |
---|
| 308 | +#endif |
---|
319 | 309 | #ifdef CONFIG_X86 |
---|
| 310 | + capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_GENERIC_INITIATOR_SUPPORT; |
---|
320 | 311 | if (boot_cpu_has(X86_FEATURE_HWP)) { |
---|
321 | 312 | capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_CPC_SUPPORT; |
---|
322 | 313 | capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_CPCV2_SUPPORT; |
---|
.. | .. |
---|
564 | 555 | mutex_unlock(physical_node_lock); |
---|
565 | 556 | return phys_dev; |
---|
566 | 557 | } |
---|
| 558 | +EXPORT_SYMBOL_GPL(acpi_get_first_physical_node); |
---|
567 | 559 | |
---|
568 | 560 | static struct acpi_device *acpi_primary_dev_companion(struct acpi_device *adev, |
---|
569 | 561 | const struct device *dev) |
---|
.. | .. |
---|
799 | 791 | } |
---|
800 | 792 | EXPORT_SYMBOL_GPL(acpi_match_device); |
---|
801 | 793 | |
---|
| 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 | + |
---|
802 | 805 | const void *acpi_device_get_match_data(const struct device *dev) |
---|
803 | 806 | { |
---|
804 | 807 | const struct acpi_device_id *match; |
---|
| 808 | + |
---|
| 809 | + if (!dev->driver->acpi_match_table) |
---|
| 810 | + return acpi_of_device_get_match_data(dev); |
---|
805 | 811 | |
---|
806 | 812 | match = acpi_match_device(dev->driver->acpi_match_table, dev); |
---|
807 | 813 | if (!match) |
---|
.. | .. |
---|
1237 | 1243 | acpi_kobj = NULL; |
---|
1238 | 1244 | } |
---|
1239 | 1245 | |
---|
1240 | | - init_acpi_device_notify(); |
---|
1241 | 1246 | result = acpi_bus_init(); |
---|
1242 | 1247 | if (result) { |
---|
1243 | 1248 | kobject_put(acpi_kobj); |
---|