* [PATCH 0/3] ACPI/video / platform/x86: Add backlight=native quirk for Dell OptiPlex 7760 AIO
@ 2024-08-14 19:01 Hans de Goede
2024-08-14 19:01 ` [PATCH 1/3] ACPI: video: Add Dell UART backlight controller detection Hans de Goede
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Hans de Goede @ 2024-08-14 19:01 UTC (permalink / raw)
To: Rafael J . Wysocki, Ilpo Järvinen, Andy Shevchenko
Cc: Hans de Goede, dri-devel, linux-acpi, platform-driver-x86
Hi Rafael,
6.10 has a new backlight driver for UART attached backlight controller
boards found in some Dell All in One models.
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 (it needs GPU native control).
I did not tie the dell-uart-backlight into acpi_video_get_backlight_type()
yet, so the first 2 patches in this series deal with that and the third
patch adds a DMI quirk to select native backlight control on top.
Backlight control used to work on the Dell OptiPlex 7760 AIO with kernel
6.9 and older, so this is a regression and I would like to see this
series merged as fixes for 6.11.
Rafael, the drivers/platform/x86/dell/dell-uart-backlight.c are small
and isolated. So I believe it is best if you take the entire series,
to avoid conflicts if any other drivers/apci/video_detect.c DMI quirks
show up this cycle.
Regards,
Hans
Hans de Goede (3):
ACPI: video: Add Dell UART backlight controller detection
platform/x86: dell-uart-backlight: Use acpi_video_get_backlight_type()
ACPI: video: Add backlight=native quirk for Dell OptiPlex 7760 AIO
drivers/acpi/video_detect.c | 22 +++++++++++++++++++
drivers/platform/x86/dell/Kconfig | 1 +
.../platform/x86/dell/dell-uart-backlight.c | 8 +++++++
include/acpi/video.h | 1 +
4 files changed, 32 insertions(+)
--
2.46.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/3] ACPI: video: Add Dell UART backlight controller detection
2024-08-14 19:01 [PATCH 0/3] ACPI/video / platform/x86: Add backlight=native quirk for Dell OptiPlex 7760 AIO Hans de Goede
@ 2024-08-14 19:01 ` Hans de Goede
2024-08-14 19:01 ` [PATCH 2/3] platform/x86: dell-uart-backlight: Use acpi_video_get_backlight_type() Hans de Goede
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Hans de Goede @ 2024-08-14 19:01 UTC (permalink / raw)
To: Rafael J . Wysocki, Ilpo Järvinen, Andy Shevchenko
Cc: Hans de Goede, dri-devel, linux-acpi, platform-driver-x86, stable
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: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/acpi/video_detect.c | 7 +++++++
include/acpi/video.h | 1 +
2 files changed, 8 insertions(+)
diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c
index c11cbe5b6eaa..e509dcbf3090 100644
--- a/drivers/acpi/video_detect.c
+++ b/drivers/acpi/video_detect.c
@@ -54,6 +54,8 @@ static void acpi_video_parse_cmdline(void)
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;
}
@@ -918,6 +920,7 @@ enum acpi_backlight_type __acpi_video_get_backlight_type(bool native, bool *auto
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;
@@ -932,6 +935,7 @@ enum acpi_backlight_type __acpi_video_get_backlight_type(bool native, bool *auto
&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)
@@ -962,6 +966,9 @@ enum acpi_backlight_type __acpi_video_get_backlight_type(bool native, bool *auto
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()))
diff --git a/include/acpi/video.h b/include/acpi/video.h
index 3d538d4178ab..044c463138df 100644
--- 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)
--
2.46.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3] platform/x86: dell-uart-backlight: Use acpi_video_get_backlight_type()
2024-08-14 19:01 [PATCH 0/3] ACPI/video / platform/x86: Add backlight=native quirk for Dell OptiPlex 7760 AIO Hans de Goede
2024-08-14 19:01 ` [PATCH 1/3] ACPI: video: Add Dell UART backlight controller detection Hans de Goede
@ 2024-08-14 19:01 ` Hans de Goede
2024-08-14 19:01 ` [PATCH 3/3] ACPI: video: Add backlight=native quirk for Dell OptiPlex 7760 AIO Hans de Goede
2024-08-14 20:09 ` [PATCH 0/3] ACPI/video / platform/x86: " Andy Shevchenko
3 siblings, 0 replies; 6+ messages in thread
From: Hans de Goede @ 2024-08-14 19:01 UTC (permalink / raw)
To: Rafael J . Wysocki, Ilpo Järvinen, Andy Shevchenko
Cc: Hans de Goede, dri-devel, linux-acpi, platform-driver-x86, stable
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: 484bae9e4d6a ("platform/x86: Add new Dell UART backlight driver")
Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/platform/x86/dell/Kconfig | 1 +
drivers/platform/x86/dell/dell-uart-backlight.c | 8 ++++++++
2 files changed, 9 insertions(+)
diff --git a/drivers/platform/x86/dell/Kconfig b/drivers/platform/x86/dell/Kconfig
index f711c59fcf1b..11c2cb7d05b0 100644
--- a/drivers/platform/x86/dell/Kconfig
+++ b/drivers/platform/x86/dell/Kconfig
@@ -162,6 +162,7 @@ config DELL_SMO8800
config DELL_UART_BACKLIGHT
tristate "Dell AIO UART Backlight driver"
depends on ACPI
+ depends on ACPI_VIDEO
depends on BACKLIGHT_CLASS_DEVICE
depends on SERIAL_DEV_BUS
help
diff --git a/drivers/platform/x86/dell/dell-uart-backlight.c b/drivers/platform/x86/dell/dell-uart-backlight.c
index 87d2a20b4cb3..3995f90add45 100644
--- a/drivers/platform/x86/dell/dell-uart-backlight.c
+++ b/drivers/platform/x86/dell/dell-uart-backlight.c
@@ -20,6 +20,7 @@
#include <linux/string.h>
#include <linux/types.h>
#include <linux/wait.h>
+#include <acpi/video.h>
#include "../serdev_helpers.h"
/* The backlight controller must respond within 1 second */
@@ -332,10 +333,17 @@ struct serdev_device_driver dell_uart_bl_serdev_driver = {
static int dell_uart_bl_pdev_probe(struct platform_device *pdev)
{
+ enum acpi_backlight_type bl_type;
struct serdev_device *serdev;
struct device *ctrl_dev;
int ret;
+ bl_type = acpi_video_get_backlight_type();
+ if (bl_type != acpi_backlight_dell_uart) {
+ dev_dbg(&pdev->dev, "Not loading (ACPI backlight type = %d)\n", bl_type);
+ return -ENODEV;
+ }
+
ctrl_dev = get_serdev_controller("DELL0501", NULL, 0, "serial0");
if (IS_ERR(ctrl_dev))
return PTR_ERR(ctrl_dev);
--
2.46.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3] ACPI: video: Add backlight=native quirk for Dell OptiPlex 7760 AIO
2024-08-14 19:01 [PATCH 0/3] ACPI/video / platform/x86: Add backlight=native quirk for Dell OptiPlex 7760 AIO Hans de Goede
2024-08-14 19:01 ` [PATCH 1/3] ACPI: video: Add Dell UART backlight controller detection Hans de Goede
2024-08-14 19:01 ` [PATCH 2/3] platform/x86: dell-uart-backlight: Use acpi_video_get_backlight_type() Hans de Goede
@ 2024-08-14 19:01 ` Hans de Goede
2024-08-14 20:09 ` [PATCH 0/3] ACPI/video / platform/x86: " Andy Shevchenko
3 siblings, 0 replies; 6+ messages in thread
From: Hans de Goede @ 2024-08-14 19:01 UTC (permalink / raw)
To: Rafael J . Wysocki, Ilpo Järvinen, Andy Shevchenko
Cc: Hans de Goede, dri-devel, linux-acpi, platform-driver-x86, stable
Dell All In One (AIO) models released after 2017 may 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")
The Dell OptiPlex 7760 AIO has an ACPI device for one if its UARTs with
the above _HID + _CID. Loading the dell-uart-backlight driver shows that
there actually is a backlight controller board attached to the UART,
which reports a firmware version of "G&MX01-V15".
But the backlight controller board does not actually control the backlight
brightness and the GPU's native backlight control method does work.
Add a quirk to use the GPU's native backlight control method on this model.
Fixes: 484bae9e4d6a ("platform/x86: Add new Dell UART backlight driver")
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2303936
Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/acpi/video_detect.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c
index e509dcbf3090..674b9db7a1ef 100644
--- a/drivers/acpi/video_detect.c
+++ b/drivers/acpi/video_detect.c
@@ -823,6 +823,21 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
},
},
+ /*
+ * Dell AIO (All in Ones) which advertise an UART attached backlight
+ * controller board in their ACPI tables (and may even have one), but
+ * which need native backlight control nevertheless.
+ */
+ {
+ /* https://bugzilla.redhat.com/show_bug.cgi?id=2303936 */
+ .callback = video_detect_force_native,
+ /* Dell OptiPlex 7760 AIO */
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 7760 AIO"),
+ },
+ },
+
/*
* Models which have nvidia-ec-wmi support, but should not use it.
* Note this indicates a likely firmware bug on these models and should
--
2.46.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 0/3] ACPI/video / platform/x86: Add backlight=native quirk for Dell OptiPlex 7760 AIO
2024-08-14 19:01 [PATCH 0/3] ACPI/video / platform/x86: Add backlight=native quirk for Dell OptiPlex 7760 AIO Hans de Goede
` (2 preceding siblings ...)
2024-08-14 19:01 ` [PATCH 3/3] ACPI: video: Add backlight=native quirk for Dell OptiPlex 7760 AIO Hans de Goede
@ 2024-08-14 20:09 ` Andy Shevchenko
2024-08-19 13:59 ` Rafael J. Wysocki
3 siblings, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2024-08-14 20:09 UTC (permalink / raw)
To: Hans de Goede
Cc: Rafael J . Wysocki, Ilpo Järvinen, dri-devel, linux-acpi,
platform-driver-x86
On Wed, Aug 14, 2024 at 09:01:56PM +0200, Hans de Goede wrote:
> Hi Rafael,
>
> 6.10 has a new backlight driver for UART attached backlight controller
> boards found in some Dell All in One models.
>
> 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 (it needs GPU native control).
>
> I did not tie the dell-uart-backlight into acpi_video_get_backlight_type()
> yet, so the first 2 patches in this series deal with that and the third
> patch adds a DMI quirk to select native backlight control on top.
>
> Backlight control used to work on the Dell OptiPlex 7760 AIO with kernel
> 6.9 and older, so this is a regression and I would like to see this
> series merged as fixes for 6.11.
>
> Rafael, the drivers/platform/x86/dell/dell-uart-backlight.c are small
> and isolated. So I believe it is best if you take the entire series,
> to avoid conflicts if any other drivers/apci/video_detect.c DMI quirks
> show up this cycle.
FWIW,
Reviewed-by: Andy Shevchenko <andy@kernel.org>
I find this quite small and I agree this would be nice to have as fixes.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/3] ACPI/video / platform/x86: Add backlight=native quirk for Dell OptiPlex 7760 AIO
2024-08-14 20:09 ` [PATCH 0/3] ACPI/video / platform/x86: " Andy Shevchenko
@ 2024-08-19 13:59 ` Rafael J. Wysocki
0 siblings, 0 replies; 6+ messages in thread
From: Rafael J. Wysocki @ 2024-08-19 13:59 UTC (permalink / raw)
To: Andy Shevchenko, Hans de Goede
Cc: Ilpo Järvinen, dri-devel, linux-acpi, platform-driver-x86
On Wed, Aug 14, 2024 at 10:10 PM Andy Shevchenko <andy@kernel.org> wrote:
>
> On Wed, Aug 14, 2024 at 09:01:56PM +0200, Hans de Goede wrote:
> > Hi Rafael,
> >
> > 6.10 has a new backlight driver for UART attached backlight controller
> > boards found in some Dell All in One models.
> >
> > 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 (it needs GPU native control).
> >
> > I did not tie the dell-uart-backlight into acpi_video_get_backlight_type()
> > yet, so the first 2 patches in this series deal with that and the third
> > patch adds a DMI quirk to select native backlight control on top.
> >
> > Backlight control used to work on the Dell OptiPlex 7760 AIO with kernel
> > 6.9 and older, so this is a regression and I would like to see this
> > series merged as fixes for 6.11.
> >
> > Rafael, the drivers/platform/x86/dell/dell-uart-backlight.c are small
> > and isolated. So I believe it is best if you take the entire series,
> > to avoid conflicts if any other drivers/apci/video_detect.c DMI quirks
> > show up this cycle.
>
> FWIW,
> Reviewed-by: Andy Shevchenko <andy@kernel.org>
>
> I find this quite small and I agree this would be nice to have as fixes.
Applied as fixes for 6.11-rc, thanks!
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-08-19 14:00 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-14 19:01 [PATCH 0/3] ACPI/video / platform/x86: Add backlight=native quirk for Dell OptiPlex 7760 AIO Hans de Goede
2024-08-14 19:01 ` [PATCH 1/3] ACPI: video: Add Dell UART backlight controller detection Hans de Goede
2024-08-14 19:01 ` [PATCH 2/3] platform/x86: dell-uart-backlight: Use acpi_video_get_backlight_type() Hans de Goede
2024-08-14 19:01 ` [PATCH 3/3] ACPI: video: Add backlight=native quirk for Dell OptiPlex 7760 AIO Hans de Goede
2024-08-14 20:09 ` [PATCH 0/3] ACPI/video / platform/x86: " Andy Shevchenko
2024-08-19 13:59 ` Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox