diff options
Diffstat (limited to 'drivers/input/mouse/synaptics.c')
-rw-r--r-- | drivers/input/mouse/synaptics.c | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index f4a61252bcc9..05689e732191 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c | |||
@@ -24,6 +24,7 @@ | |||
24 | */ | 24 | */ |
25 | 25 | ||
26 | #include <linux/module.h> | 26 | #include <linux/module.h> |
27 | #include <linux/dmi.h> | ||
27 | #include <linux/input.h> | 28 | #include <linux/input.h> |
28 | #include <linux/serio.h> | 29 | #include <linux/serio.h> |
29 | #include <linux/libps2.h> | 30 | #include <linux/libps2.h> |
@@ -629,25 +630,26 @@ static int synaptics_reconnect(struct psmouse *psmouse) | |||
629 | return 0; | 630 | return 0; |
630 | } | 631 | } |
631 | 632 | ||
632 | #if defined(__i386__) | 633 | static bool impaired_toshiba_kbc; |
633 | #include <linux/dmi.h> | 634 | |
634 | static const struct dmi_system_id toshiba_dmi_table[] = { | 635 | static const struct dmi_system_id __initconst toshiba_dmi_table[] = { |
636 | #if defined(CONFIG_DMI) && defined(CONFIG_X86) | ||
635 | { | 637 | { |
636 | .ident = "Toshiba Satellite", | 638 | /* Toshiba Satellite */ |
637 | .matches = { | 639 | .matches = { |
638 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), | 640 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), |
639 | DMI_MATCH(DMI_PRODUCT_NAME, "Satellite"), | 641 | DMI_MATCH(DMI_PRODUCT_NAME, "Satellite"), |
640 | }, | 642 | }, |
641 | }, | 643 | }, |
642 | { | 644 | { |
643 | .ident = "Toshiba Dynabook", | 645 | /* Toshiba Dynabook */ |
644 | .matches = { | 646 | .matches = { |
645 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), | 647 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), |
646 | DMI_MATCH(DMI_PRODUCT_NAME, "dynabook"), | 648 | DMI_MATCH(DMI_PRODUCT_NAME, "dynabook"), |
647 | }, | 649 | }, |
648 | }, | 650 | }, |
649 | { | 651 | { |
650 | .ident = "Toshiba Portege M300", | 652 | /* Toshiba Portege M300 */ |
651 | .matches = { | 653 | .matches = { |
652 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), | 654 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), |
653 | DMI_MATCH(DMI_PRODUCT_NAME, "PORTEGE M300"), | 655 | DMI_MATCH(DMI_PRODUCT_NAME, "PORTEGE M300"), |
@@ -655,7 +657,7 @@ static const struct dmi_system_id toshiba_dmi_table[] = { | |||
655 | 657 | ||
656 | }, | 658 | }, |
657 | { | 659 | { |
658 | .ident = "Toshiba Portege M300", | 660 | /* Toshiba Portege M300 */ |
659 | .matches = { | 661 | .matches = { |
660 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), | 662 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), |
661 | DMI_MATCH(DMI_PRODUCT_NAME, "Portable PC"), | 663 | DMI_MATCH(DMI_PRODUCT_NAME, "Portable PC"), |
@@ -664,8 +666,13 @@ static const struct dmi_system_id toshiba_dmi_table[] = { | |||
664 | 666 | ||
665 | }, | 667 | }, |
666 | { } | 668 | { } |
667 | }; | ||
668 | #endif | 669 | #endif |
670 | }; | ||
671 | |||
672 | void __init synaptics_module_init(void) | ||
673 | { | ||
674 | impaired_toshiba_kbc = dmi_check_system(toshiba_dmi_table); | ||
675 | } | ||
669 | 676 | ||
670 | int synaptics_init(struct psmouse *psmouse) | 677 | int synaptics_init(struct psmouse *psmouse) |
671 | { | 678 | { |
@@ -718,18 +725,16 @@ int synaptics_init(struct psmouse *psmouse) | |||
718 | if (SYN_CAP_PASS_THROUGH(priv->capabilities)) | 725 | if (SYN_CAP_PASS_THROUGH(priv->capabilities)) |
719 | synaptics_pt_create(psmouse); | 726 | synaptics_pt_create(psmouse); |
720 | 727 | ||
721 | #if defined(__i386__) | ||
722 | /* | 728 | /* |
723 | * Toshiba's KBC seems to have trouble handling data from | 729 | * Toshiba's KBC seems to have trouble handling data from |
724 | * Synaptics as full rate, switch to lower rate which is roughly | 730 | * Synaptics as full rate, switch to lower rate which is roughly |
725 | * thye same as rate of standard PS/2 mouse. | 731 | * thye same as rate of standard PS/2 mouse. |
726 | */ | 732 | */ |
727 | if (psmouse->rate >= 80 && dmi_check_system(toshiba_dmi_table)) { | 733 | if (psmouse->rate >= 80 && impaired_toshiba_kbc) { |
728 | printk(KERN_INFO "synaptics: Toshiba %s detected, limiting rate to 40pps.\n", | 734 | printk(KERN_INFO "synaptics: Toshiba %s detected, limiting rate to 40pps.\n", |
729 | dmi_get_system_info(DMI_PRODUCT_NAME)); | 735 | dmi_get_system_info(DMI_PRODUCT_NAME)); |
730 | psmouse->rate = 40; | 736 | psmouse->rate = 40; |
731 | } | 737 | } |
732 | #endif | ||
733 | 738 | ||
734 | return 0; | 739 | return 0; |
735 | 740 | ||
@@ -740,6 +745,10 @@ int synaptics_init(struct psmouse *psmouse) | |||
740 | 745 | ||
741 | #else /* CONFIG_MOUSE_PS2_SYNAPTICS */ | 746 | #else /* CONFIG_MOUSE_PS2_SYNAPTICS */ |
742 | 747 | ||
748 | void __init synaptics_module_init(void) | ||
749 | { | ||
750 | } | ||
751 | |||
743 | int synaptics_init(struct psmouse *psmouse) | 752 | int synaptics_init(struct psmouse *psmouse) |
744 | { | 753 | { |
745 | return -ENOSYS; | 754 | return -ENOSYS; |