Skip to content

Commit b5f0943

Browse files
jwrdegoederafaeljw
authored andcommitted
platform/x86: dell-uart-backlight: Use acpi_video_get_backlight_type()
The dell-uart-backlight driver supports backlight control on Dell All In One (AIO) models using a backlight controller board connected to an UART. In DSDT this uart port will be defined as: Name (_HID, "DELL0501") Name (_CID, EisaId ("PNP0501") 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. Use the acpi_video_get_backlight_type() function from the ACPI video-detect code to check if the dell-uart-backlight driver should actually be used. This allows reusing the existing ACPI video-detect infra to override the backlight control method on the commandline or with DMI quirks. 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 cd8e468 commit b5f0943

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

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);

0 commit comments

Comments
 (0)