platform/x86: nvidia-wmi-ec-backlight: Add force module parameter
Subsystems (3)
PATCH v2 1/1 platform/x86: nvidia-wmi-ec-backlight: Add force module parameter
On some Lenovo Legion models, the backlight might be driven by either one of nvidia_wmi_ec_backlight or amdgpu_bl0 at different times.
When the Nvidia WMI EC backlight interface reports the backlight is controlled by the EC, the current backlight handling only registers nvidia_wmi_ec_backlight (and registers no other backlight interfaces).
This hides (never registers) the amdgpu_bl0 interface, where as prior to 6.1.4 users would have both nvidia_wmi_ec_backlight and amdgpu_bl0 and could work around things in userspace.
Add a force module parameter which can be used with acpi_backlight=native to restore the old behavior as a workound (for now) by passing:
"acpi_backlight=native nvidia-wmi-ec-backlight.force=1"
---
Changes in v2:
- Reword commit message
--- drivers/platform/x86/nvidia-wmi-ec-backlight.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/platform/x86/nvidia-wmi-ec-backlight.c +5 -1
@@ -12,6 +12,10 @@#include <linux/wmi.h> #include <acpi/video.h> +static bool force; +module_param (force, bool,0444 ); +MODULE_PARM_DESC (force,"Force loading (disable acpi_backlight=xxx checks" ); +/** * wmi_brightness_notify() - helper function for calling WMI-wrapped ACPI method * @w: Pointer to the struct wmi_device identified by %WMI_BRIGHTNESS_GUID
@@ -91,7 +95,7 @@ static int nvidia_wmi_ec_backlight_probe(struct wmi_device *wdev, const void *ctint ret;/* drivers/acpi/video_detect.c also checks that SOURCE == EC */ -if (acpi_video_get_backlight_type () != acpi_backlight_nvidia_wmi_ec) +if (!force &&acpi_video_get_backlight_type () != acpi_backlight_nvidia_wmi_ec)return -ENODEV ;/*
Signature · 1 line
2.39.1
Thanks, Hans. The new commit message sounds more appropriate.
Quoted 53 lines · Hans de Goede
On some Lenovo Legion models, the backlight might be driven by either one of
nvidia_wmi_ec_backlightoramdgpu_bl0at different times.When the Nvidia WMI EC backlight interface reports the backlight is controlled by the EC, the current backlight handling only registers
nvidia_wmi_ec_backlight(and registers no other backlight interfaces).This hides (never registers) the
amdgpu_bl0interface, where as prior to 6.1.4 users would have bothnvidia_wmi_ec_backlightandamdgpu_bl0and could work around things in userspace.Add a force module parameter which can be used with acpi_backlight=native to restore the old behavior as a workound (for now) by passing:
"acpi_backlight=native nvidia-wmi-ec-backlight.force=1"
Fixes 8d0ca287fd8c ("platform/x86: nvidia-wmi-ec-backlight: Use acpi_video_get_backlight_type()")Signed-off-by Hans de Goede <[email protected]>---
Changes in v2:
- Reword commit message--- drivers/platform/x86/nvidia-wmi-ec-backlight.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/platform/x86/nvidia-wmi-ec-backlight.c +5
-1@@ -12,6 +12,10 @@#include <linux/wmi.h> #include <acpi/video.h> +static bool force; +module_param (force, bool,0444 ); +MODULE_PARM_DESC (force,"Force loading (disable acpi_backlight=xxx checks" ); +/** * wmi_brightness_notify() - helper function for calling WMI-wrapped ACPI method * @w: Pointer to the struct wmi_device identified by %WMI_BRIGHTNESS_GUID @@ -91,7 +95,7 @@ static int nvidia_wmi_ec_backlight_probe(struct wmi_device *wdev, const void *ctint ret;/* drivers/acpi/video_detect.c also checks that SOURCE == EC */ -if (acpi_video_get_backlight_type () != acpi_backlight_nvidia_wmi_ec) +if (!force &&acpi_video_get_backlight_type () != acpi_backlight_nvidia_wmi_ec)return -ENODEV ;/* Signature · 1 line
2.39.1
Hi,
Quoted 3 lines · Daniel Dadap
Thanks, Hans. The new commit message sounds more appropriate.
Reviewed-by Daniel Dadap <[email protected]>
Thanks. I have pushed this to pdx86/for-next now so that it will go to Linus during the merge-window and on to the stable kernel series from there.
Regards,
Hans
Quoted 56 lines · Hans de Goede
Quoted 53 lines
On some Lenovo Legion models, the backlight might be driven by either one of
nvidia_wmi_ec_backlightoramdgpu_bl0at different times.When the Nvidia WMI EC backlight interface reports the backlight is controlled by the EC, the current backlight handling only registers
nvidia_wmi_ec_backlight(and registers no other backlight interfaces).This hides (never registers) the
amdgpu_bl0interface, where as prior to 6.1.4 users would have bothnvidia_wmi_ec_backlightandamdgpu_bl0and could work around things in userspace.Add a force module parameter which can be used with acpi_backlight=native to restore the old behavior as a workound (for now) by passing:
"acpi_backlight=native nvidia-wmi-ec-backlight.force=1"
Fixes 8d0ca287fd8c ("platform/x86: nvidia-wmi-ec-backlight: Use acpi_video_get_backlight_type()")Signed-off-by Hans de Goede <[email protected]>---
Changes in v2:
- Reword commit message--- drivers/platform/x86/nvidia-wmi-ec-backlight.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/platform/x86/nvidia-wmi-ec-backlight.c +5
-1@@ -12,6 +12,10 @@#include <linux/wmi.h> #include <acpi/video.h> +static bool force; +module_param (force, bool,0444 ); +MODULE_PARM_DESC (force,"Force loading (disable acpi_backlight=xxx checks" ); +/** * wmi_brightness_notify() - helper function for calling WMI-wrapped ACPI method * @w: Pointer to the struct wmi_device identified by %WMI_BRIGHTNESS_GUID @@ -91,7 +95,7 @@ static int nvidia_wmi_ec_backlight_probe(struct wmi_device *wdev, const void *ctint ret;/* drivers/acpi/video_detect.c also checks that SOURCE == EC */ -if (acpi_video_get_backlight_type () != acpi_backlight_nvidia_wmi_ec) +if (!force &&acpi_video_get_backlight_type () != acpi_backlight_nvidia_wmi_ec)return -ENODEV ;/* Signature · 1 line
2.39.1