diff options
author | Aaron Lu <aaron.lu@intel.com> | 2015-03-11 17:09:57 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-03-22 17:01:31 -0400 |
commit | ff92cfe7cbc05c6c62f5b06c7d9090f4c853cd51 (patch) | |
tree | 3ddeffe215c83867c5040bf7093442f0f922616e /drivers/acpi | |
parent | 9eccca0843205f87c00404b663188b88eb248051 (diff) |
ACPI / video: Allow forcing native backlight on non win8 machines
The native backlight behavior (so not registering both the acpi-video
and the vendor backlight driver) can be useful on some non win8 machines
too, so change the behavior of the video.use_native_backlight=1 or 0
kernel cmdline option to be: if user has set video.use_native_backlight=1
or 0, use that no matter if it is a win8 system or not. Also, we will
put some known systems into the DMI table to make them either use native
backlight interface or not, and the use_native_backlight_dmi is used to
reflect that.
Original-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/video.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index 26eb70c8f518..2f45dca31724 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c | |||
@@ -82,9 +82,15 @@ module_param(allow_duplicates, bool, 0644); | |||
82 | * For Windows 8 systems: used to decide if video module | 82 | * For Windows 8 systems: used to decide if video module |
83 | * should skip registering backlight interface of its own. | 83 | * should skip registering backlight interface of its own. |
84 | */ | 84 | */ |
85 | static int use_native_backlight_param = -1; | 85 | enum { |
86 | NATIVE_BACKLIGHT_NOT_SET = -1, | ||
87 | NATIVE_BACKLIGHT_OFF, | ||
88 | NATIVE_BACKLIGHT_ON, | ||
89 | }; | ||
90 | |||
91 | static int use_native_backlight_param = NATIVE_BACKLIGHT_NOT_SET; | ||
86 | module_param_named(use_native_backlight, use_native_backlight_param, int, 0444); | 92 | module_param_named(use_native_backlight, use_native_backlight_param, int, 0444); |
87 | static bool use_native_backlight_dmi = true; | 93 | static int use_native_backlight_dmi = NATIVE_BACKLIGHT_NOT_SET; |
88 | 94 | ||
89 | static int register_count; | 95 | static int register_count; |
90 | static struct mutex video_list_lock; | 96 | static struct mutex video_list_lock; |
@@ -237,15 +243,16 @@ static void acpi_video_switch_brightness(struct work_struct *work); | |||
237 | 243 | ||
238 | static bool acpi_video_use_native_backlight(void) | 244 | static bool acpi_video_use_native_backlight(void) |
239 | { | 245 | { |
240 | if (use_native_backlight_param != -1) | 246 | if (use_native_backlight_param != NATIVE_BACKLIGHT_NOT_SET) |
241 | return use_native_backlight_param; | 247 | return use_native_backlight_param; |
242 | else | 248 | else if (use_native_backlight_dmi != NATIVE_BACKLIGHT_NOT_SET) |
243 | return use_native_backlight_dmi; | 249 | return use_native_backlight_dmi; |
250 | return acpi_osi_is_win8(); | ||
244 | } | 251 | } |
245 | 252 | ||
246 | bool acpi_video_verify_backlight_support(void) | 253 | bool acpi_video_verify_backlight_support(void) |
247 | { | 254 | { |
248 | if (acpi_osi_is_win8() && acpi_video_use_native_backlight() && | 255 | if (acpi_video_use_native_backlight() && |
249 | backlight_device_registered(BACKLIGHT_RAW)) | 256 | backlight_device_registered(BACKLIGHT_RAW)) |
250 | return false; | 257 | return false; |
251 | return acpi_video_backlight_support(); | 258 | return acpi_video_backlight_support(); |
@@ -414,7 +421,7 @@ static int __init video_set_bqc_offset(const struct dmi_system_id *d) | |||
414 | 421 | ||
415 | static int __init video_disable_native_backlight(const struct dmi_system_id *d) | 422 | static int __init video_disable_native_backlight(const struct dmi_system_id *d) |
416 | { | 423 | { |
417 | use_native_backlight_dmi = false; | 424 | use_native_backlight_dmi = NATIVE_BACKLIGHT_OFF; |
418 | return 0; | 425 | return 0; |
419 | } | 426 | } |
420 | 427 | ||