Skip to content

Commit 0d9bdd8

Browse files
committed
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" Fixes: 8d0ca28 ("platform/x86: nvidia-wmi-ec-backlight: Use acpi_video_get_backlight_type()") Link: https://bugzilla.kernel.org/show_bug.cgi?id=217026 Cc: [email protected] Signed-off-by: Hans de Goede <[email protected]> Reviewed-by: Daniel Dadap <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 3004e8d commit 0d9bdd8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/platform/x86/nvidia-wmi-ec-backlight.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
#include <linux/wmi.h>
1313
#include <acpi/video.h>
1414

15+
static bool force;
16+
module_param(force, bool, 0444);
17+
MODULE_PARM_DESC(force, "Force loading (disable acpi_backlight=xxx checks");
18+
1519
/**
1620
* wmi_brightness_notify() - helper function for calling WMI-wrapped ACPI method
1721
* @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 *ct
9195
int ret;
9296

9397
/* drivers/acpi/video_detect.c also checks that SOURCE == EC */
94-
if (acpi_video_get_backlight_type() != acpi_backlight_nvidia_wmi_ec)
98+
if (!force && acpi_video_get_backlight_type() != acpi_backlight_nvidia_wmi_ec)
9599
return -ENODEV;
96100

97101
/*

0 commit comments

Comments
 (0)