ACPI: video: Add Dell UART backlight controller detection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Hans de Goede <hdegoede@xxxxxxxxxx>

commit cd8e468efb4fb2742e06328a75b282c35c1abf8d upstream.

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@xxxxxxxxxxxxxxx>
Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx>
Reviewed-by: Andy Shevchenko <andy@xxxxxxxxxx>
Link: https://patch.msgid.link/20240814190159.15650-2-hdegoede@xxxxxxxxxx
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/acpi/video_detect.c |    7 +++++++
 include/acpi/video.h        |    1 +
 2 files changed, 8 insertions(+)

--- a/drivers/acpi/video_detect.c
+++ b/drivers/acpi/video_detect.c
@@ -54,6 +54,8 @@ static void acpi_video_parse_cmdline(voi
 		acpi_backlight_cmdline = acpi_backlight_nvidia_wmi_ec;
 	if (!strcmp("apple_gmux", acpi_video_backlight_string))
 		acpi_backlight_cmdline = acpi_backlight_apple_gmux;
+	if (!strcmp("dell_uart", acpi_video_backlight_string))
+		acpi_backlight_cmdline = acpi_backlight_dell_uart;
 	if (!strcmp("none", acpi_video_backlight_string))
 		acpi_backlight_cmdline = acpi_backlight_none;
 }
@@ -902,6 +904,7 @@ enum acpi_backlight_type __acpi_video_ge
 	static DEFINE_MUTEX(init_mutex);
 	static bool nvidia_wmi_ec_present;
 	static bool apple_gmux_present;
+	static bool dell_uart_present;
 	static bool native_available;
 	static bool init_done;
 	static long video_caps;
@@ -916,6 +919,7 @@ enum acpi_backlight_type __acpi_video_ge
 				    &video_caps, NULL);
 		nvidia_wmi_ec_present = nvidia_wmi_ec_supported();
 		apple_gmux_present = apple_gmux_detect(NULL, NULL);
+		dell_uart_present = acpi_dev_present("DELL0501", NULL, -1);
 		init_done = true;
 	}
 	if (native)
@@ -946,6 +950,9 @@ enum acpi_backlight_type __acpi_video_ge
 	if (apple_gmux_present)
 		return acpi_backlight_apple_gmux;
 
+	if (dell_uart_present)
+		return acpi_backlight_dell_uart;
+
 	/* Use ACPI video if available, except when native should be preferred. */
 	if ((video_caps & ACPI_VIDEO_BACKLIGHT) &&
 	     !(native_available && prefer_native_over_acpi_video()))
--- a/include/acpi/video.h
+++ b/include/acpi/video.h
@@ -50,6 +50,7 @@ enum acpi_backlight_type {
 	acpi_backlight_native,
 	acpi_backlight_nvidia_wmi_ec,
 	acpi_backlight_apple_gmux,
+	acpi_backlight_dell_uart,
 };
 
 #if IS_ENABLED(CONFIG_ACPI_VIDEO)


Patches currently in stable-queue which might be from hdegoede@xxxxxxxxxx are

queue-6.10/acpi-ec-evaluate-_reg-outside-the-ec-scope-more-carefully.patch
queue-6.10/revert-acpi-ec-evaluate-orphan-_reg-under-ec-device.patch
queue-6.10/input-i8042-add-forcenorestore-quirk-to-leave-controller-untouched-even-on-s3.patch
queue-6.10/acpi-video-add-backlight-native-quirk-for-dell-optiplex-7760-aio.patch
queue-6.10/acpi-video-add-dell-uart-backlight-controller-detection.patch
queue-6.10/acpica-add-a-depth-argument-to-acpi_execute_reg_methods.patch
queue-6.10/input-i8042-use-new-forcenorestore-quirk-to-replace-old-buggy-quirk-combination.patch
queue-6.10/platform-x86-dell-uart-backlight-use-acpi_video_get_backlight_type.patch
queue-6.10/usb-misc-ljca-add-lunar-lake-ljca-gpio-hid-to-ljca_gpio_hids.patch
queue-6.10/media-atomisp-fix-streaming-no-longer-working-on-byt-isp2400-devices.patch




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux