summaryrefslogtreecommitdiff
path: root/drivers/input/mouse/synaptics.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2009-12-03 23:21:14 -0800
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2009-12-03 23:25:36 -0800
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 @@
*/
#include <linux/module.h>
+#include <linux/dmi.h>
#include <linux/input.h>
#include <linux/serio.h>
#include <linux/libps2.h>
@@ -629,9 +630,10 @@ static int synaptics_reconnect(struct psmouse *psmouse)
return 0;
}
-#if defined(__i386__)
-#include <linux/dmi.h>
-static const struct dmi_system_id toshiba_dmi_table[] = {
+static bool impaired_toshiba_kbc;
+
+static const struct dmi_system_id __initconst toshiba_dmi_table[] = {
+#if defined(CONFIG_DMI) && defined(CONFIG_X86)
{
.ident = "Toshiba Satellite",
.matches = {
@@ -664,8 +666,13 @@ static const struct dmi_system_id toshiba_dmi_table[] = {
},
{ }
-};
#endif
+};
+
+void __init synaptics_module_init(void)
+{
+ impaired_toshiba_kbc = dmi_check_system(toshiba_dmi_table);
+}
int synaptics_init(struct psmouse *psmouse)
{
@@ -718,18 +725,16 @@ int synaptics_init(struct psmouse *psmouse)
if (SYN_CAP_PASS_THROUGH(priv->capabilities))
synaptics_pt_create(psmouse);
-#if defined(__i386__)
/*
* Toshiba's KBC seems to have trouble handling data from
* Synaptics as full rate, switch to lower rate which is roughly
* thye same as rate of standard PS/2 mouse.
*/
- if (psmouse->rate >= 80 && dmi_check_system(toshiba_dmi_table)) {
+ if (psmouse->rate >= 80 && impaired_toshiba_kbc) {
printk(KERN_INFO "synaptics: Toshiba %s detected, limiting rate to 40pps.\n",
dmi_get_system_info(DMI_PRODUCT_NAME));
psmouse->rate = 40;
}
-#endif
return 0;
@@ -740,6 +745,10 @@ int synaptics_init(struct psmouse *psmouse)
#else /* CONFIG_MOUSE_PS2_SYNAPTICS */
+void __init synaptics_module_init(void)
+{
+}
+
int synaptics_init(struct psmouse *psmouse)
{
return -ENOSYS;