diff options
| -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 | ||
