Merge branches 'acpi-processor', 'acpi-x86' and 'acpi-video'

Merge and ACPI processor driver update, ACPI x86-specific code updates,
and an ACPI backlight (video) driver quirk for 6.13-rc1:

 - Rearrange the processor_perflib code in the ACPI processor driver
   to avoid compiling x86-specific code on other architectures (Arnd
   Bergmann).

 - Add adev NULL check to acpi_quirk_skip_serdev_enumeration() and
   make UART skip quirks work on PCI UARTs without an UID (Hans de
   Goede).

 - Force native backlight handling Apple MacbookPro11,2 and Air7,2 in
   the ACPI video driver (Jonathan Denose).

* acpi-processor:
  ACPI: processor_perflib: extend X86 dependency

* acpi-x86:
  ACPI: x86: Add adev NULL check to acpi_quirk_skip_serdev_enumeration()
  ACPI: x86: Make UART skip quirks work on PCI UARTs without an UID

* acpi-video:
  ACPI: video: force native for Apple MacbookPro11,2 and Air7,2
This commit is contained in:
Rafael J. Wysocki 2024-11-15 20:46:13 +01:00
commit 563c87f58f
3 changed files with 62 additions and 18 deletions

View File

@ -24,8 +24,6 @@
#define ACPI_PROCESSOR_FILE_PERFORMANCE "performance" #define ACPI_PROCESSOR_FILE_PERFORMANCE "performance"
static DEFINE_MUTEX(performance_mutex);
/* /*
* _PPC support is implemented as a CPUfreq policy notifier: * _PPC support is implemented as a CPUfreq policy notifier:
* This means each time a CPUfreq driver registered also with * This means each time a CPUfreq driver registered also with
@ -209,6 +207,10 @@ void acpi_processor_ppc_exit(struct cpufreq_policy *policy)
} }
} }
#ifdef CONFIG_X86
static DEFINE_MUTEX(performance_mutex);
static int acpi_processor_get_performance_control(struct acpi_processor *pr) static int acpi_processor_get_performance_control(struct acpi_processor *pr)
{ {
int result = 0; int result = 0;
@ -267,7 +269,6 @@ end:
return result; return result;
} }
#ifdef CONFIG_X86
/* /*
* Some AMDs have 50MHz frequency multiples, but only provide 100MHz rounding * Some AMDs have 50MHz frequency multiples, but only provide 100MHz rounding
* in their ACPI data. Calculate the real values and fix up the _PSS data. * in their ACPI data. Calculate the real values and fix up the _PSS data.
@ -298,9 +299,6 @@ static void amd_fixup_frequency(struct acpi_processor_px *px, int i)
px->core_frequency = (100 * (fid + 8)) >> did; px->core_frequency = (100 * (fid + 8)) >> did;
} }
} }
#else
static void amd_fixup_frequency(struct acpi_processor_px *px, int i) {};
#endif
static int acpi_processor_get_performance_states(struct acpi_processor *pr) static int acpi_processor_get_performance_states(struct acpi_processor *pr)
{ {
@ -440,13 +438,11 @@ int acpi_processor_get_performance_info(struct acpi_processor *pr)
* the BIOS is older than the CPU and does not know its frequencies * the BIOS is older than the CPU and does not know its frequencies
*/ */
update_bios: update_bios:
#ifdef CONFIG_X86
if (acpi_has_method(pr->handle, "_PPC")) { if (acpi_has_method(pr->handle, "_PPC")) {
if(boot_cpu_has(X86_FEATURE_EST)) if(boot_cpu_has(X86_FEATURE_EST))
pr_warn(FW_BUG "BIOS needs update for CPU " pr_warn(FW_BUG "BIOS needs update for CPU "
"frequency support\n"); "frequency support\n");
} }
#endif
return result; return result;
} }
EXPORT_SYMBOL_GPL(acpi_processor_get_performance_info); EXPORT_SYMBOL_GPL(acpi_processor_get_performance_info);
@ -788,3 +784,4 @@ unlock:
mutex_unlock(&performance_mutex); mutex_unlock(&performance_mutex);
} }
EXPORT_SYMBOL(acpi_processor_unregister_performance); EXPORT_SYMBOL(acpi_processor_unregister_performance);
#endif

View File

