diff mbox series

acpi/video: Add quirk for the Colorful X15 AT 23 Laptop

Message ID OS3P286MB1951B46E88AB4A91E47A2696BDBEA@OS3P286MB1951.JPNP286.PROD.OUTLOOK.COM
State Accepted
Commit 143176a46bdd3bfbe9ba2462bf94458e80d65ebf
Headers show
Series acpi/video: Add quirk for the Colorful X15 AT 23 Laptop | expand

Commit Message

Yuluo Qiu Nov. 26, 2023, 1:59 p.m. UTC
The Colorful X15 AT 23 ACIP video-bus device report spurious
ACPI_VIDEO_NOTIFY_CYCLE events resulting in spurious KEY_SWITCHVIDEOMODE
events being reported to userspace (and causing trouble there) when
an external screen plugged in.

Add a quirk setting the report_key_events mask to
REPORT_BRIGHTNESS_KEY_EVENTS so that the ACPI_VIDEO_NOTIFY_CYCLE
events will be ignored, while still reporting brightness up/down
hotkey-presses to userspace normally.

Signed-off-by: Yuluo Qiu <qyl27@outlook.com>
Co-developed-by: Celeste Liu <CoelacanthusHex@gmail.com>
Signed-off-by: Celeste Liu <CoelacanthusHex@gmail.com>
---
 drivers/acpi/acpi_video.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Rafael J. Wysocki Dec. 6, 2023, 8 p.m. UTC | #1
On Sun, Nov 26, 2023 at 3:00 PM Yuluo Qiu <qyl27@outlook.com> wrote:
>
> The Colorful X15 AT 23 ACIP video-bus device report spurious
> ACPI_VIDEO_NOTIFY_CYCLE events resulting in spurious KEY_SWITCHVIDEOMODE
> events being reported to userspace (and causing trouble there) when
> an external screen plugged in.
>
> Add a quirk setting the report_key_events mask to
> REPORT_BRIGHTNESS_KEY_EVENTS so that the ACPI_VIDEO_NOTIFY_CYCLE
> events will be ignored, while still reporting brightness up/down
> hotkey-presses to userspace normally.
>
> Signed-off-by: Yuluo Qiu <qyl27@outlook.com>
> Co-developed-by: Celeste Liu <CoelacanthusHex@gmail.com>
> Signed-off-by: Celeste Liu <CoelacanthusHex@gmail.com>
> ---
>  drivers/acpi/acpi_video.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video.c
> index d321ca7160d9..c54a364ffff3 100644
> --- a/drivers/acpi/acpi_video.c
> +++ b/drivers/acpi/acpi_video.c
> @@ -503,6 +503,15 @@ static const struct dmi_system_id video_dmi_table[] = {
>                 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 3350"),
>                 },
>         },
> +       {
> +        .callback = video_set_report_key_events,
> +        .driver_data = (void *)((uintptr_t)REPORT_BRIGHTNESS_KEY_EVENTS),
> +        .ident = "COLORFUL X15 AT 23",
> +        .matches = {
> +               DMI_MATCH(DMI_SYS_VENDOR, "COLORFUL"),
> +               DMI_MATCH(DMI_PRODUCT_NAME, "X15 AT 23"),
> +               },
> +       },
>         /*
>          * Some machines change the brightness themselves when a brightness
>          * hotkey gets pressed, despite us telling them not to. In this case
> --

Applied as 6.8 material, thanks!
diff mbox series

Patch

diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video.c
index d321ca7160d9..c54a364ffff3 100644
--- a/drivers/acpi/acpi_video.c
+++ b/drivers/acpi/acpi_video.c
@@ -503,6 +503,15 @@  static const struct dmi_system_id video_dmi_table[] = {
 		DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 3350"),
 		},
 	},
+	{
+	 .callback = video_set_report_key_events,
+	 .driver_data = (void *)((uintptr_t)REPORT_BRIGHTNESS_KEY_EVENTS),
+	 .ident = "COLORFUL X15 AT 23",
+	 .matches = {
+		DMI_MATCH(DMI_SYS_VENDOR, "COLORFUL"),
+		DMI_MATCH(DMI_PRODUCT_NAME, "X15 AT 23"),
+		},
+	},
 	/*
 	 * Some machines change the brightness themselves when a brightness
 	 * hotkey gets pressed, despite us telling them not to. In this case