Re: [PATCH 2/2] platform/x86: asus-wmi: fix screenpad brightness scaling
From: Ilpo Järvinen
Date: Mon Feb 23 2026 - 09:42:28 EST
On Thu, 12 Feb 2026, Denis Benato wrote:
> Fix incorrect brightness scaling by removing the inconsistent use of an
> arbitrary minimum.
>
> Signed-off-by: Denis Benato <denis.benato@xxxxxxxxx>
> Signed-off-by: Luke Jones <luke@xxxxxxxxxx>
Should this have a Fixes tag?
> ---
> drivers/platform/x86/asus-wmi.c | 16 ++++++----------
> 1 file changed, 6 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
> index 4130dae37e15..5443aaf99e38 100644
> --- a/drivers/platform/x86/asus-wmi.c
> +++ b/drivers/platform/x86/asus-wmi.c
> @@ -125,7 +125,6 @@ module_param(fnlock_default, bool, 0444);
> #define NVIDIA_TEMP_MIN 75
> #define NVIDIA_TEMP_MAX 87
>
> -#define ASUS_SCREENPAD_BRIGHT_MIN 20
> #define ASUS_SCREENPAD_BRIGHT_MAX 255
> #define ASUS_SCREENPAD_BRIGHT_DEFAULT 60
>
> @@ -4243,13 +4242,13 @@ static int read_screenpad_brightness(struct backlight_device *bd)
> return err;
> /* The device brightness can only be read if powered, so return stored */
> if (err == BACKLIGHT_POWER_OFF)
> - return asus->driver->screenpad_brightness - ASUS_SCREENPAD_BRIGHT_MIN;
> + return bd->props.brightness;
>
> err = asus_wmi_get_devstate(asus, ASUS_WMI_DEVID_SCREENPAD_LIGHT, &retval);
> if (err < 0)
> return err;
>
> - return (retval & ASUS_WMI_DSTS_BRIGHTNESS_MASK) - ASUS_SCREENPAD_BRIGHT_MIN;
> + return (retval & ASUS_WMI_DSTS_BRIGHTNESS_MASK);
> }
>
> static int update_screenpad_bl_status(struct backlight_device *bd)
> @@ -4289,22 +4288,19 @@ static int asus_screenpad_init(struct asus_wmi *asus)
> int err, power;
> int brightness = 0;
>
> - power = read_screenpad_backlight_power(asus);
> + power = asus_wmi_get_devstate_simple(asus, ASUS_WMI_DEVID_SCREENPAD_POWER);
> if (power < 0)
> return power;
>
> - if (power != BACKLIGHT_POWER_OFF) {
> + if (power) {
> err = asus_wmi_get_devstate(asus, ASUS_WMI_DEVID_SCREENPAD_LIGHT, &brightness);
> if (err < 0)
> return err;
> }
> - /* default to an acceptable min brightness on boot if too low */
> - if (brightness < ASUS_SCREENPAD_BRIGHT_MIN)
> - brightness = ASUS_SCREENPAD_BRIGHT_DEFAULT;
This doesn't seem to be related to the scaling but looks a lowerbound?
Probably removing it would warrant own patch + justification, IMO.
> memset(&props, 0, sizeof(struct backlight_properties));
> props.type = BACKLIGHT_RAW; /* ensure this bd is last to be picked */
> - props.max_brightness = ASUS_SCREENPAD_BRIGHT_MAX - ASUS_SCREENPAD_BRIGHT_MIN;
> + props.max_brightness = ASUS_SCREENPAD_BRIGHT_MAX;
> bd = backlight_device_register("asus_screenpad",
> &asus->platform_device->dev, asus,
> &asus_screenpad_bl_ops, &props);
> @@ -4315,7 +4311,7 @@ static int asus_screenpad_init(struct asus_wmi *asus)
>
> asus->screenpad_backlight_device = bd;
> asus->driver->screenpad_brightness = brightness;
> - bd->props.brightness = brightness - ASUS_SCREENPAD_BRIGHT_MIN;
> + bd->props.brightness = brightness;
> bd->props.power = power;
> backlight_update_status(bd);
>
>
--
i.