Skip to content

Commit c7add36

Browse files
jwrdegoederafaeljw
authored andcommitted
ACPI: video: Drop should_check_lcd_flag()
Since commit 3dbc80a ("ACPI: video: Make backlight class device registration a separate step (v2)") acpi_video# backlights are no longer automatically registered. Instead they now only get registered when the GPU/KMS driver calls acpi_video_register_backlight() which it only does when it has detected an internal LCD panel. This fixes the issue of sometimes a non-working acpi_video# backlight showing up on Desktops / HDMI-sticks without an internal LCD display in a more complete and robust manner then the LCD flag check which gets enabled by the should_check_lcd_flag() helper does. Therefor the should_check_lcd_flag() helper is no longer necessary. The lcd_only flag itself is still necessary to only register a single backlight device (for the right output) on the ESPRIMO Mobile M9410 which has 2 ACPI video connector nodes with a _BCM control method, which is the issue for which the flag was originally introduced in commit e50b9be ("ACPI / video: only register backlight for LCD device"). Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 5230488 commit c7add36

File tree

1 file changed

+1
-55
lines changed

1 file changed

+1
-55
lines changed

drivers/acpi/acpi_video.c

Lines changed: 1 addition & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ MODULE_PARM_DESC(hw_changes_brightness,
6767
static bool device_id_scheme = false;
6868
module_param(device_id_scheme, bool, 0444);
6969

70-
static int only_lcd = -1;
70+
static int only_lcd;
7171
module_param(only_lcd, int, 0444);
7272

7373
static bool may_report_brightness_keys;
@@ -2141,57 +2141,6 @@ static int __init intel_opregion_present(void)
21412141
return opregion;
21422142
}
21432143

2144-
/* Check if the chassis-type indicates there is no builtin LCD panel */
2145-
static bool dmi_is_desktop(void)
2146-
{
2147-
const char *chassis_type;
2148-
unsigned long type;
2149-
2150-
chassis_type = dmi_get_system_info(DMI_CHASSIS_TYPE);
2151-
if (!chassis_type)
2152-
return false;
2153-
2154-
if (kstrtoul(chassis_type, 10, &type) != 0)
2155-
return false;
2156-
2157-
switch (type) {
2158-
case 0x03: /* Desktop */
2159-
case 0x04: /* Low Profile Desktop */
2160-
case 0x05: /* Pizza Box */
2161-
case 0x06: /* Mini Tower */
2162-
case 0x07: /* Tower */
2163-
case 0x10: /* Lunch Box */
2164-
case 0x11: /* Main Server Chassis */
2165-
return true;
2166-
}
2167-
2168-
return false;
2169-
}
2170-
2171-
/*
2172-
* We're seeing a lot of bogus backlight interfaces on newer machines
2173-
* without a LCD such as desktops, servers and HDMI sticks. Checking the
2174-
* lcd flag fixes this, enable this by default on any machines which are:
2175-
* 1. Win8 ready (where we also prefer the native backlight driver, so
2176-
* normally the acpi_video code should not register there anyways); *and*
2177-
* 2.1 Report a desktop/server DMI chassis-type, or
2178-
* 2.2 Are an ACPI-reduced-hardware platform (and thus won't use the EC for
2179-
backlight control)
2180-
*/
2181-
static bool should_check_lcd_flag(void)
2182-
{
2183-
if (!acpi_osi_is_win8())
2184-
return false;
2185-
2186-
if (dmi_is_desktop())
2187-
return true;
2188-
2189-
if (acpi_reduced_hardware())
2190-
return true;
2191-
2192-
return false;
2193-
}
2194-
21952144
int acpi_video_register(void)
21962145
{
21972146
int ret = 0;
@@ -2205,9 +2154,6 @@ int acpi_video_register(void)
22052154
goto leave;
22062155
}
22072156

2208-
if (only_lcd == -1)
2209-
only_lcd = should_check_lcd_flag();
2210-
22112157
dmi_check_system(video_dmi_table);
22122158

22132159
ret = acpi_bus_register_driver(&acpi_video_bus);

0 commit comments

Comments
 (0)