aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorAaron Lu <aaron.lu@intel.com>2015-03-11 17:09:57 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-03-22 17:01:31 -0400
commitff92cfe7cbc05c6c62f5b06c7d9090f4c853cd51 (patch)
tree3ddeffe215c83867c5040bf7093442f0f922616e /drivers/acpi
parent9eccca0843205f87c00404b663188b88eb248051 (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.c19
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 */
85static int use_native_backlight_param = -1; 85enum {
86 NATIVE_BACKLIGHT_NOT_SET = -1,
87 NATIVE_BACKLIGHT_OFF,
88 NATIVE_BACKLIGHT_ON,
89};
90
91static int use_native_backlight_param = NATIVE_BACKLIGHT_NOT_SET;
86module_param_named(use_native_backlight, use_native_backlight_param, int, 0444); 92module_param_named(use_native_backlight, use_native_backlight_param, int, 0444);
87static bool use_native_backlight_dmi = true; 93static int use_native_backlight_dmi = NATIVE_BACKLIGHT_NOT_SET;
88 94
89static int register_count; 95static int register_count;
90static struct mutex video_list_lock; 96static struct mutex video_list_lock;
@@ -237,15 +243,16 @@ static void acpi_video_switch_brightness(struct work_struct *work);
237 243
238static bool acpi_video_use_native_backlight(void) 244static 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
246bool acpi_video_verify_backlight_support(void) 253bool 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
415static int __init video_disable_native_backlight(const struct dmi_system_id *d) 422static 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