Input: wistron - add support for TravelMate 610
[pandora-kernel.git] / drivers / input / misc / wistron_btns.c
index de0f46d..39e4375 100644 (file)
@@ -17,7 +17,7 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 59 Temple Place Suite 330, Boston, MA 02111-1307, USA.
  */
-#include <asm/io.h>
+#include <linux/io.h>
 #include <linux/dmi.h>
 #include <linux/init.h>
 #include <linux/input.h>
@@ -248,13 +248,10 @@ static int __init dmi_matched(struct dmi_system_id *dmi)
 
        keymap = dmi->driver_data;
        for (key = keymap; key->type != KE_END; key++) {
-               if (key->type == KE_WIFI) {
+               if (key->type == KE_WIFI)
                        have_wifi = 1;
-                       break;
-               } else if (key->type == KE_BLUETOOTH) {
+               else if (key->type == KE_BLUETOOTH)
                        have_bluetooth = 1;
-                       break;
-               }
        }
        return 1;
 }
@@ -327,6 +324,21 @@ static struct key_entry keymap_acer_travelmate_240[] = {
        { KE_END, 0 }
 };
 
+/* Wifi subsystem only activates the led. Therefore we need to pass
+ * wifi event as a normal key, then userspace can really change the wifi state.
+ * TODO we need to export led state to userspace (wifi and mail) */
+static struct key_entry keymap_acer_travelmate_610[] = {
+       { KE_KEY, 0x01, KEY_HELP },
+       { KE_KEY, 0x02, KEY_CONFIG },
+       { KE_KEY, 0x11, KEY_PROG1 },
+       { KE_KEY, 0x12, KEY_PROG2 },
+       { KE_KEY, 0x13, KEY_PROG3 },
+       { KE_KEY, 0x14, KEY_MAIL },
+       { KE_KEY, 0x15, KEY_WWW },
+       { KE_KEY, 0x40, KEY_WLAN }, /* Wifi */
+       { KE_END, 0 }
+};
+
 static struct key_entry keymap_aopen_1559as[] = {
        { KE_KEY,  0x01, KEY_HELP },
        { KE_KEY,  0x06, KEY_PROG3 },
@@ -338,6 +350,17 @@ static struct key_entry keymap_aopen_1559as[] = {
        { KE_END,  0 },
 };
 
+static struct key_entry keymap_fs_amilo_d88x0[] = {
+       { KE_KEY, 0x01, KEY_HELP },
+       { KE_KEY, 0x08, KEY_MUTE },
+       { KE_KEY, 0x31, KEY_MAIL },
+       { KE_KEY, 0x36, KEY_WWW },
+       { KE_KEY, 0x11, KEY_PROG1 },
+       { KE_KEY, 0x12, KEY_PROG2 },
+       { KE_KEY, 0x13, KEY_PROG3 },
+       { KE_END, 0 }
+};
+
 /*
  * If your machine is not here (which is currently rather likely), please send
  * a list of buttons and their key codes (reported when loading this module
@@ -389,7 +412,25 @@ static struct dmi_system_id dmi_ids[] __initdata = {
                },
                .driver_data = keymap_acer_travelmate_240
        },
-        {
+       {
+               .callback = dmi_matched,
+               .ident = "Acer TravelMate 2424NWXCi",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2420"),
+               },
+               .driver_data = keymap_acer_travelmate_240
+       },
+       {
+               .callback = dmi_matched,
+               .ident = "Acer TravelMate 610",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "ACER"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 610"),
+               },
+               .driver_data = keymap_acer_travelmate_610
+       },
+       {
                .callback = dmi_matched,
                .ident = "AOpen 1559AS",
                .matches = {
@@ -407,6 +448,15 @@ static struct dmi_system_id dmi_ids[] __initdata = {
                },
                .driver_data = keymap_wistron_ms2111
        },
+       {
+               .callback = dmi_matched,
+               .ident = "Fujitsu Siemens Amilo D88x0",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "AMILO D"),
+               },
+               .driver_data = keymap_fs_amilo_d88x0
+       },
        { NULL, }
 };