Skip to content

Commit 563c87f

Browse files
committed
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
4 parents 1c58e3a + 2076cba + 4a49194 + 2959918 commit 563c87f

File tree

3 files changed

+61
-17
lines changed

3 files changed

+61
-17
lines changed

drivers/acpi/processor_perflib.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424

2525
#define ACPI_PROCESSOR_FILE_PERFORMANCE "performance"
2626

27-
static DEFINE_MUTEX(performance_mutex);
28-
2927
/*
3028
* _PPC support is implemented as a CPUfreq policy notifier:
3129
* This means each time a CPUfreq driver registered also with
@@ -209,6 +207,10 @@ void acpi_processor_ppc_exit(struct cpufreq_policy *policy)
209207
}
210208
}
211209

210+
#ifdef CONFIG_X86
211+
212+
static DEFINE_MUTEX(performance_mutex);
213+
212214
static int acpi_processor_get_performance_control(struct acpi_processor *pr)
213215
{
214216
int result = 0;
@@ -267,7 +269,6 @@ static int acpi_processor_get_performance_control(struct acpi_processor *pr)
267269
return result;
268270
}
269271

270-
#ifdef CONFIG_X86
271272
/*
272273
* Some AMDs have 50MHz frequency multiples, but only provide 100MHz rounding
273274
* 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)
298299
px->core_frequency = (100 * (fid + 8)) >> did;
299300
}
300301
}
301-
#else
302-
static void amd_fixup_frequency(struct acpi_processor_px *px, int i) {};
303-
#endif
304302

305303
static int acpi_processor_get_performance_states(struct acpi_processor *pr)
306304
{
@@ -440,13 +438,11 @@ int acpi_processor_get_performance_info(struct acpi_processor *pr)
440438
* the BIOS is older than the CPU and does not know its frequencies
441439
*/
442440
update_bios:
443-
#ifdef CONFIG_X86
444441
if (acpi_has_method(pr->handle, "_PPC")) {
445442
if(boot_cpu_has(X86_FEATURE_EST))
446443
pr_warn(FW_BUG "BIOS needs update for CPU "
447444
"frequency support\n");
448445
}
449-
#endif
450446
return result;
451447
}
452448
EXPORT_SYMBOL_GPL(acpi_processor_get_performance_info);
@@ -788,3 +784,4 @@ void acpi_processor_unregister_performance(unsigned int cpu)
788784
mutex_unlock(&performance_mutex);
789785
}
790786
EXPORT_SYMBOL(acpi_processor_unregister_performance);
787+
#endif

drivers/acpi/video_detect.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,14 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
549549
DMI_MATCH(DMI_PRODUCT_NAME, "iMac12,2"),
550550
},
551551
},
552+
{
553+
.callback = video_detect_force_native,
554+
/* Apple MacBook Air 7,2 */
555+
.matches = {
556+
DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
557+
DMI_MATCH(DMI_PRODUCT_NAME, "MacBookAir7,2"),
558+
},
559+
},
552560
{
553561
.callback = video_detect_force_native,
554562
/* Apple MacBook Air 9,1 */
@@ -565,6 +573,14 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
565573
DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro9,2"),
566574
},
567575
},
576+
{
577+
.callback = video_detect_force_native,
578+
/* Apple MacBook Pro 11,2 */
579+
.matches = {
580+
DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
581+
DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro11,2"),
582+
},
583+
},
568584
{
569585
/* https://bugzilla.redhat.com/show_bug.cgi?id=1217249 */
570586
.callback = video_detect_force_native,

drivers/acpi/x86/utils.c

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
#include <linux/acpi.h>
1414
#include <linux/dmi.h>
15+
#include <linux/pci.h>
1516
#include <linux/platform_device.h>
1617
#include <asm/cpu_device_id.h>
1718
#include <asm/intel-family.h>
@@ -391,6 +392,19 @@ static const struct dmi_system_id acpi_quirk_skip_dmi_ids[] = {
391392
.driver_data = (void *)(ACPI_QUIRK_SKIP_I2C_CLIENTS |
392393
ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY),
393394
},
395+
{
396+
/* Vexia Edu Atla 10 tablet 9V version */
397+
.matches = {
398+
DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
399+
DMI_MATCH(DMI_BOARD_NAME, "Aptio CRB"),
400+
/* Above strings are too generic, also match on BIOS date */
401+
DMI_MATCH(DMI_BIOS_DATE, "08/25/2014"),
402+
},
403+
.driver_data = (void *)(ACPI_QUIRK_SKIP_I2C_CLIENTS |
404+
ACPI_QUIRK_UART1_SKIP |
405+
ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY |
406+
ACPI_QUIRK_SKIP_GPIO_EVENT_HANDLERS),
407+
},
394408
{
395409
/* Whitelabel (sold as various brands) TM800A550L */
396410
.matches = {
@@ -439,18 +453,35 @@ static int acpi_dmi_skip_serdev_enumeration(struct device *controller_parent, bo
439453
struct acpi_device *adev = ACPI_COMPANION(controller_parent);
440454
const struct dmi_system_id *dmi_id;
441455
long quirks = 0;
442-
u64 uid;
443-
int ret;
456+
u64 uid = 0;
444457

445-
ret = acpi_dev_uid_to_integer(adev, &uid);
446-
if (ret)
458+
dmi_id = dmi_first_match(acpi_quirk_skip_dmi_ids);
459+
if (!dmi_id)
447460
return 0;
448461

449-
dmi_id = dmi_first_match(acpi_quirk_skip_dmi_ids);
450-
if (dmi_id)
451-
quirks = (unsigned long)dmi_id->driver_data;
462+
quirks = (unsigned long)dmi_id->driver_data;
463+
464+
/* uid is left at 0 on errors and 0 is not a valid UART UID */
465+
acpi_dev_uid_to_integer(adev, &uid);
466+
467+
/* For PCI UARTs without an UID */
468+
if (!uid && dev_is_pci(controller_parent)) {
469+
struct pci_dev *pdev = to_pci_dev(controller_parent);
470+
471+
/*
472+
* Devfn values for PCI UARTs on Bay Trail SoCs, which are
473+
* the only devices where this fallback is necessary.
474+
*/
475+
if (pdev->devfn == PCI_DEVFN(0x1e, 3))
476+
uid = 1;
477+
else if (pdev->devfn == PCI_DEVFN(0x1e, 4))
478+
uid = 2;
479+
}
480+
481+
if (!uid)
482+
return 0;
452483

453-
if (!dev_is_platform(controller_parent)) {
484+
if (!dev_is_platform(controller_parent) && !dev_is_pci(controller_parent)) {
454485
/* PNP enumerated UARTs */
455486
if ((quirks & ACPI_QUIRK_PNP_UART1_SKIP) && uid == 1)
456487
*skip = true;
@@ -505,7 +536,7 @@ int acpi_quirk_skip_serdev_enumeration(struct device *controller_parent, bool *s
505536
* Set skip to true so that the tty core creates a serdev ctrl device.
506537
* The backlight driver will manually create the serdev client device.
507538
*/
508-
if (acpi_dev_hid_match(adev, "DELL0501")) {
539+
if (adev && acpi_dev_hid_match(adev, "DELL0501")) {
509540
*skip = true;
510541
/*
511542
* Create a platform dev for dell-uart-backlight to bind to.

0 commit comments

Comments
 (0)