aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-05-30 13:17:19 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-05-30 13:17:19 -0400
commit7536d7be7b718f8c5834cbcb7601816562e1b805 (patch)
treeb9dd93b06bc2542465f67cf73851941f1bbc641b /drivers/input
parent57f50ca127a3189566af0d6378394c75a26f0f7e (diff)
parent5adad0133907790c50283bf03271d920d6897043 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: rename SW_RADIO to SW_RFKILL_ALL Input: gtco - fix double kfree in error handling path Input: pxa27x_keypad - miscellaneous fixes Input: atkbd - mark keyboard as disabled when suspending/unloading Input: apanel - remove duplicate include Input: wm9713 - support five wire panels Input: wm97xx-core - fix race on PHY init Input: wm97xx-core - fix driver name Input: wm97xx-core - report a phys for WM97xx touchscreens Input: i8042 - make sure Dritek quirk is invoked at resume Input: i8042 - add Dritek quirk for Acer TravelMate 660
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/keyboard/atkbd.c2
-rw-r--r--drivers/input/keyboard/pxa27x_keypad.c38
-rw-r--r--drivers/input/misc/apanel.c1
-rw-r--r--drivers/input/serio/i8042-x86ia64io.h7
-rw-r--r--drivers/input/serio/i8042.c33
-rw-r--r--drivers/input/tablet/gtco.c17
-rw-r--r--drivers/input/touchscreen/wm9713.c22
-rw-r--r--drivers/input/touchscreen/wm97xx-core.c25
8 files changed, 101 insertions, 44 deletions
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
index 4a95adc4cc78..af58a6f1e898 100644
--- a/drivers/input/keyboard/atkbd.c
+++ b/drivers/input/keyboard/atkbd.c
@@ -807,6 +807,8 @@ static int atkbd_activate(struct atkbd *atkbd)
807static void atkbd_cleanup(struct serio *serio) 807static void atkbd_cleanup(struct serio *serio)
808{ 808{
809 struct atkbd *atkbd = serio_get_drvdata(serio); 809 struct atkbd *atkbd = serio_get_drvdata(serio);
810
811 atkbd_disable(atkbd);
810 ps2_command(&atkbd->ps2dev, NULL, ATKBD_CMD_RESET_BAT); 812 ps2_command(&atkbd->ps2dev, NULL, ATKBD_CMD_RESET_BAT);
811} 813}
812 814
diff --git a/drivers/input/keyboard/pxa27x_keypad.c b/drivers/input/keyboard/pxa27x_keypad.c
index 3dea0c5077a9..45767e73f071 100644
--- a/drivers/input/keyboard/pxa27x_keypad.c
+++ b/drivers/input/keyboard/pxa27x_keypad.c
@@ -136,6 +136,9 @@ static void pxa27x_keypad_build_keycode(struct pxa27x_keypad *keypad)
136 set_bit(code, input_dev->keybit); 136 set_bit(code, input_dev->keybit);
137 } 137 }
138 138
139 for (i = 0; i < pdata->direct_key_num; i++)
140 set_bit(pdata->direct_key_map[i], input_dev->keybit);
141
139 keypad->rotary_up_key[0] = pdata->rotary0_up_key; 142 keypad->rotary_up_key[0] = pdata->rotary0_up_key;
140 keypad->rotary_up_key[1] = pdata->rotary1_up_key; 143 keypad->rotary_up_key[1] = pdata->rotary1_up_key;
141 keypad->rotary_down_key[0] = pdata->rotary0_down_key; 144 keypad->rotary_down_key[0] = pdata->rotary0_down_key;
@@ -143,17 +146,21 @@ static void pxa27x_keypad_build_keycode(struct pxa27x_keypad *keypad)
143 keypad->rotary_rel_code[0] = pdata->rotary0_rel_code; 146 keypad->rotary_rel_code[0] = pdata->rotary0_rel_code;
144 keypad->rotary_rel_code[1] = pdata->rotary1_rel_code; 147 keypad->rotary_rel_code[1] = pdata->rotary1_rel_code;
145 148
146 if (pdata->rotary0_up_key && pdata->rotary0_down_key) { 149 if (pdata->enable_rotary0) {
147 set_bit(pdata->rotary0_up_key, input_dev->keybit); 150 if (pdata->rotary0_up_key && pdata->rotary0_down_key) {
148 set_bit(pdata->rotary0_down_key, input_dev->keybit); 151 set_bit(pdata->rotary0_up_key, input_dev->keybit);
149 } else 152 set_bit(pdata->rotary0_down_key, input_dev->keybit);
150 set_bit(pdata->rotary0_rel_code, input_dev->relbit); 153 } else
151 154 set_bit(pdata->rotary0_rel_code, input_dev->relbit);
152 if (pdata->rotary1_up_key && pdata->rotary1_down_key) { 155 }
153 set_bit(pdata->rotary1_up_key, input_dev->keybit); 156
154 set_bit(pdata->rotary1_down_key, input_dev->keybit); 157 if (pdata->enable_rotary1) {
155 } else 158 if (pdata->rotary1_up_key && pdata->rotary1_down_key) {
156 set_bit(pdata->rotary1_rel_code, input_dev->relbit); 159 set_bit(pdata->rotary1_up_key, input_dev->keybit);
160 set_bit(pdata->rotary1_down_key, input_dev->keybit);
161 } else
162 set_bit(pdata->rotary1_rel_code, input_dev->relbit);
163 }
157} 164}
158 165
159static inline unsigned int lookup_matrix_keycode( 166static inline unsigned int lookup_matrix_keycode(
@@ -484,8 +491,13 @@ static int __devinit pxa27x_keypad_probe(struct platform_device *pdev)
484 keypad->input_dev = input_dev; 491 keypad->input_dev = input_dev;
485 input_set_drvdata(input_dev, keypad); 492 input_set_drvdata(input_dev, keypad);
486 493
487 input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP) | 494 input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP);
488 BIT_MASK(EV_REL); 495 if ((keypad->pdata->enable_rotary0 &&
496 keypad->pdata->rotary0_rel_code) ||
497 (keypad->pdata->enable_rotary1 &&
498 keypad->pdata->rotary1_rel_code)) {
499 input_dev->evbit[0] |= BIT_MASK(EV_REL);
500 }
489 501
490 pxa27x_keypad_build_keycode(keypad); 502 pxa27x_keypad_build_keycode(keypad);
491 platform_set_drvdata(pdev, keypad); 503 platform_set_drvdata(pdev, keypad);
diff --git a/drivers/input/misc/apanel.c b/drivers/input/misc/apanel.c
index 9531d8c7444f..d82f7f727f7a 100644
--- a/drivers/input/misc/apanel.c
+++ b/drivers/input/misc/apanel.c
@@ -20,7 +20,6 @@
20#include <linux/module.h> 20#include <linux/module.h>
21#include <linux/ioport.h> 21#include <linux/ioport.h>
22#include <linux/io.h> 22#include <linux/io.h>
23#include <linux/module.h>
24#include <linux/input-polldev.h> 23#include <linux/input-polldev.h>
25#include <linux/i2c.h> 24#include <linux/i2c.h>
26#include <linux/workqueue.h> 25#include <linux/workqueue.h>
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
index 5ece9f56babc..9aafa96cb746 100644
--- a/drivers/input/serio/i8042-x86ia64io.h
+++ b/drivers/input/serio/i8042-x86ia64io.h
@@ -331,6 +331,13 @@ static struct dmi_system_id __initdata i8042_dmi_dritek_table[] = {
331 }, 331 },
332 }, 332 },
333 { 333 {
334 .ident = "Acer TravelMate 660",
335 .matches = {
336 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
337 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 660"),
338 },
339 },
340 {
334 .ident = "Acer TravelMate 2490", 341 .ident = "Acer TravelMate 2490",
335 .matches = { 342 .matches = {
336 DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 343 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index 65a74cfc187b..592ff55b62d0 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -885,6 +885,20 @@ static long i8042_panic_blink(long count)
885 885
886#undef DELAY 886#undef DELAY
887 887
888#ifdef CONFIG_X86
889static void i8042_dritek_enable(void)
890{
891 char param = 0x90;
892 int error;
893
894 error = i8042_command(&param, 0x1059);
895 if (error)
896 printk(KERN_WARNING
897 "Failed to enable DRITEK extension: %d\n",
898 error);
899}
900#endif
901
888#ifdef CONFIG_PM 902#ifdef CONFIG_PM
889/* 903/*
890 * Here we try to restore the original BIOS settings. We only want to 904 * Here we try to restore the original BIOS settings. We only want to
@@ -942,6 +956,12 @@ static int i8042_resume(struct platform_device *dev)
942 return -EIO; 956 return -EIO;
943 } 957 }
944 958
959
960#ifdef CONFIG_X86
961 if (i8042_dritek)
962 i8042_dritek_enable();
963#endif
964
945 if (i8042_mux_present) { 965 if (i8042_mux_present) {
946 if (i8042_set_mux_mode(1, NULL) || i8042_enable_mux_ports()) 966 if (i8042_set_mux_mode(1, NULL) || i8042_enable_mux_ports())
947 printk(KERN_WARNING 967 printk(KERN_WARNING
@@ -1160,6 +1180,11 @@ static int __devinit i8042_probe(struct platform_device *dev)
1160 if (error) 1180 if (error)
1161 return error; 1181 return error;
1162 1182
1183#ifdef CONFIG_X86
1184 if (i8042_dritek)
1185 i8042_dritek_enable();
1186#endif
1187
1163 if (!i8042_noaux) { 1188 if (!i8042_noaux) {
1164 error = i8042_setup_aux(); 1189 error = i8042_setup_aux();
1165 if (error && error != -ENODEV && error != -EBUSY) 1190 if (error && error != -ENODEV && error != -EBUSY)
@@ -1171,14 +1196,6 @@ static int __devinit i8042_probe(struct platform_device *dev)
1171 if (error) 1196 if (error)
1172 goto out_fail; 1197 goto out_fail;
1173 } 1198 }
1174#ifdef CONFIG_X86
1175 if (i8042_dritek) {
1176 char param = 0x90;
1177 error = i8042_command(&param, 0x1059);
1178 if (error)
1179 goto out_fail;
1180 }
1181#endif
1182/* 1199/*
1183 * Ok, everything is ready, let's register all serio ports 1200 * Ok, everything is ready, let's register all serio ports
1184 */ 1201 */
diff --git a/drivers/input/tablet/gtco.c b/drivers/input/tablet/gtco.c
index c5a8661a1baa..1e748e46d12e 100644
--- a/drivers/input/tablet/gtco.c
+++ b/drivers/input/tablet/gtco.c
@@ -830,7 +830,7 @@ static int gtco_probe(struct usb_interface *usbinterface,
830 struct gtco *gtco; 830 struct gtco *gtco;
831 struct input_dev *input_dev; 831 struct input_dev *input_dev;
832 struct hid_descriptor *hid_desc; 832 struct hid_descriptor *hid_desc;
833 char *report = NULL; 833 char *report;
834 int result = 0, retry; 834 int result = 0, retry;
835 int error; 835 int error;
836 struct usb_endpoint_descriptor *endpoint; 836 struct usb_endpoint_descriptor *endpoint;
@@ -916,12 +916,16 @@ static int gtco_probe(struct usb_interface *usbinterface,
916 le16_to_cpu(hid_desc->wDescriptorLength), 916 le16_to_cpu(hid_desc->wDescriptorLength),
917 5000); /* 5 secs */ 917 5000); /* 5 secs */
918 918
919 if (result == le16_to_cpu(hid_desc->wDescriptorLength)) 919 dbg("usb_control_msg result: %d", result);
920 if (result == le16_to_cpu(hid_desc->wDescriptorLength)) {
921 parse_hid_report_descriptor(gtco, report, result);
920 break; 922 break;
923 }
921 } 924 }
922 925
926 kfree(report);
927
923 /* If we didn't get the report, fail */ 928 /* If we didn't get the report, fail */
924 dbg("usb_control_msg result: :%d", result);
925 if (result != le16_to_cpu(hid_desc->wDescriptorLength)) { 929 if (result != le16_to_cpu(hid_desc->wDescriptorLength)) {
926 err("Failed to get HID Report Descriptor of size: %d", 930 err("Failed to get HID Report Descriptor of size: %d",
927 hid_desc->wDescriptorLength); 931 hid_desc->wDescriptorLength);
@@ -929,12 +933,6 @@ static int gtco_probe(struct usb_interface *usbinterface,
929 goto err_free_urb; 933 goto err_free_urb;
930 } 934 }
931 935
932 /* Now we parse the report */
933 parse_hid_report_descriptor(gtco, report, result);
934
935 /* Now we delete it */
936 kfree(report);
937
938 /* Create a device file node */ 936 /* Create a device file node */
939 usb_make_path(gtco->usbdev, gtco->usbpath, sizeof(gtco->usbpath)); 937 usb_make_path(gtco->usbdev, gtco->usbpath, sizeof(gtco->usbpath));
940 strlcat(gtco->usbpath, "/input0", sizeof(gtco->usbpath)); 938 strlcat(gtco->usbpath, "/input0", sizeof(gtco->usbpath));
@@ -988,7 +986,6 @@ static int gtco_probe(struct usb_interface *usbinterface,
988 usb_buffer_free(gtco->usbdev, REPORT_MAX_SIZE, 986 usb_buffer_free(gtco->usbdev, REPORT_MAX_SIZE,
989 gtco->buffer, gtco->buf_dma); 987 gtco->buffer, gtco->buf_dma);
990 err_free_devs: 988 err_free_devs:
991 kfree(report);
992 input_free_device(input_dev); 989 input_free_device(input_dev);
993 kfree(gtco); 990 kfree(gtco);
994 return error; 991 return error;
diff --git a/drivers/input/touchscreen/wm9713.c b/drivers/input/touchscreen/wm9713.c
index 01278bd7e65c..838458792ea0 100644
--- a/drivers/input/touchscreen/wm9713.c
+++ b/drivers/input/touchscreen/wm9713.c
@@ -85,6 +85,15 @@ module_param(delay, int, 0);
85MODULE_PARM_DESC(delay, "Set adc sample delay."); 85MODULE_PARM_DESC(delay, "Set adc sample delay.");
86 86
87/* 87/*
88 * Set five_wire = 1 to use a 5 wire touchscreen.
89 *
90 * NOTE: Five wire mode does not allow for readback of pressure.
91 */
92static int five_wire;
93module_param(five_wire, int, 0);
94MODULE_PARM_DESC(five_wire, "Set to '1' to use 5-wire touchscreen.");
95
96/*
88 * Set adc mask function. 97 * Set adc mask function.
89 * 98 *
90 * Sources of glitch noise, such as signals driving an LCD display, may feed 99 * Sources of glitch noise, such as signals driving an LCD display, may feed
@@ -162,6 +171,19 @@ static void wm9713_phy_init(struct wm97xx *wm)
162 64000 / rpu); 171 64000 / rpu);
163 } 172 }
164 173
174 /* Five wire panel? */
175 if (five_wire) {
176 dig3 |= WM9713_45W;
177 dev_info(wm->dev, "setting 5-wire touchscreen mode.");
178
179 if (pil) {
180 dev_warn(wm->dev,
181 "Pressure measurement not supported in 5 "
182 "wire mode, disabling\n");
183 pil = 0;
184 }
185 }
186
165 /* touchpanel pressure */ 187 /* touchpanel pressure */
166 if (pil == 2) { 188 if (pil == 2) {
167 dig3 |= WM9712_PIL; 189 dig3 |= WM9712_PIL;
diff --git a/drivers/input/touchscreen/wm97xx-core.c b/drivers/input/touchscreen/wm97xx-core.c
index e9c7ea46b6e3..cdc24ad314e0 100644
--- a/drivers/input/touchscreen/wm97xx-core.c
+++ b/drivers/input/touchscreen/wm97xx-core.c
@@ -608,6 +608,17 @@ static int wm97xx_probe(struct device *dev)
608 goto alloc_err; 608 goto alloc_err;
609 } 609 }
610 610
611 /* set up physical characteristics */
612 wm->codec->phy_init(wm);
613
614 /* load gpio cache */
615 wm->gpio[0] = wm97xx_reg_read(wm, AC97_GPIO_CFG);
616 wm->gpio[1] = wm97xx_reg_read(wm, AC97_GPIO_POLARITY);
617 wm->gpio[2] = wm97xx_reg_read(wm, AC97_GPIO_STICKY);
618 wm->gpio[3] = wm97xx_reg_read(wm, AC97_GPIO_WAKEUP);
619 wm->gpio[4] = wm97xx_reg_read(wm, AC97_GPIO_STATUS);
620 wm->gpio[5] = wm97xx_reg_read(wm, AC97_MISC_AFE);
621
611 wm->input_dev = input_allocate_device(); 622 wm->input_dev = input_allocate_device();
612 if (wm->input_dev == NULL) { 623 if (wm->input_dev == NULL) {
613 ret = -ENOMEM; 624 ret = -ENOMEM;
@@ -616,6 +627,7 @@ static int wm97xx_probe(struct device *dev)
616 627
617 /* set up touch configuration */ 628 /* set up touch configuration */
618 wm->input_dev->name = "wm97xx touchscreen"; 629 wm->input_dev->name = "wm97xx touchscreen";
630 wm->input_dev->phys = "wm97xx";
619 wm->input_dev->open = wm97xx_ts_input_open; 631 wm->input_dev->open = wm97xx_ts_input_open;
620 wm->input_dev->close = wm97xx_ts_input_close; 632 wm->input_dev->close = wm97xx_ts_input_close;
621 set_bit(EV_ABS, wm->input_dev->evbit); 633 set_bit(EV_ABS, wm->input_dev->evbit);
@@ -634,17 +646,6 @@ static int wm97xx_probe(struct device *dev)
634 if (ret < 0) 646 if (ret < 0)
635 goto dev_alloc_err; 647 goto dev_alloc_err;
636 648
637 /* set up physical characteristics */
638 wm->codec->phy_init(wm);
639
640 /* load gpio cache */
641 wm->gpio[0] = wm97xx_reg_read(wm, AC97_GPIO_CFG);
642 wm->gpio[1] = wm97xx_reg_read(wm, AC97_GPIO_POLARITY);
643 wm->gpio[2] = wm97xx_reg_read(wm, AC97_GPIO_STICKY);
644 wm->gpio[3] = wm97xx_reg_read(wm, AC97_GPIO_WAKEUP);
645 wm->gpio[4] = wm97xx_reg_read(wm, AC97_GPIO_STATUS);
646 wm->gpio[5] = wm97xx_reg_read(wm, AC97_MISC_AFE);
647
648 /* register our battery device */ 649 /* register our battery device */
649 wm->battery_dev = platform_device_alloc("wm97xx-battery", -1); 650 wm->battery_dev = platform_device_alloc("wm97xx-battery", -1);
650 if (!wm->battery_dev) { 651 if (!wm->battery_dev) {
@@ -801,7 +802,7 @@ void wm97xx_unregister_mach_ops(struct wm97xx *wm)
801EXPORT_SYMBOL_GPL(wm97xx_unregister_mach_ops); 802EXPORT_SYMBOL_GPL(wm97xx_unregister_mach_ops);
802 803
803static struct device_driver wm97xx_driver = { 804static struct device_driver wm97xx_driver = {
804 .name = "ac97", 805 .name = "wm97xx-ts",
805 .bus = &ac97_bus_type, 806 .bus = &ac97_bus_type,
806 .owner = THIS_MODULE, 807 .owner = THIS_MODULE,
807 .probe = wm97xx_probe, 808 .probe = wm97xx_probe,