Skip to content

Commit 8167e00

Browse files
committed
Merge branches 'acpi-video' and 'acpi-x86'
* acpi-video: ACPI / video: Extend chassis-type detection with a "Lunch Box" check ACPI / video: Refactor and fix dmi_is_desktop() * acpi-x86: ACPI / x86: Make PWM2 device always present at Lenovo Yoga Book
3 parents dcaed59 + d693c00 + ff6cdfd commit 8167e00

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

drivers/acpi/acpi_video.c

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2124,21 +2124,29 @@ static int __init intel_opregion_present(void)
21242124
return opregion;
21252125
}
21262126

2127+
/* Check if the chassis-type indicates there is no builtin LCD panel */
21272128
static bool dmi_is_desktop(void)
21282129
{
21292130
const char *chassis_type;
2131+
unsigned long type;
21302132

21312133
chassis_type = dmi_get_system_info(DMI_CHASSIS_TYPE);
21322134
if (!chassis_type)
21332135
return false;
21342136

2135-
if (!strcmp(chassis_type, "3") || /* 3: Desktop */
2136-
!strcmp(chassis_type, "4") || /* 4: Low Profile Desktop */
2137-
!strcmp(chassis_type, "5") || /* 5: Pizza Box */
2138-
!strcmp(chassis_type, "6") || /* 6: Mini Tower */
2139-
!strcmp(chassis_type, "7") || /* 7: Tower */
2140-
!strcmp(chassis_type, "11")) /* 11: Main Server Chassis */
2137+
if (kstrtoul(chassis_type, 10, &type) != 0)
2138+
return false;
2139+
2140+
switch (type) {
2141+
case 0x03: /* Desktop */
2142+
case 0x04: /* Low Profile Desktop */
2143+
case 0x05: /* Pizza Box */
2144+
case 0x06: /* Mini Tower */
2145+
case 0x07: /* Tower */
2146+
case 0x10: /* Lunch Box */
2147+
case 0x11: /* Main Server Chassis */
21412148
return true;
2149+
}
21422150

21432151
return false;
21442152
}

drivers/acpi/x86/utils.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ static const struct always_present_id always_present_ids[] = {
5656
*/
5757
ENTRY("80860F09", "1", ICPU(INTEL_FAM6_ATOM_SILVERMONT), {}),
5858
ENTRY("80862288", "1", ICPU(INTEL_FAM6_ATOM_AIRMONT), {}),
59+
60+
/* Lenovo Yoga Book uses PWM2 for keyboard backlight control */
61+
ENTRY("80862289", "2", ICPU(INTEL_FAM6_ATOM_AIRMONT), {
62+
DMI_MATCH(DMI_PRODUCT_NAME, "Lenovo YB1-X9"),
63+
}),
5964
/*
6065
* The INT0002 device is necessary to clear wakeup interrupt sources
6166
* on Cherry Trail devices, without it we get nobody cared IRQ msgs.

0 commit comments

Comments
 (0)