diff options
Diffstat (limited to 'drivers/acpi/video.c')
-rw-r--r-- | drivers/acpi/video.c | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index 26eb70c8f518..cc79d3fedfb2 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,13 @@ 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; |
425 | return 0; | ||
426 | } | ||
427 | |||
428 | static int __init video_enable_native_backlight(const struct dmi_system_id *d) | ||
429 | { | ||
430 | use_native_backlight_dmi = NATIVE_BACKLIGHT_ON; | ||
418 | return 0; | 431 | return 0; |
419 | } | 432 | } |
420 | 433 | ||
@@ -559,6 +572,17 @@ static struct dmi_system_id video_dmi_table[] __initdata = { | |||
559 | DMI_MATCH(DMI_PRODUCT_NAME, "XPS L521X"), | 572 | DMI_MATCH(DMI_PRODUCT_NAME, "XPS L521X"), |
560 | }, | 573 | }, |
561 | }, | 574 | }, |
575 | |||
576 | /* Non win8 machines which need native backlight nevertheless */ | ||
577 | { | ||
578 | /* https://bugzilla.redhat.com/show_bug.cgi?id=1187004 */ | ||
579 | .callback = video_enable_native_backlight, | ||
580 | .ident = "Lenovo Ideapad Z570", | ||
581 | .matches = { | ||
582 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
583 | DMI_MATCH(DMI_PRODUCT_NAME, "102434U"), | ||
584 | }, | ||
585 | }, | ||
562 | {} | 586 | {} |
563 | }; | 587 | }; |
564 | 588 | ||