Skip to content

Commit 60b179a

Browse files
iksaifbwhacks
authored andcommitted
samsung-laptop: make the dmi check less strict
commit 3be324a upstream. This enable the driver for everything that look like a laptop and is from vendor "SAMSUNG ELECTRONICS CO., LTD.". Note that laptop supported by samsung-q10 seem to have a different vendor strict. Also remove every log output until we know that we have a SABI interface (except if the driver is forced to load, or debug is enabled). Keeping a whitelist of laptop with a model granularity is something that can't work without close vendor cooperation (and we don't have that). Signed-off-by: Corentin Chary <corentincj@iksaif.net> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Matthew Garrett <mjg@redhat.com> [bwh: Backported to 3.2: - Adjust context - Drop changes relating to ACPI video] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
1 parent 8432d22 commit 60b179a

1 file changed

Lines changed: 8 additions & 217 deletions

File tree

‎drivers/platform/x86/samsung-laptop.c‎

Lines changed: 8 additions & 217 deletions
Original file line numberDiff line numberDiff line change
@@ -540,245 +540,34 @@ static DEVICE_ATTR(performance_level, S_IWUSR | S_IRUGO,
540540
get_performance_level, set_performance_level);
541541

542542

543-
static int __init dmi_check_cb(const struct dmi_system_id *id)
544-
{
545-
pr_info("found laptop model '%s'\n",
546-
id->ident);
547-
return 1;
548-
}
549-
550543
static struct dmi_system_id __initdata samsung_dmi_table[] = {
551544
{
552-
.ident = "N128",
553-
.matches = {
554-
DMI_MATCH(DMI_SYS_VENDOR,
555-
"SAMSUNG ELECTRONICS CO., LTD."),
556-
DMI_MATCH(DMI_PRODUCT_NAME, "N128"),
557-
DMI_MATCH(DMI_BOARD_NAME, "N128"),
558-
},
559-
.callback = dmi_check_cb,
560-
},
561-
{
562-
.ident = "N130",
563545
.matches = {
564546
DMI_MATCH(DMI_SYS_VENDOR,
565547
"SAMSUNG ELECTRONICS CO., LTD."),
566-
DMI_MATCH(DMI_PRODUCT_NAME, "N130"),
567-
DMI_MATCH(DMI_BOARD_NAME, "N130"),
548+
DMI_MATCH(DMI_CHASSIS_TYPE, "8"), /* Portable */
568549
},
569-
.callback = dmi_check_cb,
570550
},
571551
{
572-
.ident = "N510",
573552
.matches = {
574553
DMI_MATCH(DMI_SYS_VENDOR,
575554
"SAMSUNG ELECTRONICS CO., LTD."),
576-
DMI_MATCH(DMI_PRODUCT_NAME, "N510"),
577-
DMI_MATCH(DMI_BOARD_NAME, "N510"),
555+
DMI_MATCH(DMI_CHASSIS_TYPE, "9"), /* Laptop */
578556
},
579-
.callback = dmi_check_cb,
580557
},
581558
{
582-
.ident = "X125",
583559
.matches = {
584560
DMI_MATCH(DMI_SYS_VENDOR,
585561
"SAMSUNG ELECTRONICS CO., LTD."),
586-
DMI_MATCH(DMI_PRODUCT_NAME, "X125"),
587-
DMI_MATCH(DMI_BOARD_NAME, "X125"),
562+
DMI_MATCH(DMI_CHASSIS_TYPE, "10"), /* Notebook */
588563
},
589-
.callback = dmi_check_cb,
590564
},
591565
{
592-
.ident = "X120/X170",
593566
.matches = {
594567
DMI_MATCH(DMI_SYS_VENDOR,
595568
"SAMSUNG ELECTRONICS CO., LTD."),
596-
DMI_MATCH(DMI_PRODUCT_NAME, "X120/X170"),
597-
DMI_MATCH(DMI_BOARD_NAME, "X120/X170"),
598-
},
599-
.callback = dmi_check_cb,
600-
},
601-
{
602-
.ident = "NC10",
603-
.matches = {
604-
DMI_MATCH(DMI_SYS_VENDOR,
605-
"SAMSUNG ELECTRONICS CO., LTD."),
606-
DMI_MATCH(DMI_PRODUCT_NAME, "NC10"),
607-
DMI_MATCH(DMI_BOARD_NAME, "NC10"),
608-
},
609-
.callback = dmi_check_cb,
610-
},
611-
{
612-
.ident = "NP-Q45",
613-
.matches = {
614-
DMI_MATCH(DMI_SYS_VENDOR,
615-
"SAMSUNG ELECTRONICS CO., LTD."),
616-
DMI_MATCH(DMI_PRODUCT_NAME, "SQ45S70S"),
617-
DMI_MATCH(DMI_BOARD_NAME, "SQ45S70S"),
618-
},
619-
.callback = dmi_check_cb,
620-
},
621-
{
622-
.ident = "X360",
623-
.matches = {
624-
DMI_MATCH(DMI_SYS_VENDOR,
625-
"SAMSUNG ELECTRONICS CO., LTD."),
626-
DMI_MATCH(DMI_PRODUCT_NAME, "X360"),
627-
DMI_MATCH(DMI_BOARD_NAME, "X360"),
628-
},
629-
.callback = dmi_check_cb,
630-
},
631-
{
632-
.ident = "R410 Plus",
633-
.matches = {
634-
DMI_MATCH(DMI_SYS_VENDOR,
635-
"SAMSUNG ELECTRONICS CO., LTD."),
636-
DMI_MATCH(DMI_PRODUCT_NAME, "R410P"),
637-
DMI_MATCH(DMI_BOARD_NAME, "R460"),
638-
},
639-
.callback = dmi_check_cb,
640-
},
641-
{
642-
.ident = "R518",
643-
.matches = {
644-
DMI_MATCH(DMI_SYS_VENDOR,
645-
"SAMSUNG ELECTRONICS CO., LTD."),
646-
DMI_MATCH(DMI_PRODUCT_NAME, "R518"),
647-
DMI_MATCH(DMI_BOARD_NAME, "R518"),
648-
},
649-
.callback = dmi_check_cb,
650-
},
651-
{
652-
.ident = "R519/R719",
653-
.matches = {
654-
DMI_MATCH(DMI_SYS_VENDOR,
655-
"SAMSUNG ELECTRONICS CO., LTD."),
656-
DMI_MATCH(DMI_PRODUCT_NAME, "R519/R719"),
657-
DMI_MATCH(DMI_BOARD_NAME, "R519/R719"),
658-
},
659-
.callback = dmi_check_cb,
660-
},
661-
{
662-
.ident = "N150/N210/N220",
663-
.matches = {
664-
DMI_MATCH(DMI_SYS_VENDOR,
665-
"SAMSUNG ELECTRONICS CO., LTD."),
666-
DMI_MATCH(DMI_PRODUCT_NAME, "N150/N210/N220"),
667-
DMI_MATCH(DMI_BOARD_NAME, "N150/N210/N220"),
668-
},
669-
.callback = dmi_check_cb,
670-
},
671-
{
672-
.ident = "N220",
673-
.matches = {
674-
DMI_MATCH(DMI_SYS_VENDOR,
675-
"SAMSUNG ELECTRONICS CO., LTD."),
676-
DMI_MATCH(DMI_PRODUCT_NAME, "N220"),
677-
DMI_MATCH(DMI_BOARD_NAME, "N220"),
678-
},
679-
.callback = dmi_check_cb,
680-
},
681-
{
682-
.ident = "N150/N210/N220/N230",
683-
.matches = {
684-
DMI_MATCH(DMI_SYS_VENDOR,
685-
"SAMSUNG ELECTRONICS CO., LTD."),
686-
DMI_MATCH(DMI_PRODUCT_NAME, "N150/N210/N220/N230"),
687-
DMI_MATCH(DMI_BOARD_NAME, "N150/N210/N220/N230"),
688-
},
689-
.callback = dmi_check_cb,
690-
},
691-
{
692-
.ident = "N150P/N210P/N220P",
693-
.matches = {
694-
DMI_MATCH(DMI_SYS_VENDOR,
695-
"SAMSUNG ELECTRONICS CO., LTD."),
696-
DMI_MATCH(DMI_PRODUCT_NAME, "N150P/N210P/N220P"),
697-
DMI_MATCH(DMI_BOARD_NAME, "N150P/N210P/N220P"),
698-
},
699-
.callback = dmi_check_cb,
700-
},
701-
{
702-
.ident = "R700",
703-
.matches = {
704-
DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
705-
DMI_MATCH(DMI_PRODUCT_NAME, "SR700"),
706-
DMI_MATCH(DMI_BOARD_NAME, "SR700"),
707-
},
708-
.callback = dmi_check_cb,
709-
},
710-
{
711-
.ident = "R530/R730",
712-
.matches = {
713-
DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
714-
DMI_MATCH(DMI_PRODUCT_NAME, "R530/R730"),
715-
DMI_MATCH(DMI_BOARD_NAME, "R530/R730"),
716-
},
717-
.callback = dmi_check_cb,
718-
},
719-
{
720-
.ident = "NF110/NF210/NF310",
721-
.matches = {
722-
DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
723-
DMI_MATCH(DMI_PRODUCT_NAME, "NF110/NF210/NF310"),
724-
DMI_MATCH(DMI_BOARD_NAME, "NF110/NF210/NF310"),
725-
},
726-
.callback = dmi_check_cb,
727-
},
728-
{
729-
.ident = "N145P/N250P/N260P",
730-
.matches = {
731-
DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
732-
DMI_MATCH(DMI_PRODUCT_NAME, "N145P/N250P/N260P"),
733-
DMI_MATCH(DMI_BOARD_NAME, "N145P/N250P/N260P"),
734-
},
735-
.callback = dmi_check_cb,
736-
},
737-
{
738-
.ident = "R70/R71",
739-
.matches = {
740-
DMI_MATCH(DMI_SYS_VENDOR,
741-
"SAMSUNG ELECTRONICS CO., LTD."),
742-
DMI_MATCH(DMI_PRODUCT_NAME, "R70/R71"),
743-
DMI_MATCH(DMI_BOARD_NAME, "R70/R71"),
744-
},
745-
.callback = dmi_check_cb,
746-
},
747-
{
748-
.ident = "P460",
749-
.matches = {
750-
DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
751-
DMI_MATCH(DMI_PRODUCT_NAME, "P460"),
752-
DMI_MATCH(DMI_BOARD_NAME, "P460"),
753-
},
754-
.callback = dmi_check_cb,
755-
},
756-
{
757-
.ident = "R528/R728",
758-
.matches = {
759-
DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
760-
DMI_MATCH(DMI_PRODUCT_NAME, "R528/R728"),
761-
DMI_MATCH(DMI_BOARD_NAME, "R528/R728"),
762-
},
763-
.callback = dmi_check_cb,
764-
},
765-
{
766-
.ident = "NC210/NC110",
767-
.matches = {
768-
DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
769-
DMI_MATCH(DMI_PRODUCT_NAME, "NC210/NC110"),
770-
DMI_MATCH(DMI_BOARD_NAME, "NC210/NC110"),
771-
},
772-
.callback = dmi_check_cb,
773-
},
774-
{
775-
.ident = "X520",
776-
.matches = {
777-
DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
778-
DMI_MATCH(DMI_PRODUCT_NAME, "X520"),
779-
DMI_MATCH(DMI_BOARD_NAME, "X520"),
569+
DMI_MATCH(DMI_CHASSIS_TYPE, "14"), /* Sub-Notebook */
780570
},
781-
.callback = dmi_check_cb,
782571
},
783572
{ },
784573
};
@@ -819,7 +608,8 @@ static int __init samsung_init(void)
819608

820609
f0000_segment = ioremap_nocache(0xf0000, 0xffff);
821610
if (!f0000_segment) {
822-
pr_err("Can't map the segment at 0xf0000\n");
611+
if (debug || force)
612+
pr_err("Can't map the segment at 0xf0000\n");
823613
return -EINVAL;
824614
}
825615

@@ -832,7 +622,8 @@ static int __init samsung_init(void)
832622
}
833623

834624
if (loca == 0xffff) {
835-
pr_err("This computer does not support SABI\n");
625+
if (debug || force)
626+
pr_err("This computer does not support SABI\n");
836627
goto error_no_signature;
837628
}
838629

0 commit comments

Comments
 (0)