diff options
| -rw-r--r-- | drivers/acpi/acpi_video.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video.c index f0b52266b3ac..1ab1460c4a4e 100644 --- a/drivers/acpi/acpi_video.c +++ b/drivers/acpi/acpi_video.c | |||
| @@ -2124,21 +2124,28 @@ static int __init intel_opregion_present(void) | |||
| 2124 | return opregion; | 2124 | return opregion; |
| 2125 | } | 2125 | } |
| 2126 | 2126 | ||
| 2127 | /* Check if the chassis-type indicates there is no builtin LCD panel */ | ||
| 2127 | static bool dmi_is_desktop(void) | 2128 | static bool dmi_is_desktop(void) |
| 2128 | { | 2129 | { |
| 2129 | const char *chassis_type; | 2130 | const char *chassis_type; |
| 2131 | unsigned long type; | ||
| 2130 | 2132 | ||
| 2131 | chassis_type = dmi_get_system_info(DMI_CHASSIS_TYPE); | 2133 | chassis_type = dmi_get_system_info(DMI_CHASSIS_TYPE); |
| 2132 | if (!chassis_type) | 2134 | if (!chassis_type) |
| 2133 | return false; | 2135 | return false; |
| 2134 | 2136 | ||
| 2135 | if (!strcmp(chassis_type, "3") || /* 3: Desktop */ | 2137 | if (kstrtoul(chassis_type, 10, &type) != 0) |
| 2136 | !strcmp(chassis_type, "4") || /* 4: Low Profile Desktop */ | 2138 | return false; |
| 2137 | !strcmp(chassis_type, "5") || /* 5: Pizza Box */ | 2139 | |
| 2138 | !strcmp(chassis_type, "6") || /* 6: Mini Tower */ | 2140 | switch (type) { |
| 2139 | !strcmp(chassis_type, "7") || /* 7: Tower */ | 2141 | case 0x03: /* Desktop */ |
| 2140 | !strcmp(chassis_type, "11")) /* 11: Main Server Chassis */ | 2142 | case 0x04: /* Low Profile Desktop */ |
| 2143 | case 0x05: /* Pizza Box */ | ||
| 2144 | case 0x06: /* Mini Tower */ | ||
| 2145 | case 0x07: /* Tower */ | ||
| 2146 | case 0x11: /* Main Server Chassis */ | ||
| 2141 | return true; | 2147 | return true; |
| 2148 | } | ||
| 2142 | 2149 | ||
| 2143 | return false; | 2150 | return false; |
| 2144 | } | 2151 | } |
