Skip to content

Commit cd8e468

Browse files
jwrdegoederafaeljw
authored andcommitted
ACPI: video: Add Dell UART backlight controller detection
Dell All In One (AIO) models released after 2017 use a backlight controller board connected to an UART. In DSDT this uart port will be defined as: Name (_HID, "DELL0501") Name (_CID, EisaId ("PNP0501") Commit 484bae9 ("platform/x86: Add new Dell UART backlight driver") has added support for this, but I neglected to tie this into acpi_video_get_backlight_type(). Now the first AIO has turned up which has not only the DSDT bits for this, but also an actual controller attached to the UART, yet it is not using this controller for backlight control. Add support to acpi_video_get_backlight_type() for a new dell_uart backlight type. So that the existing infra to override the backlight control method on the commandline or with DMI quirks can be used. Fixes: 484bae9 ("platform/x86: Add new Dell UART backlight driver") Cc: All applicable <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 47ac09b commit cd8e468

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

drivers/acpi/video_detect.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ static void acpi_video_parse_cmdline(void)
5454
acpi_backlight_cmdline = acpi_backlight_nvidia_wmi_ec;
5555
if (!strcmp("apple_gmux", acpi_video_backlight_string))
5656
acpi_backlight_cmdline = acpi_backlight_apple_gmux;
57+
if (!strcmp("dell_uart", acpi_video_backlight_string))
58+
acpi_backlight_cmdline = acpi_backlight_dell_uart;
5759
if (!strcmp("none", acpi_video_backlight_string))
5860
acpi_backlight_cmdline = acpi_backlight_none;
5961
}
@@ -918,6 +920,7 @@ enum acpi_backlight_type __acpi_video_get_backlight_type(bool native, bool *auto
918920
static DEFINE_MUTEX(init_mutex);
919921
static bool nvidia_wmi_ec_present;
920922
static bool apple_gmux_present;
923+
static bool dell_uart_present;
921924
static bool native_available;
922925
static bool init_done;
923926
static long video_caps;
@@ -932,6 +935,7 @@ enum acpi_backlight_type __acpi_video_get_backlight_type(bool native, bool *auto
932935
&video_caps, NULL);
933936
nvidia_wmi_ec_present = nvidia_wmi_ec_supported();
934937
apple_gmux_present = apple_gmux_detect(NULL, NULL);
938+
dell_uart_present = acpi_dev_present("DELL0501", NULL, -1);
935939
init_done = true;
936940
}
937941
if (native)
@@ -962,6 +966,9 @@ enum acpi_backlight_type __acpi_video_get_backlight_type(bool native, bool *auto
962966
if (apple_gmux_present)
963967
return acpi_backlight_apple_gmux;
964968

969+
if (dell_uart_present)
970+
return acpi_backlight_dell_uart;
971+
965972
/* Use ACPI video if available, except when native should be preferred. */
966973
if ((video_caps & ACPI_VIDEO_BACKLIGHT) &&
967974
!(native_available && prefer_native_over_acpi_video()))

include/acpi/video.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ enum acpi_backlight_type {
5050
acpi_backlight_native,
5151
acpi_backlight_nvidia_wmi_ec,
5252
acpi_backlight_apple_gmux,
53+
acpi_backlight_dell_uart,
5354
};
5455

5556
#if IS_ENABLED(CONFIG_ACPI_VIDEO)

0 commit comments

Comments
 (0)