diff options
Diffstat (limited to 'drivers/acpi/video.c')
-rw-r--r-- | drivers/acpi/video.c | 291 |
1 files changed, 26 insertions, 265 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index 8e7e18567ae6..807a88a0f394 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c | |||
@@ -411,12 +411,6 @@ static int __init video_set_bqc_offset(const struct dmi_system_id *d) | |||
411 | return 0; | 411 | return 0; |
412 | } | 412 | } |
413 | 413 | ||
414 | static int __init video_set_use_native_backlight(const struct dmi_system_id *d) | ||
415 | { | ||
416 | use_native_backlight_dmi = true; | ||
417 | return 0; | ||
418 | } | ||
419 | |||
420 | static int __init video_disable_native_backlight(const struct dmi_system_id *d) | 414 | static int __init video_disable_native_backlight(const struct dmi_system_id *d) |
421 | { | 415 | { |
422 | use_native_backlight_dmi = false; | 416 | use_native_backlight_dmi = false; |
@@ -467,265 +461,6 @@ static struct dmi_system_id video_dmi_table[] __initdata = { | |||
467 | DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 7720"), | 461 | DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 7720"), |
468 | }, | 462 | }, |
469 | }, | 463 | }, |
470 | { | ||
471 | .callback = video_set_use_native_backlight, | ||
472 | .ident = "ThinkPad X230", | ||
473 | .matches = { | ||
474 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
475 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X230"), | ||
476 | }, | ||
477 | }, | ||
478 | { | ||
479 | .callback = video_set_use_native_backlight, | ||
480 | .ident = "ThinkPad T430 and T430s", | ||
481 | .matches = { | ||
482 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
483 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T430"), | ||
484 | }, | ||
485 | }, | ||
486 | { | ||
487 | .callback = video_set_use_native_backlight, | ||
488 | .ident = "ThinkPad T430", | ||
489 | .matches = { | ||
490 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
491 | DMI_MATCH(DMI_PRODUCT_VERSION, "2349D15"), | ||
492 | }, | ||
493 | }, | ||
494 | { | ||
495 | .callback = video_set_use_native_backlight, | ||
496 | .ident = "ThinkPad T431s", | ||
497 | .matches = { | ||
498 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
499 | DMI_MATCH(DMI_PRODUCT_VERSION, "20AACTO1WW"), | ||
500 | }, | ||
501 | }, | ||
502 | { | ||
503 | .callback = video_set_use_native_backlight, | ||
504 | .ident = "ThinkPad Edge E530", | ||
505 | .matches = { | ||
506 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
507 | DMI_MATCH(DMI_PRODUCT_VERSION, "3259A2G"), | ||
508 | }, | ||
509 | }, | ||
510 | { | ||
511 | .callback = video_set_use_native_backlight, | ||
512 | .ident = "ThinkPad Edge E530", | ||
513 | .matches = { | ||
514 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
515 | DMI_MATCH(DMI_PRODUCT_VERSION, "3259CTO"), | ||
516 | }, | ||
517 | }, | ||
518 | { | ||
519 | .callback = video_set_use_native_backlight, | ||
520 | .ident = "ThinkPad Edge E530", | ||
521 | .matches = { | ||
522 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
523 | DMI_MATCH(DMI_PRODUCT_VERSION, "3259HJG"), | ||
524 | }, | ||
525 | }, | ||
526 | { | ||
527 | .callback = video_set_use_native_backlight, | ||
528 | .ident = "ThinkPad W530", | ||
529 | .matches = { | ||
530 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
531 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad W530"), | ||
532 | }, | ||
533 | }, | ||
534 | { | ||
535 | .callback = video_set_use_native_backlight, | ||
536 | .ident = "ThinkPad X1 Carbon", | ||
537 | .matches = { | ||
538 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
539 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X1 Carbon"), | ||
540 | }, | ||
541 | }, | ||
542 | { | ||
543 | .callback = video_set_use_native_backlight, | ||
544 | .ident = "Lenovo Yoga 13", | ||
545 | .matches = { | ||
546 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
547 | DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo IdeaPad Yoga 13"), | ||
548 | }, | ||
549 | }, | ||
550 | { | ||
551 | .callback = video_set_use_native_backlight, | ||
552 | .ident = "Lenovo Yoga 2 11", | ||
553 | .matches = { | ||
554 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
555 | DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Yoga 2 11"), | ||
556 | }, | ||
557 | }, | ||
558 | { | ||
559 | .callback = video_set_use_native_backlight, | ||
560 | .ident = "Thinkpad Helix", | ||
561 | .matches = { | ||
562 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
563 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad Helix"), | ||
564 | }, | ||
565 | }, | ||
566 | { | ||
567 | .callback = video_set_use_native_backlight, | ||
568 | .ident = "Dell Inspiron 7520", | ||
569 | .matches = { | ||
570 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
571 | DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 7520"), | ||
572 | }, | ||
573 | }, | ||
574 | { | ||
575 | .callback = video_set_use_native_backlight, | ||
576 | .ident = "Acer Aspire 5733Z", | ||
577 | .matches = { | ||
578 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | ||
579 | DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5733Z"), | ||
580 | }, | ||
581 | }, | ||
582 | { | ||
583 | .callback = video_set_use_native_backlight, | ||
584 | .ident = "Acer Aspire 5742G", | ||
585 | .matches = { | ||
586 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | ||
587 | DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5742G"), | ||
588 | }, | ||
589 | }, | ||
590 | { | ||
591 | .callback = video_set_use_native_backlight, | ||
592 | .ident = "Acer Aspire V5-171", | ||
593 | .matches = { | ||
594 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | ||
595 | DMI_MATCH(DMI_PRODUCT_NAME, "V5-171"), | ||
596 | }, | ||
597 | }, | ||
598 | { | ||
599 | .callback = video_set_use_native_backlight, | ||
600 | .ident = "Acer Aspire V5-431", | ||
601 | .matches = { | ||
602 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | ||
603 | DMI_MATCH(DMI_PRODUCT_NAME, "Aspire V5-431"), | ||
604 | }, | ||
605 | }, | ||
606 | { | ||
607 | .callback = video_set_use_native_backlight, | ||
608 | .ident = "Acer Aspire V5-471G", | ||
609 | .matches = { | ||
610 | DMI_MATCH(DMI_BOARD_VENDOR, "Acer"), | ||
611 | DMI_MATCH(DMI_PRODUCT_NAME, "Aspire V5-471G"), | ||
612 | }, | ||
613 | }, | ||
614 | { | ||
615 | .callback = video_set_use_native_backlight, | ||
616 | .ident = "Acer TravelMate B113", | ||
617 | .matches = { | ||
618 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | ||
619 | DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate B113"), | ||
620 | }, | ||
621 | }, | ||
622 | { | ||
623 | .callback = video_set_use_native_backlight, | ||
624 | .ident = "Acer Aspire V5-572G", | ||
625 | .matches = { | ||
626 | DMI_MATCH(DMI_SYS_VENDOR, "Acer Aspire"), | ||
627 | DMI_MATCH(DMI_PRODUCT_VERSION, "V5-572G/Dazzle_CX"), | ||
628 | }, | ||
629 | }, | ||
630 | { | ||
631 | .callback = video_set_use_native_backlight, | ||
632 | .ident = "Acer Aspire V5-573G", | ||
633 | .matches = { | ||
634 | DMI_MATCH(DMI_SYS_VENDOR, "Acer Aspire"), | ||
635 | DMI_MATCH(DMI_PRODUCT_VERSION, "V5-573G/Dazzle_HW"), | ||
636 | }, | ||
637 | }, | ||
638 | { | ||
639 | .callback = video_set_use_native_backlight, | ||
640 | .ident = "ASUS Zenbook Prime UX31A", | ||
641 | .matches = { | ||
642 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), | ||
643 | DMI_MATCH(DMI_PRODUCT_NAME, "UX31A"), | ||
644 | }, | ||
645 | }, | ||
646 | { | ||
647 | .callback = video_set_use_native_backlight, | ||
648 | .ident = "HP ProBook 4340s", | ||
649 | .matches = { | ||
650 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
651 | DMI_MATCH(DMI_PRODUCT_VERSION, "HP ProBook 4340s"), | ||
652 | }, | ||
653 | }, | ||
654 | { | ||
655 | .callback = video_set_use_native_backlight, | ||
656 | .ident = "HP ProBook 4540s", | ||
657 | .matches = { | ||
658 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
659 | DMI_MATCH(DMI_PRODUCT_VERSION, "HP ProBook 4540s"), | ||
660 | }, | ||
661 | }, | ||
662 | { | ||
663 | .callback = video_set_use_native_backlight, | ||
664 | .ident = "HP ProBook 2013 models", | ||
665 | .matches = { | ||
666 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
667 | DMI_MATCH(DMI_PRODUCT_NAME, "HP ProBook "), | ||
668 | DMI_MATCH(DMI_PRODUCT_NAME, " G1"), | ||
669 | }, | ||
670 | }, | ||
671 | { | ||
672 | .callback = video_set_use_native_backlight, | ||
673 | .ident = "HP EliteBook 2013 models", | ||
674 | .matches = { | ||
675 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
676 | DMI_MATCH(DMI_PRODUCT_NAME, "HP EliteBook "), | ||
677 | DMI_MATCH(DMI_PRODUCT_NAME, " G1"), | ||
678 | }, | ||
679 | }, | ||
680 | { | ||
681 | .callback = video_set_use_native_backlight, | ||
682 | .ident = "HP EliteBook 2014 models", | ||
683 | .matches = { | ||
684 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
685 | DMI_MATCH(DMI_PRODUCT_NAME, "HP EliteBook "), | ||
686 | DMI_MATCH(DMI_PRODUCT_NAME, " G2"), | ||
687 | }, | ||
688 | }, | ||
689 | { | ||
690 | .callback = video_set_use_native_backlight, | ||
691 | .ident = "HP ZBook 14", | ||
692 | .matches = { | ||
693 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
694 | DMI_MATCH(DMI_PRODUCT_NAME, "HP ZBook 14"), | ||
695 | }, | ||
696 | }, | ||
697 | { | ||
698 | .callback = video_set_use_native_backlight, | ||
699 | .ident = "HP ZBook 15", | ||
700 | .matches = { | ||
701 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
702 | DMI_MATCH(DMI_PRODUCT_NAME, "HP ZBook 15"), | ||
703 | }, | ||
704 | }, | ||
705 | { | ||
706 | .callback = video_set_use_native_backlight, | ||
707 | .ident = "HP ZBook 17", | ||
708 | .matches = { | ||
709 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
710 | DMI_MATCH(DMI_PRODUCT_NAME, "HP ZBook 17"), | ||
711 | }, | ||
712 | }, | ||
713 | { | ||
714 | .callback = video_set_use_native_backlight, | ||
715 | .ident = "HP EliteBook 8470p", | ||
716 | .matches = { | ||
717 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
718 | DMI_MATCH(DMI_PRODUCT_NAME, "HP EliteBook 8470p"), | ||
719 | }, | ||
720 | }, | ||
721 | { | ||
722 | .callback = video_set_use_native_backlight, | ||
723 | .ident = "HP EliteBook 8780w", | ||
724 | .matches = { | ||
725 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
726 | DMI_MATCH(DMI_PRODUCT_NAME, "HP EliteBook 8780w"), | ||
727 | }, | ||
728 | }, | ||
729 | 464 | ||
730 | /* | 465 | /* |
731 | * These models have a working acpi_video backlight control, and using | 466 | * These models have a working acpi_video backlight control, and using |
@@ -1419,6 +1154,23 @@ acpi_video_device_bind(struct acpi_video_bus *video, | |||
1419 | } | 1154 | } |
1420 | } | 1155 | } |
1421 | 1156 | ||
1157 | static bool acpi_video_device_in_dod(struct acpi_video_device *device) | ||
1158 | { | ||
1159 | struct acpi_video_bus *video = device->video; | ||
1160 | int i; | ||
1161 | |||
1162 | /* If we have a broken _DOD, no need to test */ | ||
1163 | if (!video->attached_count) | ||
1164 | return true; | ||
1165 | |||
1166 | for (i = 0; i < video->attached_count; i++) { | ||
1167 | if (video->attached_array[i].bind_info == device) | ||
1168 | return true; | ||
1169 | } | ||
1170 | |||
1171 | return false; | ||
1172 | } | ||
1173 | |||
1422 | /* | 1174 | /* |
1423 | * Arg: | 1175 | * Arg: |
1424 | * video : video bus device | 1176 | * video : video bus device |
@@ -1858,6 +1610,15 @@ static void acpi_video_dev_register_backlight(struct acpi_video_device *device) | |||
1858 | static int count; | 1610 | static int count; |
1859 | char *name; | 1611 | char *name; |
1860 | 1612 | ||
1613 | /* | ||
1614 | * Do not create backlight device for video output | ||
1615 | * device that is not in the enumerated list. | ||
1616 | */ | ||
1617 | if (!acpi_video_device_in_dod(device)) { | ||
1618 | dev_dbg(&device->dev->dev, "not in _DOD list, ignore\n"); | ||
1619 | return; | ||
1620 | } | ||
1621 | |||
1861 | result = acpi_video_init_brightness(device); | 1622 | result = acpi_video_init_brightness(device); |
1862 | if (result) | 1623 | if (result) |
1863 | return; | 1624 | return; |