Skip to content

Commit b09f6ca

Browse files
committed
Merge tag 'acpi-6.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI fix from Rafael Wysocki: "Fix backlight control on a Dell All In One system where a backlight controller board is attached to a UART port and the dell-uart backlight driver binds to it, but the backlight is actually controlled by other means (Hans de Goede)" * tag 'acpi-6.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: video: Add backlight=native quirk for Dell OptiPlex 7760 AIO platform/x86: dell-uart-backlight: Use acpi_video_get_backlight_type() ACPI: video: Add Dell UART backlight controller detection
2 parents 6ae4e48 + 5c7bb62 commit b09f6ca

File tree

4 files changed

+32
-0
lines changed

4 files changed

+32
-0
lines changed

drivers/acpi/video_detect.c

Lines changed: 22 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
}
@@ -821,6 +823,21 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
821823
},
822824
},
823825

826+
/*
827+
* Dell AIO (All in Ones) which advertise an UART attached backlight
828+
* controller board in their ACPI tables (and may even have one), but
829+
* which need native backlight control nevertheless.
830+
*/
831+
{
832+
/* https://bugzilla.redhat.com/show_bug.cgi?id=2303936 */
833+
.callback = video_detect_force_native,
834+
/* Dell OptiPlex 7760 AIO */
835+
.matches = {
836+
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
837+
DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 7760 AIO"),
838+
},
839+
},
840+
824841
/*
825842
* Models which have nvidia-ec-wmi support, but should not use it.
826843
* Note this indicates a likely firmware bug on these models and should
@@ -918,6 +935,7 @@ enum acpi_backlight_type __acpi_video_get_backlight_type(bool native, bool *auto
918935
static DEFINE_MUTEX(init_mutex);
919936
static bool nvidia_wmi_ec_present;
920937
static bool apple_gmux_present;
938+
static bool dell_uart_present;
921939
static bool native_available;
922940
static bool init_done;
923941
static long video_caps;
@@ -932,6 +950,7 @@ enum acpi_backlight_type __acpi_video_get_backlight_type(bool native, bool *auto
932950
&video_caps, NULL);
933951
nvidia_wmi_ec_present = nvidia_wmi_ec_supported();
934952
apple_gmux_present = apple_gmux_detect(NULL, NULL);
953+
dell_uart_present = acpi_dev_present("DELL0501", NULL, -1);
935954
init_done = true;
936955
}
937956
if (native)
@@ -962,6 +981,9 @@ enum acpi_backlight_type __acpi_video_get_backlight_type(bool native, bool *auto
962981
if (apple_gmux_present)
963982
return acpi_backlight_apple_gmux;
964983

984+
if (dell_uart_present)
985+
return acpi_backlight_dell_uart;
986+
965987
/* Use ACPI video if available, except when native should be preferred. */
966988
if ((video_caps & ACPI_VIDEO_BACKLIGHT) &&
967989
!(native_available && prefer_native_over_acpi_video()))

drivers/platform/x86/dell/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ config DELL_SMO8800
161161
config DELL_UART_BACKLIGHT
162162
tristate "Dell AIO UART Backlight driver"
163163
depends on ACPI
164+
depends on ACPI_VIDEO
164165
depends on BACKLIGHT_CLASS_DEVICE
165166
depends on SERIAL_DEV_BUS
166167
help

drivers/platform/x86/dell/dell-uart-backlight.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <linux/string.h>
2121
#include <linux/types.h>
2222
#include <linux/wait.h>
23+
#include <acpi/video.h>
2324
#include "../serdev_helpers.h"
2425

2526
/* The backlight controller must respond within 1 second */
@@ -332,10 +333,17 @@ struct serdev_device_driver dell_uart_bl_serdev_driver = {
332333

333334
static int dell_uart_bl_pdev_probe(struct platform_device *pdev)
334335
{
336+
enum acpi_backlight_type bl_type;
335337
struct serdev_device *serdev;
336338
struct device *ctrl_dev;
337339
int ret;
338340

341+
bl_type = acpi_video_get_backlight_type();
342+
if (bl_type != acpi_backlight_dell_uart) {
343+
dev_dbg(&pdev->dev, "Not loading (ACPI backlight type = %d)\n", bl_type);
344+
return -ENODEV;
345+
}
346+
339347
ctrl_dev = get_serdev_controller("DELL0501", NULL, 0, "serial0");
340348
if (IS_ERR(ctrl_dev))
341349
return PTR_ERR(ctrl_dev);

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)