Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: remove scan_keyb driver
Input: i8042 - fix AUX IRQ delivery check
Input: wistron - add support for Fujitsu-Siemens Amilo D88x0
Input: inport - use correct config option for ATIXL
Input: HIL - handle erros from input_register_device()
Input: tsdev - schedule removal
Input: add Atlas button driver
Input: ads7846 - be more compatible with the hwmon framework
Input: ads7846 - detect pen up from GPIO state
Input: ads7846 - select correct SPI mode
Input: ads7846 - switch to using hrtimer
Input: ads7846 - optionally leave Vref on during differential measurements
Input: ads7846 - pluggable filtering logic
Input: gpio-keys - keyboard driver for GPIO buttons
Input: hid-ff - add support for Logitech Momo racing wheel
Input: i8042 - really suppress ACK/NAK during panic blink
Input: pc110pad - return proper error

+887 -415
+15
Documentation/feature-removal-schedule.txt
··· 319 319 replaced by the skge driver. 320 320 Who: Stephen Hemminger <shemminger@osdl.org> 321 321 322 + --------------------------- 323 + 324 + What: Compaq touchscreen device emulation 325 + When: Oct 2007 326 + Files: drivers/input/tsdev.c 327 + Why: The code says it was obsolete when it was written in 2001. 328 + tslib is a userspace library which does anything tsdev can do and 329 + much more besides in userspace where this code belongs. There is no 330 + longer any need for tsdev and applications should have converted to 331 + use tslib by now. 332 + The name "tsdev" is also extremely confusing and lots of people have 333 + it loaded when they don't need/use it. 334 + Who: Richard Purdie <rpurdie@rpsys.net> 335 + 336 + ---------------------------
-149
drivers/char/scan_keyb.c
··· 1 - /* 2 - * $Id: scan_keyb.c,v 1.2 2000/07/04 06:24:42 yaegashi Exp $ 3 - * Copyright (C) 2000 YAEGASHI Takeshi 4 - * Generic scan keyboard driver 5 - */ 6 - 7 - #include <linux/spinlock.h> 8 - #include <linux/sched.h> 9 - #include <linux/interrupt.h> 10 - #include <linux/tty.h> 11 - #include <linux/mm.h> 12 - #include <linux/signal.h> 13 - #include <linux/init.h> 14 - #include <linux/kbd_ll.h> 15 - #include <linux/delay.h> 16 - #include <linux/random.h> 17 - #include <linux/poll.h> 18 - #include <linux/miscdevice.h> 19 - #include <linux/slab.h> 20 - #include <linux/kbd_kern.h> 21 - #include <linux/timer.h> 22 - 23 - #define SCANHZ (HZ/20) 24 - 25 - struct scan_keyboard { 26 - struct scan_keyboard *next; 27 - int (*scan)(unsigned char *buffer); 28 - const unsigned char *table; 29 - unsigned char *s0, *s1; 30 - int length; 31 - }; 32 - 33 - static int scan_jiffies=0; 34 - static struct scan_keyboard *keyboards=NULL; 35 - struct timer_list scan_timer; 36 - 37 - static void check_kbd(const unsigned char *table, 38 - unsigned char *new, unsigned char *old, int length) 39 - { 40 - int need_tasklet_schedule=0; 41 - unsigned int xor, bit; 42 - 43 - while(length-->0) { 44 - if((xor=*new^*old)==0) { 45 - table+=8; 46 - } 47 - else { 48 - for(bit=0x01; bit<0x100; bit<<=1) { 49 - if(xor&bit) { 50 - handle_scancode(*table, !(*new&bit)); 51 - need_tasklet_schedule=1; 52 - #if 0 53 - printk("0x%x %s\n", *table, (*new&bit)?"released":"pressed"); 54 - #endif 55 - } 56 - table++; 57 - } 58 - } 59 - new++; old++; 60 - } 61 - 62 - if(need_tasklet_schedule) 63 - tasklet_schedule(&keyboard_tasklet); 64 - } 65 - 66 - 67 - static void scan_kbd(unsigned long dummy) 68 - { 69 - struct scan_keyboard *kbd; 70 - 71 - scan_jiffies++; 72 - 73 - for(kbd=keyboards; kbd!=NULL; kbd=kbd->next) { 74 - if(scan_jiffies&1) { 75 - if(!kbd->scan(kbd->s0)) 76 - check_kbd(kbd->table, 77 - kbd->s0, kbd->s1, kbd->length); 78 - else 79 - memcpy(kbd->s0, kbd->s1, kbd->length); 80 - } 81 - else { 82 - if(!kbd->scan(kbd->s1)) 83 - check_kbd(kbd->table, 84 - kbd->s1, kbd->s0, kbd->length); 85 - else 86 - memcpy(kbd->s1, kbd->s0, kbd->length); 87 - } 88 - 89 - } 90 - 91 - init_timer(&scan_timer); 92 - scan_timer.expires = jiffies + SCANHZ; 93 - scan_timer.data = 0; 94 - scan_timer.function = scan_kbd; 95 - add_timer(&scan_timer); 96 - } 97 - 98 - 99 - int register_scan_keyboard(int (*scan)(unsigned char *buffer), 100 - const unsigned char *table, 101 - int length) 102 - { 103 - struct scan_keyboard *kbd; 104 - 105 - kbd = kmalloc(sizeof(struct scan_keyboard), GFP_KERNEL); 106 - if (kbd == NULL) 107 - goto error_out; 108 - 109 - kbd->scan=scan; 110 - kbd->table=table; 111 - kbd->length=length; 112 - 113 - kbd->s0 = kmalloc(length, GFP_KERNEL); 114 - if (kbd->s0 == NULL) 115 - goto error_free_kbd; 116 - 117 - kbd->s1 = kmalloc(length, GFP_KERNEL); 118 - if (kbd->s1 == NULL) 119 - goto error_free_s0; 120 - 121 - memset(kbd->s0, -1, kbd->length); 122 - memset(kbd->s1, -1, kbd->length); 123 - 124 - kbd->next=keyboards; 125 - keyboards=kbd; 126 - 127 - return 0; 128 - 129 - error_free_s0: 130 - kfree(kbd->s0); 131 - 132 - error_free_kbd: 133 - kfree(kbd); 134 - 135 - error_out: 136 - return -ENOMEM; 137 - } 138 - 139 - 140 - void __init scan_kbd_init(void) 141 - { 142 - init_timer(&scan_timer); 143 - scan_timer.expires = jiffies + SCANHZ; 144 - scan_timer.data = 0; 145 - scan_timer.function = scan_kbd; 146 - add_timer(&scan_timer); 147 - 148 - printk(KERN_INFO "Generic scan keyboard driver initialized\n"); 149 - }
-15
drivers/char/scan_keyb.h
··· 1 - #ifndef __DRIVER_CHAR_SCAN_KEYB_H 2 - #define __DRIVER_CHAR_SCAN_KEYB_H 3 - /* 4 - * $Id: scan_keyb.h,v 1.1 2000/06/10 21:45:30 yaegashi Exp $ 5 - * Copyright (C) 2000 YAEGASHI Takeshi 6 - * Generic scan keyboard driver 7 - */ 8 - 9 - int register_scan_keyboard(int (*scan)(unsigned char *buffer), 10 - const unsigned char *table, 11 - int length); 12 - 13 - void __init scan_kbd_init(void); 14 - 15 - #endif
+16 -3
drivers/input/keyboard/Kconfig
··· 135 135 config KEYBOARD_CORGI 136 136 tristate "Corgi keyboard" 137 137 depends on PXA_SHARPSL 138 - default y 138 + default y 139 139 help 140 - Say Y here to enable the keyboard on the Sharp Zaurus SL-C7xx 140 + Say Y here to enable the keyboard on the Sharp Zaurus SL-C7xx 141 141 series of PDAs. 142 142 143 - To compile this driver as a module, choose M here: the 143 + To compile this driver as a module, choose M here: the 144 144 module will be called corgikbd. 145 145 146 146 config KEYBOARD_SPITZ ··· 213 213 214 214 To compile this driver as a module, choose M here: the 215 215 module will be called aaed2000_kbd. 216 + 217 + config KEYBOARD_GPIO 218 + tristate "Buttons on CPU GPIOs (PXA)" 219 + depends on ARCH_PXA 220 + help 221 + This driver implements support for buttons connected 222 + directly to GPIO pins of PXA CPUs. 223 + 224 + Say Y here if your device has buttons connected 225 + directly to GPIO pins of the CPU. 226 + 227 + To compile this driver as a module, choose M here: the 228 + module will be called gpio-keys. 216 229 217 230 endif
+3 -2
drivers/input/keyboard/Makefile
··· 16 16 obj-$(CONFIG_KEYBOARD_SPITZ) += spitzkbd.o 17 17 obj-$(CONFIG_KEYBOARD_HIL) += hil_kbd.o 18 18 obj-$(CONFIG_KEYBOARD_HIL_OLD) += hilkbd.o 19 - obj-$(CONFIG_KEYBOARD_OMAP) += omap-keypad.o 20 - obj-$(CONFIG_KEYBOARD_AAED2000) += aaed2000_kbd.o 19 + obj-$(CONFIG_KEYBOARD_OMAP) += omap-keypad.o 20 + obj-$(CONFIG_KEYBOARD_AAED2000) += aaed2000_kbd.o 21 + obj-$(CONFIG_KEYBOARD_GPIO) += gpio_keys.o 21 22
+147
drivers/input/keyboard/gpio_keys.c
··· 1 + /* 2 + * Driver for keys on GPIO lines capable of generating interrupts. 3 + * 4 + * Copyright 2005 Phil Blundell 5 + * 6 + * This program is free software; you can redistribute it and/or modify 7 + * it under the terms of the GNU General Public License version 2 as 8 + * published by the Free Software Foundation. 9 + */ 10 + 11 + #include <linux/module.h> 12 + #include <linux/version.h> 13 + 14 + #include <linux/init.h> 15 + #include <linux/fs.h> 16 + #include <linux/interrupt.h> 17 + #include <linux/irq.h> 18 + #include <linux/sched.h> 19 + #include <linux/pm.h> 20 + #include <linux/sysctl.h> 21 + #include <linux/proc_fs.h> 22 + #include <linux/delay.h> 23 + #include <linux/platform_device.h> 24 + #include <linux/input.h> 25 + #include <linux/irq.h> 26 + 27 + #include <asm/arch/pxa-regs.h> 28 + #include <asm/arch/hardware.h> 29 + 30 + #include <asm/hardware/gpio_keys.h> 31 + 32 + static irqreturn_t gpio_keys_isr(int irq, void *dev_id) 33 + { 34 + int i; 35 + struct platform_device *pdev = dev_id; 36 + struct gpio_keys_platform_data *pdata = pdev->dev.platform_data; 37 + struct input_dev *input = platform_get_drvdata(pdev); 38 + 39 + for (i = 0; i < pdata->nbuttons; i++) { 40 + int gpio = pdata->buttons[i].gpio; 41 + if (irq == IRQ_GPIO(gpio)) { 42 + int state = ((GPLR(gpio) & GPIO_bit(gpio)) ? 1 : 0) ^ (pdata->buttons[i].active_low); 43 + 44 + input_report_key(input, pdata->buttons[i].keycode, state); 45 + input_sync(input); 46 + } 47 + } 48 + 49 + return IRQ_HANDLED; 50 + } 51 + 52 + static int __devinit gpio_keys_probe(struct platform_device *pdev) 53 + { 54 + struct gpio_keys_platform_data *pdata = pdev->dev.platform_data; 55 + struct input_dev *input; 56 + int i, error; 57 + 58 + input = input_allocate_device(); 59 + if (!input) 60 + return -ENOMEM; 61 + 62 + platform_set_drvdata(pdev, input); 63 + 64 + input->evbit[0] = BIT(EV_KEY); 65 + 66 + input->name = pdev->name; 67 + input->phys = "gpio-keys/input0"; 68 + input->cdev.dev = &pdev->dev; 69 + input->private = pdata; 70 + 71 + input->id.bustype = BUS_HOST; 72 + input->id.vendor = 0x0001; 73 + input->id.product = 0x0001; 74 + input->id.version = 0x0100; 75 + 76 + for (i = 0; i < pdata->nbuttons; i++) { 77 + int code = pdata->buttons[i].keycode; 78 + int irq = IRQ_GPIO(pdata->buttons[i].gpio); 79 + 80 + set_irq_type(irq, IRQ_TYPE_EDGE_BOTH); 81 + error = request_irq(irq, gpio_keys_isr, SA_SAMPLE_RANDOM, 82 + pdata->buttons[i].desc ? pdata->buttons[i].desc : "gpio_keys", 83 + pdev); 84 + if (error) { 85 + printk(KERN_ERR "gpio-keys: unable to claim irq %d; error %d\n", irq, ret); 86 + goto fail; 87 + } 88 + set_bit(code, input->keybit); 89 + } 90 + 91 + error = input_register_device(input); 92 + if (error) { 93 + printk(KERN_ERR "Unable to register gpio-keys input device\n"); 94 + goto fail; 95 + } 96 + 97 + return 0; 98 + 99 + fail: 100 + for (i = i - 1; i >= 0; i--) 101 + free_irq(IRQ_GPIO(pdata->buttons[i].gpio), pdev); 102 + 103 + input_free_device(input); 104 + 105 + return error; 106 + } 107 + 108 + static int __devexit gpio_keys_remove(struct platform_device *pdev) 109 + { 110 + struct gpio_keys_platform_data *pdata = pdev->dev.platform_data; 111 + struct input_dev *input = platform_get_drvdata(pdev); 112 + int i; 113 + 114 + for (i = 0; i < pdata->nbuttons; i++) { 115 + int irq = IRQ_GPIO(pdata->buttons[i].gpio); 116 + free_irq(irq, pdev); 117 + } 118 + 119 + input_unregister_device(input); 120 + 121 + return 0; 122 + } 123 + 124 + struct platform_driver gpio_keys_device_driver = { 125 + .probe = gpio_keys_probe, 126 + .remove = __devexit_p(gpio_keys_remove), 127 + .driver = { 128 + .name = "gpio-keys", 129 + } 130 + }; 131 + 132 + static int __init gpio_keys_init(void) 133 + { 134 + return platform_driver_register(&gpio_keys_device_driver); 135 + } 136 + 137 + static void __exit gpio_keys_exit(void) 138 + { 139 + platform_driver_unregister(&gpio_keys_device_driver); 140 + } 141 + 142 + module_init(gpio_keys_init); 143 + module_exit(gpio_keys_exit); 144 + 145 + MODULE_LICENSE("GPL"); 146 + MODULE_AUTHOR("Phil Blundell <pb@handhelds.org>"); 147 + MODULE_DESCRIPTION("Keyboard driver for CPU GPIOs");
+66 -48
drivers/input/keyboard/hilkbd.c
··· 6 6 * Copyright (C) 1999-2006 Helge Deller <deller@gmx.de> 7 7 * 8 8 * Very basic HP Human Interface Loop (HIL) driver. 9 - * This driver handles the keyboard on HP300 (m68k) and on some 9 + * This driver handles the keyboard on HP300 (m68k) and on some 10 10 * HP700 (parisc) series machines. 11 11 * 12 - * 12 + * 13 13 * This file is subject to the terms and conditions of the GNU General Public 14 14 * License version 2. See the file COPYING in the main directory of this 15 15 * archive for more details. ··· 64 64 #endif 65 65 66 66 67 - 67 + 68 68 /* HIL helper functions */ 69 - 69 + 70 70 #define hil_busy() (hil_readb(HILBASE + HIL_CMD) & HIL_BUSY) 71 71 #define hil_data_available() (hil_readb(HILBASE + HIL_CMD) & HIL_DATA_RDY) 72 72 #define hil_status() (hil_readb(HILBASE + HIL_CMD)) ··· 75 75 #define hil_write_data(x) do { hil_writeb((x), HILBASE + HIL_DATA); } while (0) 76 76 77 77 /* HIL constants */ 78 - 78 + 79 79 #define HIL_BUSY 0x02 80 80 #define HIL_DATA_RDY 0x01 81 81 ··· 86 86 #define HIL_INTON 0x5C /* Turn on interrupts. */ 87 87 #define HIL_INTOFF 0x5D /* Turn off interrupts. */ 88 88 89 - #define HIL_READKBDSADR 0xF9 90 - #define HIL_WRITEKBDSADR 0xE9 89 + #define HIL_READKBDSADR 0xF9 90 + #define HIL_WRITEKBDSADR 0xE9 91 91 92 - static unsigned int hphilkeyb_keycode[HIL_KEYCODES_SET1_TBLSIZE] = 92 + static unsigned int hphilkeyb_keycode[HIL_KEYCODES_SET1_TBLSIZE] = 93 93 { HIL_KEYCODES_SET1 }; 94 94 95 95 /* HIL structure */ ··· 97 97 struct input_dev *dev; 98 98 99 99 unsigned int curdev; 100 - 100 + 101 101 unsigned char s; 102 102 unsigned char c; 103 103 int valid; 104 - 104 + 105 105 unsigned char data[16]; 106 106 unsigned int ptr; 107 107 spinlock_t lock; ··· 115 115 int down; 116 116 int key; 117 117 unsigned char scode; 118 - 118 + 119 119 switch (hil_dev.data[0]) { 120 120 case 0x40: 121 121 down = (hil_dev.data[1] & 1) == 0; ··· 126 126 } 127 127 hil_dev.curdev = 0; 128 128 } 129 + 129 130 130 131 static inline void handle_status(unsigned char s, unsigned char c) 131 132 { ··· 144 143 } 145 144 } 146 145 146 + 147 147 static inline void handle_data(unsigned char s, unsigned char c) 148 148 { 149 149 if (hil_dev.curdev) { ··· 154 152 } 155 153 156 154 157 - /* 158 - * Handle HIL interrupts. 159 - */ 155 + /* handle HIL interrupts */ 160 156 static irqreturn_t hil_interrupt(int irq, void *handle) 161 157 { 162 158 unsigned char s, c; 163 - 159 + 164 160 s = hil_status(); 165 161 c = hil_read_data(); 166 162 ··· 179 179 return IRQ_HANDLED; 180 180 } 181 181 182 - /* 183 - * Send a command to the HIL 184 - */ 185 182 183 + /* send a command to the HIL */ 186 184 static void hil_do(unsigned char cmd, unsigned char *data, unsigned int len) 187 185 { 188 186 unsigned long flags; ··· 198 200 } 199 201 200 202 201 - /* 202 - * Initialise HIL. 203 - */ 204 - 203 + /* initialise HIL */ 205 204 static int __init 206 205 hil_keyb_init(void) 207 206 { 208 207 unsigned char c; 209 208 unsigned int i, kbid; 210 209 wait_queue_head_t hil_wait; 210 + int err; 211 211 212 212 if (hil_dev.dev) { 213 213 return -ENODEV; /* already initialized */ ··· 215 219 if (!hil_dev.dev) 216 220 return -ENOMEM; 217 221 hil_dev.dev->private = &hil_dev; 218 - 222 + 219 223 #if defined(CONFIG_HP300) 220 - if (!hwreg_present((void *)(HILBASE + HIL_DATA))) 221 - return -ENODEV; 222 - 223 - request_region(HILBASE+HIL_DATA, 2, "hil"); 224 + if (!hwreg_present((void *)(HILBASE + HIL_DATA))) { 225 + printk(KERN_ERR "HIL: hardware register was not found\n"); 226 + err = -ENODEV; 227 + goto err1; 228 + } 229 + if (!request_region(HILBASE + HIL_DATA, 2, "hil")) { 230 + printk(KERN_ERR "HIL: IOPORT region already used\n"); 231 + err = -EIO; 232 + goto err1; 233 + } 224 234 #endif 225 - 226 - request_irq(HIL_IRQ, hil_interrupt, 0, "hil", hil_dev.dev_id); 235 + 236 + err = request_irq(HIL_IRQ, hil_interrupt, 0, "hil", hil_dev.dev_id); 237 + if (err) { 238 + printk(KERN_ERR "HIL: Can't get IRQ\n"); 239 + goto err2; 240 + } 227 241 228 242 /* Turn on interrupts */ 229 243 hil_do(HIL_INTON, NULL, 0); ··· 245 239 init_waitqueue_head(&hil_wait); 246 240 wait_event_interruptible_timeout(hil_wait, hil_dev.valid, 3*HZ); 247 241 if (!hil_dev.valid) { 248 - printk(KERN_WARNING "HIL: timed out, assuming no keyboard present.\n"); 242 + printk(KERN_WARNING "HIL: timed out, assuming no keyboard present\n"); 249 243 } 250 244 251 - c = hil_dev.c; 245 + c = hil_dev.c; 252 246 hil_dev.valid = 0; 253 247 if (c == 0) { 254 248 kbid = -1; 255 - printk(KERN_WARNING "HIL: no keyboard present.\n"); 249 + printk(KERN_WARNING "HIL: no keyboard present\n"); 256 250 } else { 257 251 kbid = ffz(~c); 258 - /* printk(KERN_INFO "HIL: keyboard found at id %d\n", kbid); */ 252 + printk(KERN_INFO "HIL: keyboard found at id %d\n", kbid); 259 253 } 260 254 261 255 /* set it to raw mode */ 262 256 c = 0; 263 257 hil_do(HIL_WRITEKBDSADR, &c, 1); 264 - 258 + 265 259 for (i = 0; i < HIL_KEYCODES_SET1_TBLSIZE; i++) 266 260 if (hphilkeyb_keycode[i] != KEY_RESERVED) 267 261 set_bit(hphilkeyb_keycode[i], hil_dev.dev->keybit); 268 262 269 - hil_dev.dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP); 270 - hil_dev.dev->ledbit[0] = BIT(LED_NUML) | BIT(LED_CAPSL) | BIT(LED_SCROLLL); 271 - hil_dev.dev->keycodemax = HIL_KEYCODES_SET1_TBLSIZE; 272 - hil_dev.dev->keycodesize = sizeof(hphilkeyb_keycode[0]); 273 - hil_dev.dev->keycode = hphilkeyb_keycode; 274 - hil_dev.dev->name = "HIL keyboard"; 275 - hil_dev.dev->phys = "hpkbd/input0"; 263 + hil_dev.dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP); 264 + hil_dev.dev->ledbit[0] = BIT(LED_NUML) | BIT(LED_CAPSL) | BIT(LED_SCROLLL); 265 + hil_dev.dev->keycodemax = HIL_KEYCODES_SET1_TBLSIZE; 266 + hil_dev.dev->keycodesize= sizeof(hphilkeyb_keycode[0]); 267 + hil_dev.dev->keycode = hphilkeyb_keycode; 268 + hil_dev.dev->name = "HIL keyboard"; 269 + hil_dev.dev->phys = "hpkbd/input0"; 276 270 277 271 hil_dev.dev->id.bustype = BUS_HIL; 278 272 hil_dev.dev->id.vendor = PCI_VENDOR_ID_HP; 279 273 hil_dev.dev->id.product = 0x0001; 280 274 hil_dev.dev->id.version = 0x0010; 281 275 282 - input_register_device(hil_dev.dev); 276 + err = input_register_device(hil_dev.dev); 277 + if (err) { 278 + printk(KERN_ERR "HIL: Can't register device\n"); 279 + goto err3; 280 + } 283 281 printk(KERN_INFO "input: %s, ID %d at 0x%08lx (irq %d) found and attached\n", 284 - hil_dev.dev->name, kbid, HILBASE, HIL_IRQ); 282 + hil_dev.dev->name, kbid, HILBASE, HIL_IRQ); 285 283 286 284 return 0; 285 + 286 + err3: 287 + hil_do(HIL_INTOFF, NULL, 0); 288 + disable_irq(HIL_IRQ); 289 + free_irq(HIL_IRQ, hil_dev.dev_id); 290 + err2: 291 + release_region(HILBASE + HIL_DATA, 2); 292 + err1: 293 + input_free_device(hil_dev.dev); 294 + hil_dev.dev = NULL; 295 + return err; 287 296 } 297 + 288 298 289 299 #if defined(CONFIG_PARISC) 290 300 static int __init ··· 314 292 hil_base = dev->hpa.start; 315 293 hil_irq = dev->irq; 316 294 hil_dev.dev_id = dev; 317 - 295 + 318 296 printk(KERN_INFO "Found HIL bus at 0x%08lx, IRQ %d\n", hil_base, hil_irq); 319 297 320 298 return hil_keyb_init(); ··· 333 311 .probe = hil_init_chip, 334 312 }; 335 313 #endif /* CONFIG_PARISC */ 336 - 337 - 338 - 339 314 340 315 341 316 static int __init hil_init(void) ··· 368 349 369 350 module_init(hil_init); 370 351 module_exit(hil_exit); 371 -
+10
drivers/input/misc/Kconfig
··· 50 50 To compile this driver as a module, choose M here: the module will 51 51 be called wistron_btns. 52 52 53 + config INPUT_ATLAS_BTNS 54 + tristate "x86 Atlas button interface" 55 + depends on X86 && ACPI 56 + help 57 + Say Y here for support of Atlas wallmount touchscreen buttons. 58 + The events will show up as scancodes F1 through F9 via evdev. 59 + 60 + To compile this driver as a module, choose M here: the module will 61 + be called atlas_btns. 62 + 53 63 config INPUT_IXP4XX_BEEPER 54 64 tristate "IXP4XX Beeper support" 55 65 depends on ARCH_IXP4XX
+1
drivers/input/misc/Makefile
··· 9 9 obj-$(CONFIG_INPUT_M68K_BEEP) += m68kspkr.o 10 10 obj-$(CONFIG_INPUT_UINPUT) += uinput.o 11 11 obj-$(CONFIG_INPUT_WISTRON_BTNS) += wistron_btns.o 12 + obj-$(CONFIG_INPUT_ATLAS_BTNS) += atlas_btns.o 12 13 obj-$(CONFIG_HP_SDC_RTC) += hp_sdc_rtc.o 13 14 obj-$(CONFIG_INPUT_IXP4XX_BEEPER) += ixp4xx-beeper.o
+170
drivers/input/misc/atlas_btns.c
··· 1 + /* 2 + * atlas_btns.c - Atlas Wallmount Touchscreen ACPI Extras 3 + * 4 + * Copyright (C) 2006 Jaya Kumar 5 + * Based on Toshiba ACPI by John Belmonte and ASUS ACPI 6 + * This work was sponsored by CIS(M) Sdn Bhd. 7 + * 8 + * This program is free software; you can redistribute it and/or modify 9 + * it under the terms of the GNU General Public License as published by 10 + * the Free Software Foundation; either version 2 of the License, or 11 + * (at your option) any later version. 12 + * 13 + * This program is distributed in the hope that it will be useful, 14 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 + * GNU General Public License for more details. 17 + * 18 + * You should have received a copy of the GNU General Public License 19 + * along with this program; if not, write to the Free Software 20 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 + * 22 + */ 23 + 24 + #include <linux/kernel.h> 25 + #include <linux/module.h> 26 + #include <linux/init.h> 27 + #include <linux/input.h> 28 + #include <linux/types.h> 29 + #include <asm/uaccess.h> 30 + #include <acpi/acpi_drivers.h> 31 + 32 + #define ACPI_ATLAS_NAME "Atlas ACPI" 33 + #define ACPI_ATLAS_CLASS "Atlas" 34 + #define ACPI_ATLAS_BUTTON_HID "ASIM0000" 35 + 36 + static struct input_dev *input_dev; 37 + 38 + /* button handling code */ 39 + static acpi_status acpi_atlas_button_setup(acpi_handle region_handle, 40 + u32 function, void *handler_context, void **return_context) 41 + { 42 + *return_context = 43 + (function != ACPI_REGION_DEACTIVATE) ? handler_context : NULL; 44 + 45 + return AE_OK; 46 + } 47 + 48 + static acpi_status acpi_atlas_button_handler(u32 function, 49 + acpi_physical_address address, 50 + u32 bit_width, acpi_integer *value, 51 + void *handler_context, void *region_context) 52 + { 53 + acpi_status status; 54 + int keycode; 55 + 56 + if (function == ACPI_WRITE) { 57 + keycode = KEY_F1 + (address & 0x0F); 58 + input_report_key(input_dev, keycode, !(address & 0x10)); 59 + input_sync(input_dev); 60 + status = 0; 61 + } else { 62 + printk(KERN_WARNING "atlas: shrugged on unexpected function" 63 + ":function=%x,address=%lx,value=%x\n", 64 + function, (unsigned long)address, (u32)*value); 65 + status = -EINVAL; 66 + } 67 + 68 + return status; 69 + } 70 + 71 + static int atlas_acpi_button_add(struct acpi_device *device) 72 + { 73 + acpi_status status; 74 + int err; 75 + 76 + input_dev = input_allocate_device(); 77 + if (!input_dev) { 78 + printk(KERN_ERR "atlas: unable to allocate input device\n"); 79 + return -ENOMEM; 80 + } 81 + 82 + input_dev->name = "Atlas ACPI button driver"; 83 + input_dev->phys = "ASIM0000/atlas/input0"; 84 + input_dev->id.bustype = BUS_HOST; 85 + input_dev->evbit[LONG(EV_KEY)] = BIT(EV_KEY); 86 + 87 + set_bit(KEY_F1, input_dev->keybit); 88 + set_bit(KEY_F2, input_dev->keybit); 89 + set_bit(KEY_F3, input_dev->keybit); 90 + set_bit(KEY_F4, input_dev->keybit); 91 + set_bit(KEY_F5, input_dev->keybit); 92 + set_bit(KEY_F6, input_dev->keybit); 93 + set_bit(KEY_F7, input_dev->keybit); 94 + set_bit(KEY_F8, input_dev->keybit); 95 + set_bit(KEY_F9, input_dev->keybit); 96 + 97 + err = input_register_device(input_dev); 98 + if (err) { 99 + printk(KERN_ERR "atlas: couldn't register input device\n"); 100 + input_free_device(input_dev); 101 + return err; 102 + } 103 + 104 + /* hookup button handler */ 105 + status = acpi_install_address_space_handler(device->handle, 106 + 0x81, &acpi_atlas_button_handler, 107 + &acpi_atlas_button_setup, device); 108 + if (ACPI_FAILURE(status)) { 109 + printk(KERN_ERR "Atlas: Error installing addr spc handler\n"); 110 + input_unregister_device(input_dev); 111 + status = -EINVAL; 112 + } 113 + 114 + return status; 115 + } 116 + 117 + static int atlas_acpi_button_remove(struct acpi_device *device, int type) 118 + { 119 + acpi_status status; 120 + 121 + status = acpi_remove_address_space_handler(device->handle, 122 + 0x81, &acpi_atlas_button_handler); 123 + if (ACPI_FAILURE(status)) { 124 + printk(KERN_ERR "Atlas: Error removing addr spc handler\n"); 125 + status = -EINVAL; 126 + } 127 + 128 + input_unregister_device(input_dev); 129 + 130 + return status; 131 + } 132 + 133 + static struct acpi_driver atlas_acpi_driver = { 134 + .name = ACPI_ATLAS_NAME, 135 + .class = ACPI_ATLAS_CLASS, 136 + .ids = ACPI_ATLAS_BUTTON_HID, 137 + .ops = { 138 + .add = atlas_acpi_button_add, 139 + .remove = atlas_acpi_button_remove, 140 + }, 141 + }; 142 + 143 + static int __init atlas_acpi_init(void) 144 + { 145 + int result; 146 + 147 + if (acpi_disabled) 148 + return -ENODEV; 149 + 150 + result = acpi_bus_register_driver(&atlas_acpi_driver); 151 + if (result < 0) { 152 + printk(KERN_ERR "Atlas ACPI: Unable to register driver\n"); 153 + return -ENODEV; 154 + } 155 + 156 + return 0; 157 + } 158 + 159 + static void __exit atlas_acpi_exit(void) 160 + { 161 + acpi_bus_unregister_driver(&atlas_acpi_driver); 162 + } 163 + 164 + module_init(atlas_acpi_init); 165 + module_exit(atlas_acpi_exit); 166 + 167 + MODULE_AUTHOR("Jaya Kumar"); 168 + MODULE_LICENSE("GPL"); 169 + MODULE_DESCRIPTION("Atlas button driver"); 170 +
+20
drivers/input/misc/wistron_btns.c
··· 335 335 { KE_END, 0 }, 336 336 }; 337 337 338 + static struct key_entry keymap_fs_amilo_d88x0[] = { 339 + { KE_KEY, 0x01, KEY_HELP }, 340 + { KE_KEY, 0x08, KEY_MUTE }, 341 + { KE_KEY, 0x31, KEY_MAIL }, 342 + { KE_KEY, 0x36, KEY_WWW }, 343 + { KE_KEY, 0x11, KEY_PROG1 }, 344 + { KE_KEY, 0x12, KEY_PROG2 }, 345 + { KE_KEY, 0x13, KEY_PROG3 }, 346 + { KE_END, 0 } 347 + }; 348 + 338 349 /* 339 350 * If your machine is not here (which is currently rather likely), please send 340 351 * a list of buttons and their key codes (reported when loading this module ··· 423 412 DMI_MATCH(DMI_PRODUCT_NAME, "MD 9783"), 424 413 }, 425 414 .driver_data = keymap_wistron_ms2111 415 + }, 416 + { 417 + .callback = dmi_matched, 418 + .ident = "Fujitsu Siemens Amilo D88x0", 419 + .matches = { 420 + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), 421 + DMI_MATCH(DMI_PRODUCT_NAME, "AMILO D"), 422 + }, 423 + .driver_data = keymap_fs_amilo_d88x0 426 424 }, 427 425 { NULL, } 428 426 };
+1 -1
drivers/input/mouse/inport.c
··· 61 61 #define INPORT_REG_MODE 0x07 62 62 #define INPORT_RESET 0x80 63 63 64 - #ifdef CONFIG_INPUT_ATIXL 64 + #ifdef CONFIG_MOUSE_ATIXL 65 65 #define INPORT_NAME "ATI XL Mouse" 66 66 #define INPORT_VENDOR 0x0002 67 67 #define INPORT_SPEED_30HZ 0x01
+1 -1
drivers/input/mouse/pc110pad.c
··· 113 113 dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, NULL); 114 114 if (dev) { 115 115 pci_dev_put(dev); 116 - return -ENOENT; 116 + return -ENODEV; 117 117 } 118 118 119 119 if (!request_region(pc110pad_io, 4, "pc110pad")) {
+8 -4
drivers/input/serio/i8042.c
··· 371 371 if (unlikely(i8042_suppress_kbd_ack)) 372 372 if (port_no == I8042_KBD_PORT_NO && 373 373 (data == 0xfa || data == 0xfe)) { 374 - i8042_suppress_kbd_ack = 0; 374 + i8042_suppress_kbd_ack--; 375 375 goto out; 376 376 } 377 377 ··· 543 543 { 544 544 int retval = -1; 545 545 int irq_registered = 0; 546 + int aux_loop_broken = 0; 546 547 unsigned long flags; 547 548 unsigned char param; 548 549 ··· 573 572 if (i8042_command(&param, I8042_CMD_AUX_TEST) || 574 573 (param && param != 0xfa && param != 0xff)) 575 574 return -1; 575 + 576 + aux_loop_broken = 1; 576 577 } 577 578 578 579 /* ··· 598 595 * used it for a PCI card or somethig else. 599 596 */ 600 597 601 - if (i8042_noloop) { 598 + if (i8042_noloop || aux_loop_broken) { 602 599 /* 603 600 * Without LOOP command we can't test AUX IRQ delivery. Assume the port 604 601 * is working and hope we are right. ··· 841 838 led ^= 0x01 | 0x04; 842 839 while (i8042_read_status() & I8042_STR_IBF) 843 840 DELAY; 844 - i8042_suppress_kbd_ack = 1; 841 + dbg("%02x -> i8042 (panic blink)", 0xed); 842 + i8042_suppress_kbd_ack = 2; 845 843 i8042_write_data(0xed); /* set leds */ 846 844 DELAY; 847 845 while (i8042_read_status() & I8042_STR_IBF) 848 846 DELAY; 849 847 DELAY; 850 - i8042_suppress_kbd_ack = 1; 848 + dbg("%02x -> i8042 (panic blink)", led); 851 849 i8042_write_data(led); 852 850 DELAY; 853 851 last_blink = count;
+7 -2
drivers/input/touchscreen/Kconfig
··· 12 12 if INPUT_TOUCHSCREEN 13 13 14 14 config TOUCHSCREEN_ADS7846 15 - tristate "ADS 7846 based touchscreens" 15 + tristate "ADS 7846/7843 based touchscreens" 16 16 depends on SPI_MASTER 17 + depends on HWMON = n || HWMON 17 18 help 18 19 Say Y here if you have a touchscreen interface using the 19 - ADS7846 controller, and your board-specific initialization 20 + ADS7846 or ADS7843 controller, and your board-specific setup 20 21 code includes that in its table of SPI devices. 22 + 23 + If HWMON is selected, and the driver is told the reference voltage 24 + on your board, you will also get hwmon interfaces for the voltage 25 + (and on ads7846, temperature) sensors of this chip. 21 26 22 27 If unsure, say N (but it's safe to say "Y"). 23 28
+387 -190
drivers/input/touchscreen/ads7846.c
··· 17 17 * it under the terms of the GNU General Public License version 2 as 18 18 * published by the Free Software Foundation. 19 19 */ 20 - #include <linux/device.h> 20 + #include <linux/hwmon.h> 21 21 #include <linux/init.h> 22 + #include <linux/err.h> 22 23 #include <linux/delay.h> 23 24 #include <linux/input.h> 24 25 #include <linux/interrupt.h> ··· 55 54 * files. 56 55 */ 57 56 58 - #define TS_POLL_PERIOD msecs_to_jiffies(10) 57 + #define TS_POLL_DELAY (1 * 1000000) /* ns delay before the first sample */ 58 + #define TS_POLL_PERIOD (5 * 1000000) /* ns delay between samples */ 59 59 60 60 /* this driver doesn't aim at the peak continuous sample rate */ 61 61 #define SAMPLE_BITS (8 /*cmd*/ + 16 /*sample*/ + 2 /* before, after */) ··· 65 63 /* For portability, we can't read 12 bit values using SPI (which 66 64 * would make the controller deliver them as native byteorder u16 67 65 * with msbs zeroed). Instead, we read them as two 8-bit values, 68 - * which need byteswapping then range adjustment. 66 + * *** WHICH NEED BYTESWAPPING *** and range adjustment. 69 67 */ 70 - __be16 x; 71 - __be16 y; 72 - __be16 z1, z2; 73 - int ignore; 68 + u16 x; 69 + u16 y; 70 + u16 z1, z2; 71 + int ignore; 74 72 }; 75 73 76 74 struct ads7846 { ··· 78 76 char phys[32]; 79 77 80 78 struct spi_device *spi; 79 + 80 + #if defined(CONFIG_HWMON) || defined(CONFIG_HWMON_MODULE) 81 81 struct attribute_group *attr_group; 82 + struct class_device *hwmon; 83 + #endif 84 + 82 85 u16 model; 83 86 u16 vref_delay_usecs; 84 87 u16 x_plate_ohms; ··· 106 99 u16 debounce_rep; 107 100 108 101 spinlock_t lock; 109 - struct timer_list timer; /* P: lock */ 102 + struct hrtimer timer; 110 103 unsigned pendown:1; /* P: lock */ 111 104 unsigned pending:1; /* P: lock */ 112 105 // FIXME remove "irq_disabled" 113 106 unsigned irq_disabled:1; /* P: lock */ 114 107 unsigned disabled:1; 115 108 109 + int (*filter)(void *data, int data_idx, int *val); 110 + void *filter_data; 111 + void (*filter_cleanup)(void *data); 116 112 int (*get_pendown_state)(void); 117 113 }; 118 114 ··· 152 142 #define MAX_12BIT ((1<<12)-1) 153 143 154 144 /* leave ADC powered up (disables penirq) between differential samples */ 155 - #define READ_12BIT_DFR(x) (ADS_START | ADS_A2A1A0_d_ ## x \ 156 - | ADS_12_BIT | ADS_DFR) 145 + #define READ_12BIT_DFR(x, adc, vref) (ADS_START | ADS_A2A1A0_d_ ## x \ 146 + | ADS_12_BIT | ADS_DFR | \ 147 + (adc ? ADS_PD10_ADC_ON : 0) | (vref ? ADS_PD10_REF_ON : 0)) 157 148 158 - #define READ_Y (READ_12BIT_DFR(y) | ADS_PD10_ADC_ON) 159 - #define READ_Z1 (READ_12BIT_DFR(z1) | ADS_PD10_ADC_ON) 160 - #define READ_Z2 (READ_12BIT_DFR(z2) | ADS_PD10_ADC_ON) 149 + #define READ_Y(vref) (READ_12BIT_DFR(y, 1, vref)) 150 + #define READ_Z1(vref) (READ_12BIT_DFR(z1, 1, vref)) 151 + #define READ_Z2(vref) (READ_12BIT_DFR(z2, 1, vref)) 161 152 162 - #define READ_X (READ_12BIT_DFR(x) | ADS_PD10_ADC_ON) 163 - #define PWRDOWN (READ_12BIT_DFR(y) | ADS_PD10_PDOWN) /* LAST */ 153 + #define READ_X(vref) (READ_12BIT_DFR(x, 1, vref)) 154 + #define PWRDOWN (READ_12BIT_DFR(y, 0, 0)) /* LAST */ 164 155 165 156 /* single-ended samples need to first power up reference voltage; 166 157 * we leave both ADC and VREF powered ··· 169 158 #define READ_12BIT_SER(x) (ADS_START | ADS_A2A1A0_ ## x \ 170 159 | ADS_12_BIT | ADS_SER) 171 160 172 - #define REF_ON (READ_12BIT_DFR(x) | ADS_PD10_ALL_ON) 173 - #define REF_OFF (READ_12BIT_DFR(y) | ADS_PD10_PDOWN) 161 + #define REF_ON (READ_12BIT_DFR(x, 1, 1)) 162 + #define REF_OFF (READ_12BIT_DFR(y, 0, 0)) 174 163 175 164 /*--------------------------------------------------------------------------*/ 176 165 177 166 /* 178 167 * Non-touchscreen sensors only use single-ended conversions. 168 + * The range is GND..vREF. The ads7843 and ads7835 must use external vREF; 169 + * ads7846 lets that pin be unconnected, to use internal vREF. 179 170 */ 171 + static unsigned vREF_mV; 172 + module_param(vREF_mV, uint, 0); 173 + MODULE_PARM_DESC(vREF_mV, "external vREF voltage, in milliVolts"); 180 174 181 175 struct ser_req { 182 176 u8 ref_on; ··· 209 193 struct ser_req *req = kzalloc(sizeof *req, GFP_KERNEL); 210 194 int status; 211 195 int sample; 212 - int i; 196 + int use_internal; 213 197 214 198 if (!req) 215 199 return -ENOMEM; 216 200 217 201 spi_message_init(&req->msg); 218 202 219 - /* activate reference, so it has time to settle; */ 220 - req->ref_on = REF_ON; 221 - req->xfer[0].tx_buf = &req->ref_on; 222 - req->xfer[0].len = 1; 223 - req->xfer[1].rx_buf = &req->scratch; 224 - req->xfer[1].len = 2; 203 + /* FIXME boards with ads7846 might use external vref instead ... */ 204 + use_internal = (ts->model == 7846); 225 205 226 - /* 227 - * for external VREF, 0 usec (and assume it's always on); 228 - * for 1uF, use 800 usec; 229 - * no cap, 100 usec. 230 - */ 231 - req->xfer[1].delay_usecs = ts->vref_delay_usecs; 206 + /* maybe turn on internal vREF, and let it settle */ 207 + if (use_internal) { 208 + req->ref_on = REF_ON; 209 + req->xfer[0].tx_buf = &req->ref_on; 210 + req->xfer[0].len = 1; 211 + spi_message_add_tail(&req->xfer[0], &req->msg); 212 + 213 + req->xfer[1].rx_buf = &req->scratch; 214 + req->xfer[1].len = 2; 215 + 216 + /* for 1uF, settle for 800 usec; no cap, 100 usec. */ 217 + req->xfer[1].delay_usecs = ts->vref_delay_usecs; 218 + spi_message_add_tail(&req->xfer[1], &req->msg); 219 + } 232 220 233 221 /* take sample */ 234 222 req->command = (u8) command; 235 223 req->xfer[2].tx_buf = &req->command; 236 224 req->xfer[2].len = 1; 225 + spi_message_add_tail(&req->xfer[2], &req->msg); 226 + 237 227 req->xfer[3].rx_buf = &req->sample; 238 228 req->xfer[3].len = 2; 229 + spi_message_add_tail(&req->xfer[3], &req->msg); 239 230 240 231 /* REVISIT: take a few more samples, and compare ... */ 241 232 242 - /* turn off reference */ 243 - req->ref_off = REF_OFF; 244 - req->xfer[4].tx_buf = &req->ref_off; 245 - req->xfer[4].len = 1; 246 - req->xfer[5].rx_buf = &req->scratch; 247 - req->xfer[5].len = 2; 233 + /* maybe off internal vREF */ 234 + if (use_internal) { 235 + req->ref_off = REF_OFF; 236 + req->xfer[4].tx_buf = &req->ref_off; 237 + req->xfer[4].len = 1; 238 + spi_message_add_tail(&req->xfer[4], &req->msg); 248 239 249 - CS_CHANGE(req->xfer[5]); 250 - 251 - /* group all the transfers together, so we can't interfere with 252 - * reading touchscreen state; disable penirq while sampling 253 - */ 254 - for (i = 0; i < 6; i++) 255 - spi_message_add_tail(&req->xfer[i], &req->msg); 240 + req->xfer[5].rx_buf = &req->scratch; 241 + req->xfer[5].len = 2; 242 + CS_CHANGE(req->xfer[5]); 243 + spi_message_add_tail(&req->xfer[5], &req->msg); 244 + } 256 245 257 246 ts->irq_disabled = 1; 258 247 disable_irq(spi->irq); ··· 277 256 return status ? status : sample; 278 257 } 279 258 280 - #define SHOW(name) static ssize_t \ 259 + #if defined(CONFIG_HWMON) || defined(CONFIG_HWMON_MODULE) 260 + 261 + #define SHOW(name, var, adjust) static ssize_t \ 281 262 name ## _show(struct device *dev, struct device_attribute *attr, char *buf) \ 282 263 { \ 264 + struct ads7846 *ts = dev_get_drvdata(dev); \ 283 265 ssize_t v = ads7846_read12_ser(dev, \ 284 - READ_12BIT_SER(name) | ADS_PD10_ALL_ON); \ 266 + READ_12BIT_SER(var) | ADS_PD10_ALL_ON); \ 285 267 if (v < 0) \ 286 268 return v; \ 287 - return sprintf(buf, "%u\n", (unsigned) v); \ 269 + return sprintf(buf, "%u\n", adjust(ts, v)); \ 288 270 } \ 289 271 static DEVICE_ATTR(name, S_IRUGO, name ## _show, NULL); 290 272 291 - SHOW(temp0) 292 - SHOW(temp1) 293 - SHOW(vaux) 294 - SHOW(vbatt) 273 + 274 + /* Sysfs conventions report temperatures in millidegrees Celcius. 275 + * ADS7846 could use the low-accuracy two-sample scheme, but can't do the high 276 + * accuracy scheme without calibration data. For now we won't try either; 277 + * userspace sees raw sensor values, and must scale/calibrate appropriately. 278 + */ 279 + static inline unsigned null_adjust(struct ads7846 *ts, ssize_t v) 280 + { 281 + return v; 282 + } 283 + 284 + SHOW(temp0, temp0, null_adjust) /* temp1_input */ 285 + SHOW(temp1, temp1, null_adjust) /* temp2_input */ 286 + 287 + 288 + /* sysfs conventions report voltages in millivolts. We can convert voltages 289 + * if we know vREF. userspace may need to scale vAUX to match the board's 290 + * external resistors; we assume that vBATT only uses the internal ones. 291 + */ 292 + static inline unsigned vaux_adjust(struct ads7846 *ts, ssize_t v) 293 + { 294 + unsigned retval = v; 295 + 296 + /* external resistors may scale vAUX into 0..vREF */ 297 + retval *= vREF_mV; 298 + retval = retval >> 12; 299 + return retval; 300 + } 301 + 302 + static inline unsigned vbatt_adjust(struct ads7846 *ts, ssize_t v) 303 + { 304 + unsigned retval = vaux_adjust(ts, v); 305 + 306 + /* ads7846 has a resistor ladder to scale this signal down */ 307 + if (ts->model == 7846) 308 + retval *= 4; 309 + return retval; 310 + } 311 + 312 + SHOW(in0_input, vaux, vaux_adjust) 313 + SHOW(in1_input, vbatt, vbatt_adjust) 314 + 315 + 316 + static struct attribute *ads7846_attributes[] = { 317 + &dev_attr_temp0.attr, 318 + &dev_attr_temp1.attr, 319 + &dev_attr_in0_input.attr, 320 + &dev_attr_in1_input.attr, 321 + NULL, 322 + }; 323 + 324 + static struct attribute_group ads7846_attr_group = { 325 + .attrs = ads7846_attributes, 326 + }; 327 + 328 + static struct attribute *ads7843_attributes[] = { 329 + &dev_attr_in0_input.attr, 330 + &dev_attr_in1_input.attr, 331 + NULL, 332 + }; 333 + 334 + static struct attribute_group ads7843_attr_group = { 335 + .attrs = ads7843_attributes, 336 + }; 337 + 338 + static struct attribute *ads7845_attributes[] = { 339 + &dev_attr_in0_input.attr, 340 + NULL, 341 + }; 342 + 343 + static struct attribute_group ads7845_attr_group = { 344 + .attrs = ads7845_attributes, 345 + }; 346 + 347 + static int ads784x_hwmon_register(struct spi_device *spi, struct ads7846 *ts) 348 + { 349 + struct class_device *hwmon; 350 + int err; 351 + 352 + /* hwmon sensors need a reference voltage */ 353 + switch (ts->model) { 354 + case 7846: 355 + if (!vREF_mV) { 356 + dev_dbg(&spi->dev, "assuming 2.5V internal vREF\n"); 357 + vREF_mV = 2500; 358 + } 359 + break; 360 + case 7845: 361 + case 7843: 362 + if (!vREF_mV) { 363 + dev_warn(&spi->dev, 364 + "external vREF for ADS%d not specified\n", 365 + ts->model); 366 + return 0; 367 + } 368 + break; 369 + } 370 + 371 + /* different chips have different sensor groups */ 372 + switch (ts->model) { 373 + case 7846: 374 + ts->attr_group = &ads7846_attr_group; 375 + break; 376 + case 7845: 377 + ts->attr_group = &ads7845_attr_group; 378 + break; 379 + case 7843: 380 + ts->attr_group = &ads7843_attr_group; 381 + break; 382 + default: 383 + dev_dbg(&spi->dev, "ADS%d not recognized\n", ts->model); 384 + return 0; 385 + } 386 + 387 + err = sysfs_create_group(&spi->dev.kobj, ts->attr_group); 388 + if (err) 389 + return err; 390 + 391 + hwmon = hwmon_device_register(&spi->dev); 392 + if (IS_ERR(hwmon)) { 393 + sysfs_remove_group(&spi->dev.kobj, ts->attr_group); 394 + return PTR_ERR(hwmon); 395 + } 396 + 397 + ts->hwmon = hwmon; 398 + return 0; 399 + } 400 + 401 + static void ads784x_hwmon_unregister(struct spi_device *spi, 402 + struct ads7846 *ts) 403 + { 404 + if (ts->hwmon) { 405 + sysfs_remove_group(&spi->dev.kobj, ts->attr_group); 406 + hwmon_device_unregister(ts->hwmon); 407 + } 408 + } 409 + 410 + #else 411 + static inline int ads784x_hwmon_register(struct spi_device *spi, 412 + struct ads7846 *ts) 413 + { 414 + return 0; 415 + } 416 + 417 + static inline void ads784x_hwmon_unregister(struct spi_device *spi, 418 + struct ads7846 *ts) 419 + { 420 + } 421 + #endif 295 422 296 423 static int is_pen_down(struct device *dev) 297 424 { 298 - struct ads7846 *ts = dev_get_drvdata(dev); 425 + struct ads7846 *ts = dev_get_drvdata(dev); 299 426 300 427 return ts->pendown; 301 428 } ··· 487 318 488 319 static DEVICE_ATTR(disable, 0664, ads7846_disable_show, ads7846_disable_store); 489 320 490 - static struct attribute *ads7846_attributes[] = { 491 - &dev_attr_temp0.attr, 492 - &dev_attr_temp1.attr, 493 - &dev_attr_vbatt.attr, 494 - &dev_attr_vaux.attr, 321 + static struct attribute *ads784x_attributes[] = { 495 322 &dev_attr_pen_down.attr, 496 323 &dev_attr_disable.attr, 497 324 NULL, 498 325 }; 499 326 500 - static struct attribute_group ads7846_attr_group = { 501 - .attrs = ads7846_attributes, 502 - }; 503 - 504 - /* 505 - * ads7843/7845 don't have temperature sensors, and 506 - * use the other sensors a bit differently too 507 - */ 508 - 509 - static struct attribute *ads7843_attributes[] = { 510 - &dev_attr_vbatt.attr, 511 - &dev_attr_vaux.attr, 512 - &dev_attr_pen_down.attr, 513 - &dev_attr_disable.attr, 514 - NULL, 515 - }; 516 - 517 - static struct attribute_group ads7843_attr_group = { 518 - .attrs = ads7843_attributes, 519 - }; 520 - 521 - static struct attribute *ads7845_attributes[] = { 522 - &dev_attr_vaux.attr, 523 - &dev_attr_pen_down.attr, 524 - &dev_attr_disable.attr, 525 - NULL, 526 - }; 527 - 528 - static struct attribute_group ads7845_attr_group = { 529 - .attrs = ads7845_attributes, 327 + static struct attribute_group ads784x_attr_group = { 328 + .attrs = ads784x_attributes, 530 329 }; 531 330 532 331 /*--------------------------------------------------------------------------*/ ··· 510 373 static void ads7846_rx(void *ads) 511 374 { 512 375 struct ads7846 *ts = ads; 513 - struct input_dev *input_dev = ts->input; 514 376 unsigned Rt; 515 - unsigned sync = 0; 516 377 u16 x, y, z1, z2; 517 - unsigned long flags; 518 378 519 - /* adjust: on-wire is a must-ignore bit, a BE12 value, then padding; 520 - * built from two 8 bit values written msb-first. 379 + /* ads7846_rx_val() did in-place conversion (including byteswap) from 380 + * on-the-wire format as part of debouncing to get stable readings. 521 381 */ 522 - x = (be16_to_cpu(ts->tc.x) >> 3) & 0x0fff; 523 - y = (be16_to_cpu(ts->tc.y) >> 3) & 0x0fff; 524 - z1 = (be16_to_cpu(ts->tc.z1) >> 3) & 0x0fff; 525 - z2 = (be16_to_cpu(ts->tc.z2) >> 3) & 0x0fff; 382 + x = ts->tc.x; 383 + y = ts->tc.y; 384 + z1 = ts->tc.z1; 385 + z2 = ts->tc.z2; 526 386 527 387 /* range filtering */ 528 388 if (x == MAX_12BIT) 529 389 x = 0; 530 390 531 - if (likely(x && z1 && !device_suspended(&ts->spi->dev))) { 391 + if (likely(x && z1)) { 532 392 /* compute touch pressure resistance using equation #2 */ 533 393 Rt = z2; 534 394 Rt -= z1; ··· 537 403 Rt = 0; 538 404 539 405 /* Sample found inconsistent by debouncing or pressure is beyond 540 - * the maximum. Don't report it to user space, repeat at least 541 - * once more the measurement */ 406 + * the maximum. Don't report it to user space, repeat at least 407 + * once more the measurement 408 + */ 542 409 if (ts->tc.ignore || Rt > ts->pressure_max) { 543 - mod_timer(&ts->timer, jiffies + TS_POLL_PERIOD); 410 + #ifdef VERBOSE 411 + pr_debug("%s: ignored %d pressure %d\n", 412 + ts->spi->dev.bus_id, ts->tc.ignore, Rt); 413 + #endif 414 + hrtimer_start(&ts->timer, ktime_set(0, TS_POLL_PERIOD), 415 + HRTIMER_REL); 544 416 return; 545 417 } 546 418 547 - /* NOTE: "pendown" is inferred from pressure; we don't rely on 548 - * being able to check nPENIRQ status, or "friendly" trigger modes 549 - * (both-edges is much better than just-falling or low-level). 419 + /* NOTE: We can't rely on the pressure to determine the pen down 420 + * state, even this controller has a pressure sensor. The pressure 421 + * value can fluctuate for quite a while after lifting the pen and 422 + * in some cases may not even settle at the expected value. 550 423 * 551 - * REVISIT: some boards may require reading nPENIRQ; it's 552 - * needed on 7843. and 7845 reads pressure differently... 553 - * 554 - * REVISIT: the touchscreen might not be connected; this code 555 - * won't notice that, even if nPENIRQ never fires ... 424 + * The only safe way to check for the pen up condition is in the 425 + * timer by reading the pen signal state (it's a GPIO _and_ IRQ). 556 426 */ 557 - if (!ts->pendown && Rt != 0) { 558 - input_report_key(input_dev, BTN_TOUCH, 1); 559 - sync = 1; 560 - } else if (ts->pendown && Rt == 0) { 561 - input_report_key(input_dev, BTN_TOUCH, 0); 562 - sync = 1; 563 - } 564 - 565 427 if (Rt) { 566 - input_report_abs(input_dev, ABS_X, x); 567 - input_report_abs(input_dev, ABS_Y, y); 568 - sync = 1; 569 - } 428 + struct input_dev *input = ts->input; 570 429 571 - if (sync) { 572 - input_report_abs(input_dev, ABS_PRESSURE, Rt); 573 - input_sync(input_dev); 574 - } 575 - 576 - #ifdef VERBOSE 577 - if (Rt || ts->pendown) 578 - pr_debug("%s: %d/%d/%d%s\n", ts->spi->dev.bus_id, 579 - x, y, Rt, Rt ? "" : " UP"); 430 + if (!ts->pendown) { 431 + input_report_key(input, BTN_TOUCH, 1); 432 + ts->pendown = 1; 433 + #ifdef VERBOSE 434 + dev_dbg(&ts->spi->dev, "DOWN\n"); 580 435 #endif 436 + } 437 + input_report_abs(input, ABS_X, x); 438 + input_report_abs(input, ABS_Y, y); 439 + input_report_abs(input, ABS_PRESSURE, Rt); 581 440 582 - spin_lock_irqsave(&ts->lock, flags); 441 + input_sync(input); 442 + #ifdef VERBOSE 443 + dev_dbg(&ts->spi->dev, "%4d/%4d/%4d\n", x, y, Rt); 444 + #endif 445 + } 583 446 584 - ts->pendown = (Rt != 0); 585 - mod_timer(&ts->timer, jiffies + TS_POLL_PERIOD); 586 - 587 - spin_unlock_irqrestore(&ts->lock, flags); 447 + hrtimer_start(&ts->timer, ktime_set(0, TS_POLL_PERIOD), HRTIMER_REL); 588 448 } 589 449 590 - static void ads7846_debounce(void *ads) 450 + static int ads7846_debounce(void *ads, int data_idx, int *val) 591 451 { 592 452 struct ads7846 *ts = ads; 593 - struct spi_message *m; 594 - struct spi_transfer *t; 595 - int val; 596 - int status; 597 453 598 - m = &ts->msg[ts->msg_idx]; 599 - t = list_entry(m->transfers.prev, struct spi_transfer, transfer_list); 600 - val = (be16_to_cpu(*(__be16 *)t->rx_buf) >> 3) & 0x0fff; 601 - if (!ts->read_cnt || (abs(ts->last_read - val) > ts->debounce_tol)) { 454 + if (!ts->read_cnt || (abs(ts->last_read - *val) > ts->debounce_tol)) { 455 + /* Start over collecting consistent readings. */ 456 + ts->read_rep = 0; 602 457 /* Repeat it, if this was the first read or the read 603 458 * wasn't consistent enough. */ 604 459 if (ts->read_cnt < ts->debounce_max) { 605 - ts->last_read = val; 460 + ts->last_read = *val; 606 461 ts->read_cnt++; 462 + return ADS7846_FILTER_REPEAT; 607 463 } else { 608 464 /* Maximum number of debouncing reached and still 609 465 * not enough number of consistent readings. Abort 610 466 * the whole sample, repeat it in the next sampling 611 467 * period. 612 468 */ 613 - ts->tc.ignore = 1; 614 469 ts->read_cnt = 0; 615 - /* Last message will contain ads7846_rx() as the 616 - * completion function. 617 - */ 618 - m = ts->last_msg; 470 + return ADS7846_FILTER_IGNORE; 619 471 } 620 - /* Start over collecting consistent readings. */ 621 - ts->read_rep = 0; 622 472 } else { 623 473 if (++ts->read_rep > ts->debounce_rep) { 624 474 /* Got a good reading for this coordinate, 625 475 * go for the next one. */ 626 - ts->tc.ignore = 0; 627 - ts->msg_idx++; 628 476 ts->read_cnt = 0; 629 477 ts->read_rep = 0; 630 - m++; 631 - } else 478 + return ADS7846_FILTER_OK; 479 + } else { 632 480 /* Read more values that are consistent. */ 633 481 ts->read_cnt++; 482 + return ADS7846_FILTER_REPEAT; 483 + } 484 + } 485 + } 486 + 487 + static int ads7846_no_filter(void *ads, int data_idx, int *val) 488 + { 489 + return ADS7846_FILTER_OK; 490 + } 491 + 492 + static void ads7846_rx_val(void *ads) 493 + { 494 + struct ads7846 *ts = ads; 495 + struct spi_message *m; 496 + struct spi_transfer *t; 497 + u16 *rx_val; 498 + int val; 499 + int action; 500 + int status; 501 + 502 + m = &ts->msg[ts->msg_idx]; 503 + t = list_entry(m->transfers.prev, struct spi_transfer, transfer_list); 504 + rx_val = t->rx_buf; 505 + 506 + /* adjust: on-wire is a must-ignore bit, a BE12 value, then padding; 507 + * built from two 8 bit values written msb-first. 508 + */ 509 + val = be16_to_cpu(*rx_val) >> 3; 510 + 511 + action = ts->filter(ts->filter_data, ts->msg_idx, &val); 512 + switch (action) { 513 + case ADS7846_FILTER_REPEAT: 514 + break; 515 + case ADS7846_FILTER_IGNORE: 516 + ts->tc.ignore = 1; 517 + /* Last message will contain ads7846_rx() as the 518 + * completion function. 519 + */ 520 + m = ts->last_msg; 521 + break; 522 + case ADS7846_FILTER_OK: 523 + *rx_val = val; 524 + ts->tc.ignore = 0; 525 + m = &ts->msg[++ts->msg_idx]; 526 + break; 527 + default: 528 + BUG(); 634 529 } 635 530 status = spi_async(ts->spi, m); 636 531 if (status) ··· 667 504 status); 668 505 } 669 506 670 - static void ads7846_timer(unsigned long handle) 507 + static int ads7846_timer(struct hrtimer *handle) 671 508 { 672 - struct ads7846 *ts = (void *)handle; 509 + struct ads7846 *ts = container_of(handle, struct ads7846, timer); 673 510 int status = 0; 674 511 675 512 spin_lock_irq(&ts->lock); 676 513 677 - if (unlikely(ts->msg_idx && !ts->pendown)) { 514 + if (unlikely(!ts->get_pendown_state() || 515 + device_suspended(&ts->spi->dev))) { 516 + if (ts->pendown) { 517 + struct input_dev *input = ts->input; 518 + 519 + input_report_key(input, BTN_TOUCH, 0); 520 + input_report_abs(input, ABS_PRESSURE, 0); 521 + input_sync(input); 522 + 523 + ts->pendown = 0; 524 + #ifdef VERBOSE 525 + dev_dbg(&ts->spi->dev, "UP\n"); 526 + #endif 527 + } 528 + 678 529 /* measurement cycle ended */ 679 530 if (!device_suspended(&ts->spi->dev)) { 680 531 ts->irq_disabled = 0; 681 532 enable_irq(ts->spi->irq); 682 533 } 683 534 ts->pending = 0; 684 - ts->msg_idx = 0; 685 535 } else { 686 536 /* pen is still down, continue with the measurement */ 687 537 ts->msg_idx = 0; ··· 704 528 } 705 529 706 530 spin_unlock_irq(&ts->lock); 531 + return HRTIMER_NORESTART; 707 532 } 708 533 709 534 static irqreturn_t ads7846_irq(int irq, void *handle) ··· 723 546 ts->irq_disabled = 1; 724 547 disable_irq(ts->spi->irq); 725 548 ts->pending = 1; 726 - mod_timer(&ts->timer, jiffies); 549 + hrtimer_start(&ts->timer, ktime_set(0, TS_POLL_DELAY), 550 + HRTIMER_REL); 727 551 } 728 552 } 729 553 spin_unlock_irqrestore(&ts->lock, flags); ··· 810 632 struct ads7846_platform_data *pdata = spi->dev.platform_data; 811 633 struct spi_message *m; 812 634 struct spi_transfer *x; 635 + int vref; 813 636 int err; 814 637 815 638 if (!spi->irq) { ··· 844 665 * may not. So we stick to very-portable 8 bit words, both RX and TX. 845 666 */ 846 667 spi->bits_per_word = 8; 668 + spi->mode = SPI_MODE_1; 669 + err = spi_setup(spi); 670 + if (err < 0) 671 + return err; 847 672 848 673 ts = kzalloc(sizeof(struct ads7846), GFP_KERNEL); 849 674 input_dev = input_allocate_device(); ··· 862 679 ts->spi = spi; 863 680 ts->input = input_dev; 864 681 865 - init_timer(&ts->timer); 866 - ts->timer.data = (unsigned long) ts; 682 + hrtimer_init(&ts->timer, CLOCK_MONOTONIC, HRTIMER_REL); 867 683 ts->timer.function = ads7846_timer; 868 684 869 685 spin_lock_init(&ts->lock); ··· 871 689 ts->vref_delay_usecs = pdata->vref_delay_usecs ? : 100; 872 690 ts->x_plate_ohms = pdata->x_plate_ohms ? : 400; 873 691 ts->pressure_max = pdata->pressure_max ? : ~0; 874 - if (pdata->debounce_max) { 692 + 693 + if (pdata->filter != NULL) { 694 + if (pdata->filter_init != NULL) { 695 + err = pdata->filter_init(pdata, &ts->filter_data); 696 + if (err < 0) 697 + goto err_free_mem; 698 + } 699 + ts->filter = pdata->filter; 700 + ts->filter_cleanup = pdata->filter_cleanup; 701 + } else if (pdata->debounce_max) { 875 702 ts->debounce_max = pdata->debounce_max; 703 + if (ts->debounce_max < 2) 704 + ts->debounce_max = 2; 876 705 ts->debounce_tol = pdata->debounce_tol; 877 706 ts->debounce_rep = pdata->debounce_rep; 878 - if (ts->debounce_rep > ts->debounce_max + 1) 879 - ts->debounce_rep = ts->debounce_max - 1; 707 + ts->filter = ads7846_debounce; 708 + ts->filter_data = ts; 880 709 } else 881 - ts->debounce_tol = ~0; 710 + ts->filter = ads7846_no_filter; 882 711 ts->get_pendown_state = pdata->get_pendown_state; 883 712 884 713 snprintf(ts->phys, sizeof(ts->phys), "%s/input0", spi->dev.bus_id); ··· 911 718 input_set_abs_params(input_dev, ABS_PRESSURE, 912 719 pdata->pressure_min, pdata->pressure_max, 0, 0); 913 720 721 + vref = pdata->keep_vref_on; 722 + 914 723 /* set up the transfers to read touchscreen state; this assumes we 915 724 * use formula #2 for pressure, not #3. 916 725 */ ··· 922 727 spi_message_init(m); 923 728 924 729 /* y- still on; turn on only y+ (and ADC) */ 925 - ts->read_y = READ_Y; 730 + ts->read_y = READ_Y(vref); 926 731 x->tx_buf = &ts->read_y; 927 732 x->len = 1; 928 733 spi_message_add_tail(x, m); ··· 932 737 x->len = 2; 933 738 spi_message_add_tail(x, m); 934 739 935 - m->complete = ads7846_debounce; 740 + m->complete = ads7846_rx_val; 936 741 m->context = ts; 937 742 938 743 m++; ··· 940 745 941 746 /* turn y- off, x+ on, then leave in lowpower */ 942 747 x++; 943 - ts->read_x = READ_X; 748 + ts->read_x = READ_X(vref); 944 749 x->tx_buf = &ts->read_x; 945 750 x->len = 1; 946 751 spi_message_add_tail(x, m); ··· 950 755 x->len = 2; 951 756 spi_message_add_tail(x, m); 952 757 953 - m->complete = ads7846_debounce; 758 + m->complete = ads7846_rx_val; 954 759 m->context = ts; 955 760 956 761 /* turn y+ off, x- on; we'll use formula #2 */ ··· 959 764 spi_message_init(m); 960 765 961 766 x++; 962 - ts->read_z1 = READ_Z1; 767 + ts->read_z1 = READ_Z1(vref); 963 768 x->tx_buf = &ts->read_z1; 964 769 x->len = 1; 965 770 spi_message_add_tail(x, m); ··· 969 774 x->len = 2; 970 775 spi_message_add_tail(x, m); 971 776 972 - m->complete = ads7846_debounce; 777 + m->complete = ads7846_rx_val; 973 778 m->context = ts; 974 779 975 780 m++; 976 781 spi_message_init(m); 977 782 978 783 x++; 979 - ts->read_z2 = READ_Z2; 784 + ts->read_z2 = READ_Z2(vref); 980 785 x->tx_buf = &ts->read_z2; 981 786 x->len = 1; 982 787 spi_message_add_tail(x, m); ··· 986 791 x->len = 2; 987 792 spi_message_add_tail(x, m); 988 793 989 - m->complete = ads7846_debounce; 794 + m->complete = ads7846_rx_val; 990 795 m->context = ts; 991 796 } 992 797 ··· 1015 820 spi->dev.driver->name, ts)) { 1016 821 dev_dbg(&spi->dev, "irq %d busy?\n", spi->irq); 1017 822 err = -EBUSY; 1018 - goto err_free_mem; 823 + goto err_cleanup_filter; 1019 824 } 825 + 826 + err = ads784x_hwmon_register(spi, ts); 827 + if (err) 828 + goto err_free_irq; 1020 829 1021 830 dev_info(&spi->dev, "touchscreen, irq %d\n", spi->irq); 1022 831 1023 - /* take a first sample, leaving nPENIRQ active; avoid 832 + /* take a first sample, leaving nPENIRQ active and vREF off; avoid 1024 833 * the touchscreen, in case it's not connected. 1025 834 */ 1026 835 (void) ads7846_read12_ser(&spi->dev, 1027 836 READ_12BIT_SER(vaux) | ADS_PD10_ALL_ON); 1028 837 1029 - switch (ts->model) { 1030 - case 7846: 1031 - ts->attr_group = &ads7846_attr_group; 1032 - break; 1033 - case 7845: 1034 - ts->attr_group = &ads7845_attr_group; 1035 - break; 1036 - default: 1037 - ts->attr_group = &ads7843_attr_group; 1038 - break; 1039 - } 1040 - err = sysfs_create_group(&spi->dev.kobj, ts->attr_group); 838 + err = sysfs_create_group(&spi->dev.kobj, &ads784x_attr_group); 1041 839 if (err) 1042 - goto err_free_irq; 840 + goto err_remove_hwmon; 1043 841 1044 842 err = input_register_device(input_dev); 1045 843 if (err) ··· 1041 853 return 0; 1042 854 1043 855 err_remove_attr_group: 1044 - sysfs_remove_group(&spi->dev.kobj, ts->attr_group); 856 + sysfs_remove_group(&spi->dev.kobj, &ads784x_attr_group); 857 + err_remove_hwmon: 858 + ads784x_hwmon_unregister(spi, ts); 1045 859 err_free_irq: 1046 860 free_irq(spi->irq, ts); 861 + err_cleanup_filter: 862 + if (ts->filter_cleanup) 863 + ts->filter_cleanup(ts->filter_data); 1047 864 err_free_mem: 1048 865 input_free_device(input_dev); 1049 866 kfree(ts); ··· 1059 866 { 1060 867 struct ads7846 *ts = dev_get_drvdata(&spi->dev); 1061 868 869 + ads784x_hwmon_unregister(spi, ts); 1062 870 input_unregister_device(ts->input); 1063 871 1064 872 ads7846_suspend(spi, PMSG_SUSPEND); 1065 873 1066 - sysfs_remove_group(&spi->dev.kobj, ts->attr_group); 874 + sysfs_remove_group(&spi->dev.kobj, &ads784x_attr_group); 1067 875 1068 876 free_irq(ts->spi->irq, ts); 1069 877 /* suspend left the IRQ disabled */ 1070 878 enable_irq(ts->spi->irq); 879 + 880 + if (ts->filter_cleanup) 881 + ts->filter_cleanup(ts->filter_data); 1071 882 1072 883 kfree(ts); 1073 884
+4
drivers/input/tsdev.c
··· 151 151 int i = iminor(inode) - TSDEV_MINOR_BASE; 152 152 struct tsdev_list *list; 153 153 154 + printk(KERN_WARNING "tsdev (compaq touchscreen emulation) is scheduled " 155 + "for removal.\nSee Documentation/feature-removal-schedule.txt " 156 + "for details.\n"); 157 + 154 158 if (i >= TSDEV_MINORS || !tsdev_table[i & TSDEV_MINOR_MASK]) 155 159 return -ENODEV; 156 160
+1
drivers/usb/input/hid-ff.c
··· 57 57 { 0x46d, 0xc283, hid_lgff_init }, /* Logitech Wingman Force 3d */ 58 58 { 0x46d, 0xc295, hid_lgff_init }, /* Logitech MOMO force wheel */ 59 59 { 0x46d, 0xc219, hid_lgff_init }, /* Logitech Cordless rumble pad 2 */ 60 + { 0x46d, 0xca03, hid_lgff_init }, /* Logitech MOMO force wheel */ 60 61 #endif 61 62 #ifdef CONFIG_PANTHERLORD_FF 62 63 { 0x810, 0x0001, hid_plff_init },
+1
drivers/usb/input/hid-lgff.c
··· 52 52 { 0x046d, 0xc211, ff_rumble }, 53 53 { 0x046d, 0xc219, ff_rumble }, 54 54 { 0x046d, 0xc283, ff_joystick }, 55 + { 0x046d, 0xca03, ff_joystick }, 55 56 { 0x0000, 0x0000, ff_joystick } 56 57 }; 57 58
+17
include/asm-arm/hardware/gpio_keys.h
··· 1 + #ifndef _GPIO_KEYS_H 2 + #define _GPIO_KEYS_H 3 + 4 + struct gpio_keys_button { 5 + /* Configuration parameters */ 6 + int keycode; 7 + int gpio; 8 + int active_low; 9 + char *desc; 10 + }; 11 + 12 + struct gpio_keys_platform_data { 13 + struct gpio_keys_button *buttons; 14 + int nbuttons; 15 + }; 16 + 17 + #endif
+12
include/linux/spi/ads7846.h
··· 5 5 * 6 6 * It's OK if the min/max values are zero. 7 7 */ 8 + enum ads7846_filter { 9 + ADS7846_FILTER_OK, 10 + ADS7846_FILTER_REPEAT, 11 + ADS7846_FILTER_IGNORE, 12 + }; 13 + 8 14 struct ads7846_platform_data { 9 15 u16 model; /* 7843, 7845, 7846. */ 10 16 u16 vref_delay_usecs; /* 0 for external vref; etc */ 17 + int keep_vref_on:1; /* set to keep vref on for differential 18 + * measurements as well */ 11 19 u16 x_plate_ohms; 12 20 u16 y_plate_ohms; 13 21 ··· 29 21 u16 debounce_rep; /* additional consecutive good readings 30 22 * required after the first two */ 31 23 int (*get_pendown_state)(void); 24 + int (*filter_init) (struct ads7846_platform_data *pdata, 25 + void **filter_data); 26 + int (*filter) (void *filter_data, int data_idx, int *val); 27 + void (*filter_cleanup)(void *filter_data); 32 28 }; 33 29