- patches.suse/slab-handle-memoryless-nodes-v2a.patch: Refresh.
[linux-flexiantxendom0-3.2.10.git] / drivers / input / mouse / synaptics.c
index 351e460..23eb7cf 100644 (file)
@@ -24,6 +24,7 @@
  */
 
 #include <linux/module.h>
+#include <linux/dmi.h>
 #include <linux/input.h>
 #include <linux/serio.h>
 #include <linux/libps2.h>
@@ -671,25 +672,26 @@ 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",
+               /* Toshiba Satellite */
                .matches = {
                        DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
                        DMI_MATCH(DMI_PRODUCT_NAME, "Satellite"),
                },
        },
        {
-               .ident = "Toshiba Dynabook",
+               /* Toshiba Dynabook */
                .matches = {
                        DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
                        DMI_MATCH(DMI_PRODUCT_NAME, "dynabook"),
                },
        },
        {
-               .ident = "Toshiba Portege M300",
+               /* Toshiba Portege M300 */
                .matches = {
                        DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
                        DMI_MATCH(DMI_PRODUCT_NAME, "PORTEGE M300"),
@@ -697,7 +699,7 @@ static const struct dmi_system_id toshiba_dmi_table[] = {
 
        },
        {
-               .ident = "Toshiba Portege M300",
+               /* Toshiba Portege M300 */
                .matches = {
                        DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
                        DMI_MATCH(DMI_PRODUCT_NAME, "Portable PC"),
@@ -706,8 +708,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)
 {
@@ -766,18 +773,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;
 
@@ -786,12 +791,26 @@ int synaptics_init(struct psmouse *psmouse)
        return -1;
 }
 
+bool synaptics_supported(void)
+{
+       return true;
+}
+
 #else /* CONFIG_MOUSE_PS2_SYNAPTICS */
 
+void __init synaptics_module_init(void)
+{
+}
+
 int synaptics_init(struct psmouse *psmouse)
 {
        return -ENOSYS;
 }
 
+bool synaptics_supported(void)
+{
+       return false;
+}
+
 #endif /* CONFIG_MOUSE_PS2_SYNAPTICS */