aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/synaptics.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2009-12-04 02:21:14 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2009-12-04 02:25:36 -0500
commit7705d548cbe33f18ea7713b9a07aa11047aaeca4 (patch)
tree2d7b4337e74f6075f28718974a8c159f07c5eeda /drivers/input/mouse/synaptics.c
parentf72a28aba92d5a599c8a772e443aa8f079b3091f (diff)
Input: psmouse - do not carry DMI data around
DMI tables use considerable amount of memory. Mark them as __initconst so they will be discarded once module is loaded. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/mouse/synaptics.c')
-rw-r--r--drivers/input/mouse/synaptics.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index f4a61252bcc9..36d6df4c0a78 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,9 +630,10 @@ static int synaptics_reconnect(struct psmouse *psmouse)
629 return 0; 630 return 0;
630} 631}
631 632
632#if defined(__i386__) 633static bool impaired_toshiba_kbc;
633#include <linux/dmi.h> 634
634static const struct dmi_system_id toshiba_dmi_table[] = { 635static const struct dmi_system_id __initconst toshiba_dmi_table[] = {
636#if defined(CONFIG_DMI) && defined(CONFIG_X86)
635 { 637 {
636 .ident = "Toshiba Satellite", 638 .ident = "Toshiba Satellite",
637 .matches = { 639 .matches = {
@@ -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
672void __init synaptics_module_init(void)
673{
674 impaired_toshiba_kbc = dmi_check_system(toshiba_dmi_table);
675}
669 676
670int synaptics_init(struct psmouse *psmouse) 677int 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
748void __init synaptics_module_init(void)
749{
750}
751
743int synaptics_init(struct psmouse *psmouse) 752int synaptics_init(struct psmouse *psmouse)
744{ 753{
745 return -ENOSYS; 754 return -ENOSYS;