Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 484bae9e4d6a ("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: 484bae9e4d6a ("platform/x86: Add new Dell UART backlight driver")
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://patch.msgid.link/20240814190159.15650-2-hdegoede@redhat.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Hans de Goede and committed by
Rafael J. Wysocki
cd8e468e 47ac09b9

+8
+7
drivers/acpi/video_detect.c
··· 54 54 acpi_backlight_cmdline = acpi_backlight_nvidia_wmi_ec; 55 55 if (!strcmp("apple_gmux", acpi_video_backlight_string)) 56 56 acpi_backlight_cmdline = acpi_backlight_apple_gmux; 57 + if (!strcmp("dell_uart", acpi_video_backlight_string)) 58 + acpi_backlight_cmdline = acpi_backlight_dell_uart; 57 59 if (!strcmp("none", acpi_video_backlight_string)) 58 60 acpi_backlight_cmdline = acpi_backlight_none; 59 61 } ··· 920 918 static DEFINE_MUTEX(init_mutex); 921 919 static bool nvidia_wmi_ec_present; 922 920 static bool apple_gmux_present; 921 + static bool dell_uart_present; 923 922 static bool native_available; 924 923 static bool init_done; 925 924 static long video_caps; ··· 935 932 &video_caps, NULL); 936 933 nvidia_wmi_ec_present = nvidia_wmi_ec_supported(); 937 934 apple_gmux_present = apple_gmux_detect(NULL, NULL); 935 + dell_uart_present = acpi_dev_present("DELL0501", NULL, -1); 938 936 init_done = true; 939 937 } 940 938 if (native) ··· 965 961 966 962 if (apple_gmux_present) 967 963 return acpi_backlight_apple_gmux; 964 + 965 + if (dell_uart_present) 966 + return acpi_backlight_dell_uart; 968 967 969 968 /* Use ACPI video if available, except when native should be preferred. */ 970 969 if ((video_caps & ACPI_VIDEO_BACKLIGHT) &&
+1
include/acpi/video.h
··· 50 50 acpi_backlight_native, 51 51 acpi_backlight_nvidia_wmi_ec, 52 52 acpi_backlight_apple_gmux, 53 + acpi_backlight_dell_uart, 53 54 }; 54 55 55 56 #if IS_ENABLED(CONFIG_ACPI_VIDEO)