@ -549,6 +549,14 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "iMac12,2"), DMI_MATCH(DMI_PRODUCT_NAME, "iMac12,2"),
}, },
}, },
{
.callback = video_detect_force_native,
/* Apple MacBook Air 7,2 */
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
DMI_MATCH(DMI_PRODUCT_NAME, "MacBookAir7,2"),
},
},
{ {
.callback = video_detect_force_native, .callback = video_detect_force_native,
/* Apple MacBook Air 9,1 */ /* Apple MacBook Air 9,1 */
@ -565,6 +573,14 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro9,2"), DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro9,2"),
}, },
}, },
{
.callback = video_detect_force_native,
/* Apple MacBook Pro 11,2 */
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro11,2"),
},
},
{ {
/* https://bugzilla.redhat.com/show_bug.cgi?id=1217249 */ /* https://bugzilla.redhat.com/show_bug.cgi?id=1217249 */
.callback = video_detect_force_native, .callback = video_detect_force_native,

View File

@ -12,6 +12,7 @@
#include <linux/acpi.h> #include <linux/acpi.h>
#include <linux/dmi.h> #include <linux/dmi.h>
#include <linux/pci.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <asm/cpu_device_id.h> #include <asm/cpu_device_id.h>
#include <asm/intel-family.h> #include <asm/intel-family.h>
@ -391,6 +392,19 @@ static const struct dmi_system_id acpi_quirk_skip_dmi_ids[] = {
.driver_data = (void *)(ACPI_QUIRK_SKIP_I2C_CLIENTS | .driver_data = (void *)(ACPI_QUIRK_SKIP_I2C_CLIENTS |
ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY), ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY),
}, },
{
/* Vexia Edu Atla 10 tablet 9V version */
.matches = {
DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
DMI_MATCH(DMI_BOARD_NAME, "Aptio CRB"),
/* Above strings are too generic, also match on BIOS date */
DMI_MATCH(DMI_BIOS_DATE, "08/25/2014"),
},
.driver_data = (void *)(ACPI_QUIRK_SKIP_I2C_CLIENTS |
ACPI_QUIRK_UART1_SKIP |
ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY |
ACPI_QUIRK_SKIP_GPIO_EVENT_HANDLERS),
},
{ {
/* Whitelabel (sold as various brands) TM800A550L */ /* Whitelabel (sold as various brands) TM800A550L */
.matches = { .matches = {
@ -439,18 +453,35 @@ static int acpi_dmi_skip_serdev_enumeration(struct device *controller_parent, bo
struct acpi_device *adev = ACPI_COMPANION(controller_parent); struct acpi_device *adev = ACPI_COMPANION(controller_parent);
const struct dmi_system_id *dmi_id; const struct dmi_system_id *dmi_id;
long quirks = 0; long quirks = 0;
u64 uid; u64 uid = 0;
int ret;
ret = acpi_dev_uid_to_integer(adev, &uid);
if (ret)
return 0;
dmi_id = dmi_first_match(acpi_quirk_skip_dmi_ids); dmi_id = dmi_first_match(acpi_quirk_skip_dmi_ids);
if (dmi_id) if (!dmi_id)
quirks = (unsigned long)dmi_id->driver_data; return 0;
if (!dev_is_platform(controller_parent)) { quirks = (unsigned long)dmi_id->driver_data;
/* uid is left at 0 on errors and 0 is not a valid UART UID */
acpi_dev_uid_to_integer(adev, &uid);
/* For PCI UARTs without an UID */
if (!uid && dev_is_pci(controller_parent)) {
struct pci_dev *pdev = to_pci_dev(controller_parent);
/*
* Devfn values for PCI UARTs on Bay Trail SoCs, which are
* the only devices where this fallback is necessary.
*/
if (pdev->devfn == PCI_DEVFN(0x1e, 3))
uid = 1;
else if (pdev->devfn == PCI_DEVFN(0x1e, 4))
uid = 2;
}
if (!uid)
return 0;
if (!dev_is_platform(controller_parent) && !dev_is_pci(controller_parent)) {
/* PNP enumerated UARTs */ /* PNP enumerated UARTs */
if ((quirks & ACPI_QUIRK_PNP_UART1_SKIP) && uid == 1) if ((quirks & ACPI_QUIRK_PNP_UART1_SKIP) && uid == 1)
*skip = true; *skip = true;
@ -505,7 +536,7 @@ int acpi_quirk_skip_serdev_enumeration(struct device *controller_parent, bool *s
* Set skip to true so that the tty core creates a serdev ctrl device. * Set skip to true so that the tty core creates a serdev ctrl device.
* The backlight driver will manually create the serdev client device. * The backlight driver will manually create the serdev client device.
*/ */
if (acpi_dev_hid_match(adev, "DELL0501")) { if (adev && acpi_dev_hid_match(adev, "DELL0501")) {
*skip = true; *skip = true;
/* /*
* Create a platform dev for dell-uart-backlight to bind to. * Create a platform dev for dell-uart-backlight to bind to.