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: add SW_ROTATE_LOCK switch type
Input: fix force feedback capability query example
Input: wacom_w8001 - add single-touch support
Input: add Austria Microsystem AS5011 joystick driver
Input: remove aaed2000 keyboard driver
Input: i8042 - introduce 'notimeout' blacklist for Dell Vostro V13
Input: cy8ctmg110_ts - Convert to dev_pm_ops
Input: migor_ts - convert to dev_pm_ops
Input: mcs5000_ts - convert to dev_pm_ops
Input: eeti_ts - convert to dev_pm_ops
Input: ad7879 - convert I2C to dev_pm_ops

+624 -265
+3 -1
Documentation/input/ff.txt
··· 49 49 #include <linux/input.h> 50 50 #include <sys/ioctl.h> 51 51 52 - unsigned long features[1 + FF_MAX/sizeof(unsigned long)]; 52 + #define BITS_TO_LONGS(x) \ 53 + (((x) + 8 * sizeof (unsigned long) - 1) / (8 * sizeof (unsigned long))) 54 + unsigned long features[BITS_TO_LONGS(FF_CNT)]; 53 55 int ioctl(int file_descriptor, int request, unsigned long *features); 54 56 55 57 "request" must be EVIOCGBIT(EV_FF, size of features array in bytes )
+1
Documentation/kernel-parameters.txt
··· 888 888 controller 889 889 i8042.nopnp [HW] Don't use ACPIPnP / PnPBIOS to discover KBD/AUX 890 890 controllers 891 + i8042.notimeout [HW] Ignore timeout condition signalled by conroller 891 892 i8042.reset [HW] Reset the controller during init and cleanup 892 893 i8042.unlock [HW] Unlock (ignore) the keylock 893 894
+10
drivers/input/joystick/Kconfig
··· 255 255 To compile this driver as a module, choose M here: the 256 256 module will be called amijoy. 257 257 258 + config JOYSTICK_AS5011 259 + tristate "Austria Microsystem AS5011 joystick" 260 + depends on I2C 261 + help 262 + Say Y here if you have an AS5011 digital joystick connected to your 263 + system. 264 + 265 + To compile this driver as a module, choose M here: the 266 + module will be called as5011. 267 + 258 268 config JOYSTICK_JOYDUMP 259 269 tristate "Gameport data dumper" 260 270 select GAMEPORT
+1
drivers/input/joystick/Makefile
··· 7 7 obj-$(CONFIG_JOYSTICK_A3D) += a3d.o 8 8 obj-$(CONFIG_JOYSTICK_ADI) += adi.o 9 9 obj-$(CONFIG_JOYSTICK_AMIGA) += amijoy.o 10 + obj-$(CONFIG_JOYSTICK_AS5011) += as5011.o 10 11 obj-$(CONFIG_JOYSTICK_ANALOG) += analog.o 11 12 obj-$(CONFIG_JOYSTICK_COBRA) += cobra.o 12 13 obj-$(CONFIG_JOYSTICK_DB9) += db9.o
+367
drivers/input/joystick/as5011.c
··· 1 + /* 2 + * Copyright (c) 2010, 2011 Fabien Marteau <fabien.marteau@armadeus.com> 3 + * Sponsored by ARMadeus Systems 4 + * 5 + * This program is free software; you can redistribute it and/or modify 6 + * it under the terms of the GNU General Public License as published by 7 + * the Free Software Foundation; either version 2 of the License, or 8 + * (at your option) any later version. 9 + * 10 + * This program is distributed in the hope that it will be useful, 11 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 + * GNU General Public License for more details. 14 + * 15 + * You should have received a copy of the GNU General Public License 16 + * along with this program; if not, write to the Free Software 17 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 + * 19 + * Driver for Austria Microsystems joysticks AS5011 20 + * 21 + * TODO: 22 + * - Power on the chip when open() and power down when close() 23 + * - Manage power mode 24 + */ 25 + 26 + #include <linux/i2c.h> 27 + #include <linux/interrupt.h> 28 + #include <linux/input.h> 29 + #include <linux/gpio.h> 30 + #include <linux/delay.h> 31 + #include <linux/input/as5011.h> 32 + #include <linux/slab.h> 33 + 34 + #define DRIVER_DESC "Driver for Austria Microsystems AS5011 joystick" 35 + #define MODULE_DEVICE_ALIAS "as5011" 36 + 37 + MODULE_AUTHOR("Fabien Marteau <fabien.marteau@armadeus.com>"); 38 + MODULE_DESCRIPTION(DRIVER_DESC); 39 + MODULE_LICENSE("GPL"); 40 + 41 + /* registers */ 42 + #define AS5011_CTRL1 0x76 43 + #define AS5011_CTRL2 0x75 44 + #define AS5011_XP 0x43 45 + #define AS5011_XN 0x44 46 + #define AS5011_YP 0x53 47 + #define AS5011_YN 0x54 48 + #define AS5011_X_REG 0x41 49 + #define AS5011_Y_REG 0x42 50 + #define AS5011_X_RES_INT 0x51 51 + #define AS5011_Y_RES_INT 0x52 52 + 53 + /* CTRL1 bits */ 54 + #define AS5011_CTRL1_LP_PULSED 0x80 55 + #define AS5011_CTRL1_LP_ACTIVE 0x40 56 + #define AS5011_CTRL1_LP_CONTINUE 0x20 57 + #define AS5011_CTRL1_INT_WUP_EN 0x10 58 + #define AS5011_CTRL1_INT_ACT_EN 0x08 59 + #define AS5011_CTRL1_EXT_CLK_EN 0x04 60 + #define AS5011_CTRL1_SOFT_RST 0x02 61 + #define AS5011_CTRL1_DATA_VALID 0x01 62 + 63 + /* CTRL2 bits */ 64 + #define AS5011_CTRL2_EXT_SAMPLE_EN 0x08 65 + #define AS5011_CTRL2_RC_BIAS_ON 0x04 66 + #define AS5011_CTRL2_INV_SPINNING 0x02 67 + 68 + #define AS5011_MAX_AXIS 80 69 + #define AS5011_MIN_AXIS (-80) 70 + #define AS5011_FUZZ 8 71 + #define AS5011_FLAT 40 72 + 73 + struct as5011_device { 74 + struct input_dev *input_dev; 75 + struct i2c_client *i2c_client; 76 + unsigned int button_gpio; 77 + unsigned int button_irq; 78 + unsigned int axis_irq; 79 + }; 80 + 81 + static int as5011_i2c_write(struct i2c_client *client, 82 + uint8_t aregaddr, 83 + uint8_t avalue) 84 + { 85 + uint8_t data[2] = { aregaddr, avalue }; 86 + struct i2c_msg msg = { 87 + client->addr, I2C_M_IGNORE_NAK, 2, (uint8_t *)data 88 + }; 89 + int error; 90 + 91 + error = i2c_transfer(client->adapter, &msg, 1); 92 + return error < 0 ? error : 0; 93 + } 94 + 95 + static int as5011_i2c_read(struct i2c_client *client, 96 + uint8_t aregaddr, signed char *value) 97 + { 98 + uint8_t data[2] = { aregaddr }; 99 + struct i2c_msg msg_set[2] = { 100 + { client->addr, I2C_M_REV_DIR_ADDR, 1, (uint8_t *)data }, 101 + { client->addr, I2C_M_RD | I2C_M_NOSTART, 1, (uint8_t *)data } 102 + }; 103 + int error; 104 + 105 + error = i2c_transfer(client->adapter, msg_set, 2); 106 + if (error < 0) 107 + return error; 108 + 109 + *value = data[0] & 0x80 ? -1 * (1 + ~data[0]) : data[0]; 110 + return 0; 111 + } 112 + 113 + static irqreturn_t as5011_button_interrupt(int irq, void *dev_id) 114 + { 115 + struct as5011_device *as5011 = dev_id; 116 + int val = gpio_get_value_cansleep(as5011->button_gpio); 117 + 118 + input_report_key(as5011->input_dev, BTN_JOYSTICK, !val); 119 + input_sync(as5011->input_dev); 120 + 121 + return IRQ_HANDLED; 122 + } 123 + 124 + static irqreturn_t as5011_axis_interrupt(int irq, void *dev_id) 125 + { 126 + struct as5011_device *as5011 = dev_id; 127 + int error; 128 + signed char x, y; 129 + 130 + error = as5011_i2c_read(as5011->i2c_client, AS5011_X_RES_INT, &x); 131 + if (error < 0) 132 + goto out; 133 + 134 + error = as5011_i2c_read(as5011->i2c_client, AS5011_Y_RES_INT, &y); 135 + if (error < 0) 136 + goto out; 137 + 138 + input_report_abs(as5011->input_dev, ABS_X, x); 139 + input_report_abs(as5011->input_dev, ABS_Y, y); 140 + input_sync(as5011->input_dev); 141 + 142 + out: 143 + return IRQ_HANDLED; 144 + } 145 + 146 + static int __devinit as5011_configure_chip(struct as5011_device *as5011, 147 + const struct as5011_platform_data *plat_dat) 148 + { 149 + struct i2c_client *client = as5011->i2c_client; 150 + int error; 151 + signed char value; 152 + 153 + /* chip soft reset */ 154 + error = as5011_i2c_write(client, AS5011_CTRL1, 155 + AS5011_CTRL1_SOFT_RST); 156 + if (error < 0) { 157 + dev_err(&client->dev, "Soft reset failed\n"); 158 + return error; 159 + } 160 + 161 + mdelay(10); 162 + 163 + error = as5011_i2c_write(client, AS5011_CTRL1, 164 + AS5011_CTRL1_LP_PULSED | 165 + AS5011_CTRL1_LP_ACTIVE | 166 + AS5011_CTRL1_INT_ACT_EN); 167 + if (error < 0) { 168 + dev_err(&client->dev, "Power config failed\n"); 169 + return error; 170 + } 171 + 172 + error = as5011_i2c_write(client, AS5011_CTRL2, 173 + AS5011_CTRL2_INV_SPINNING); 174 + if (error < 0) { 175 + dev_err(&client->dev, "Can't invert spinning\n"); 176 + return error; 177 + } 178 + 179 + /* write threshold */ 180 + error = as5011_i2c_write(client, AS5011_XP, plat_dat->xp); 181 + if (error < 0) { 182 + dev_err(&client->dev, "Can't write threshold\n"); 183 + return error; 184 + } 185 + 186 + error = as5011_i2c_write(client, AS5011_XN, plat_dat->xn); 187 + if (error < 0) { 188 + dev_err(&client->dev, "Can't write threshold\n"); 189 + return error; 190 + } 191 + 192 + error = as5011_i2c_write(client, AS5011_YP, plat_dat->yp); 193 + if (error < 0) { 194 + dev_err(&client->dev, "Can't write threshold\n"); 195 + return error; 196 + } 197 + 198 + error = as5011_i2c_write(client, AS5011_YN, plat_dat->yn); 199 + if (error < 0) { 200 + dev_err(&client->dev, "Can't write threshold\n"); 201 + return error; 202 + } 203 + 204 + /* to free irq gpio in chip */ 205 + error = as5011_i2c_read(client, AS5011_X_RES_INT, &value); 206 + if (error < 0) { 207 + dev_err(&client->dev, "Can't read i2c X resolution value\n"); 208 + return error; 209 + } 210 + 211 + return 0; 212 + } 213 + 214 + static int __devinit as5011_probe(struct i2c_client *client, 215 + const struct i2c_device_id *id) 216 + { 217 + const struct as5011_platform_data *plat_data; 218 + struct as5011_device *as5011; 219 + struct input_dev *input_dev; 220 + int irq; 221 + int error; 222 + 223 + plat_data = client->dev.platform_data; 224 + if (!plat_data) 225 + return -EINVAL; 226 + 227 + if (!plat_data->axis_irq) { 228 + dev_err(&client->dev, "No axis IRQ?\n"); 229 + return -EINVAL; 230 + } 231 + 232 + if (!i2c_check_functionality(client->adapter, 233 + I2C_FUNC_PROTOCOL_MANGLING)) { 234 + dev_err(&client->dev, 235 + "need i2c bus that supports protocol mangling\n"); 236 + return -ENODEV; 237 + } 238 + 239 + as5011 = kmalloc(sizeof(struct as5011_device), GFP_KERNEL); 240 + input_dev = input_allocate_device(); 241 + if (!as5011 || !input_dev) { 242 + dev_err(&client->dev, 243 + "Can't allocate memory for device structure\n"); 244 + error = -ENOMEM; 245 + goto err_free_mem; 246 + } 247 + 248 + as5011->i2c_client = client; 249 + as5011->input_dev = input_dev; 250 + as5011->button_gpio = plat_data->button_gpio; 251 + as5011->axis_irq = plat_data->axis_irq; 252 + 253 + input_dev->name = "Austria Microsystem as5011 joystick"; 254 + input_dev->id.bustype = BUS_I2C; 255 + input_dev->dev.parent = &client->dev; 256 + 257 + __set_bit(EV_KEY, input_dev->evbit); 258 + __set_bit(EV_ABS, input_dev->evbit); 259 + __set_bit(BTN_JOYSTICK, input_dev->keybit); 260 + 261 + input_set_abs_params(input_dev, ABS_X, 262 + AS5011_MIN_AXIS, AS5011_MAX_AXIS, AS5011_FUZZ, AS5011_FLAT); 263 + input_set_abs_params(as5011->input_dev, ABS_Y, 264 + AS5011_MIN_AXIS, AS5011_MAX_AXIS, AS5011_FUZZ, AS5011_FLAT); 265 + 266 + error = gpio_request(as5011->button_gpio, "AS5011 button"); 267 + if (error < 0) { 268 + dev_err(&client->dev, "Failed to request button gpio\n"); 269 + goto err_free_mem; 270 + } 271 + 272 + irq = gpio_to_irq(as5011->button_gpio); 273 + if (irq < 0) { 274 + dev_err(&client->dev, 275 + "Failed to get irq number for button gpio\n"); 276 + goto err_free_button_gpio; 277 + } 278 + 279 + as5011->button_irq = irq; 280 + 281 + error = request_threaded_irq(as5011->button_irq, 282 + NULL, as5011_button_interrupt, 283 + IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, 284 + "as5011_button", as5011); 285 + if (error < 0) { 286 + dev_err(&client->dev, 287 + "Can't allocate button irq %d\n", as5011->button_irq); 288 + goto err_free_button_gpio; 289 + } 290 + 291 + error = as5011_configure_chip(as5011, plat_data); 292 + if (error) 293 + goto err_free_button_irq; 294 + 295 + error = request_threaded_irq(as5011->axis_irq, NULL, 296 + as5011_axis_interrupt, 297 + plat_data->axis_irqflags, 298 + "as5011_joystick", as5011); 299 + if (error) { 300 + dev_err(&client->dev, 301 + "Can't allocate axis irq %d\n", plat_data->axis_irq); 302 + goto err_free_button_irq; 303 + } 304 + 305 + error = input_register_device(as5011->input_dev); 306 + if (error) { 307 + dev_err(&client->dev, "Failed to register input device\n"); 308 + goto err_free_axis_irq; 309 + } 310 + 311 + i2c_set_clientdata(client, as5011); 312 + 313 + return 0; 314 + 315 + err_free_axis_irq: 316 + free_irq(as5011->axis_irq, as5011); 317 + err_free_button_irq: 318 + free_irq(as5011->button_irq, as5011); 319 + err_free_button_gpio: 320 + gpio_free(as5011->button_gpio); 321 + err_free_mem: 322 + input_free_device(input_dev); 323 + kfree(as5011); 324 + 325 + return error; 326 + } 327 + 328 + static int __devexit as5011_remove(struct i2c_client *client) 329 + { 330 + struct as5011_device *as5011 = i2c_get_clientdata(client); 331 + 332 + free_irq(as5011->axis_irq, as5011); 333 + free_irq(as5011->button_irq, as5011); 334 + gpio_free(as5011->button_gpio); 335 + 336 + input_unregister_device(as5011->input_dev); 337 + kfree(as5011); 338 + 339 + return 0; 340 + } 341 + 342 + static const struct i2c_device_id as5011_id[] = { 343 + { MODULE_DEVICE_ALIAS, 0 }, 344 + { } 345 + }; 346 + MODULE_DEVICE_TABLE(i2c, as5011_id); 347 + 348 + static struct i2c_driver as5011_driver = { 349 + .driver = { 350 + .name = "as5011", 351 + }, 352 + .probe = as5011_probe, 353 + .remove = __devexit_p(as5011_remove), 354 + .id_table = as5011_id, 355 + }; 356 + 357 + static int __init as5011_init(void) 358 + { 359 + return i2c_add_driver(&as5011_driver); 360 + } 361 + module_init(as5011_init); 362 + 363 + static void __exit as5011_exit(void) 364 + { 365 + i2c_del_driver(&as5011_driver); 366 + } 367 + module_exit(as5011_exit);
-12
drivers/input/keyboard/Kconfig
··· 12 12 13 13 if INPUT_KEYBOARD 14 14 15 - config KEYBOARD_AAED2000 16 - tristate "AAED-2000 keyboard" 17 - depends on MACH_AAED2000 18 - select INPUT_POLLDEV 19 - default y 20 - help 21 - Say Y here to enable the keyboard on the Agilent AAED-2000 22 - development board. 23 - 24 - To compile this driver as a module, choose M here: the 25 - module will be called aaed2000_kbd. 26 - 27 15 config KEYBOARD_ADP5520 28 16 tristate "Keypad Support for ADP5520 PMIC" 29 17 depends on PMIC_ADP5520
-1
drivers/input/keyboard/Makefile
··· 4 4 5 5 # Each configuration option enables a list of files. 6 6 7 - obj-$(CONFIG_KEYBOARD_AAED2000) += aaed2000_kbd.o 8 7 obj-$(CONFIG_KEYBOARD_ADP5520) += adp5520-keys.o 9 8 obj-$(CONFIG_KEYBOARD_ADP5588) += adp5588-keys.o 10 9 obj-$(CONFIG_KEYBOARD_AMIGA) += amikbd.o
-186
drivers/input/keyboard/aaed2000_kbd.c
··· 1 - /* 2 - * Keyboard driver for the AAED-2000 dev board 3 - * 4 - * Copyright (c) 2006 Nicolas Bellido Y Ortega 5 - * 6 - * Based on corgikbd.c 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 version 2 as 10 - * published by the Free Software Foundation. 11 - * 12 - */ 13 - 14 - #include <linux/delay.h> 15 - #include <linux/platform_device.h> 16 - #include <linux/init.h> 17 - #include <linux/input-polldev.h> 18 - #include <linux/interrupt.h> 19 - #include <linux/jiffies.h> 20 - #include <linux/module.h> 21 - #include <linux/slab.h> 22 - 23 - #include <mach/hardware.h> 24 - #include <mach/aaed2000.h> 25 - 26 - #define KB_ROWS 12 27 - #define KB_COLS 8 28 - #define KB_ROWMASK(r) (1 << (r)) 29 - #define SCANCODE(r,c) (((c) * KB_ROWS) + (r)) 30 - #define NR_SCANCODES (KB_COLS * KB_ROWS) 31 - 32 - #define SCAN_INTERVAL (50) /* ms */ 33 - #define KB_ACTIVATE_DELAY (20) /* us */ 34 - 35 - static unsigned char aaedkbd_keycode[NR_SCANCODES] = { 36 - KEY_9, KEY_0, KEY_MINUS, KEY_EQUAL, KEY_BACKSPACE, 0, KEY_SPACE, KEY_KP6, 0, KEY_KPDOT, 0, 0, 37 - KEY_K, KEY_M, KEY_O, KEY_DOT, KEY_SLASH, 0, KEY_F, 0, 0, 0, KEY_LEFTSHIFT, 0, 38 - KEY_I, KEY_P, KEY_LEFTBRACE, KEY_RIGHTBRACE, KEY_BACKSLASH, 0, 0, 0, 0, 0, KEY_RIGHTSHIFT, 0, 39 - KEY_8, KEY_L, KEY_SEMICOLON, KEY_APOSTROPHE, KEY_ENTER, 0, 0, 0, 0, 0, 0, 0, 40 - KEY_J, KEY_H, KEY_B, KEY_KP8, KEY_KP4, 0, KEY_C, KEY_D, KEY_S, KEY_A, 0, KEY_CAPSLOCK, 41 - KEY_Y, KEY_U, KEY_N, KEY_T, 0, 0, KEY_R, KEY_E, KEY_W, KEY_Q, 0, KEY_TAB, 42 - KEY_7, KEY_6, KEY_G, 0, KEY_5, 0, KEY_4, KEY_3, KEY_2, KEY_1, 0, KEY_GRAVE, 43 - 0, 0, KEY_COMMA, 0, KEY_KP2, 0, KEY_V, KEY_LEFTALT, KEY_X, KEY_Z, 0, KEY_LEFTCTRL 44 - }; 45 - 46 - struct aaedkbd { 47 - unsigned char keycode[ARRAY_SIZE(aaedkbd_keycode)]; 48 - struct input_polled_dev *poll_dev; 49 - int kbdscan_state[KB_COLS]; 50 - int kbdscan_count[KB_COLS]; 51 - }; 52 - 53 - #define KBDSCAN_STABLE_COUNT 2 54 - 55 - static void aaedkbd_report_col(struct aaedkbd *aaedkbd, 56 - unsigned int col, unsigned int rowd) 57 - { 58 - unsigned int scancode, pressed; 59 - unsigned int row; 60 - 61 - for (row = 0; row < KB_ROWS; row++) { 62 - scancode = SCANCODE(row, col); 63 - pressed = rowd & KB_ROWMASK(row); 64 - 65 - input_report_key(aaedkbd->poll_dev->input, 66 - aaedkbd->keycode[scancode], pressed); 67 - } 68 - } 69 - 70 - /* Scan the hardware keyboard and push any changes up through the input layer */ 71 - static void aaedkbd_poll(struct input_polled_dev *dev) 72 - { 73 - struct aaedkbd *aaedkbd = dev->private; 74 - unsigned int col, rowd; 75 - 76 - col = 0; 77 - do { 78 - AAEC_GPIO_KSCAN = col + 8; 79 - udelay(KB_ACTIVATE_DELAY); 80 - rowd = AAED_EXT_GPIO & AAED_EGPIO_KBD_SCAN; 81 - 82 - if (rowd != aaedkbd->kbdscan_state[col]) { 83 - aaedkbd->kbdscan_count[col] = 0; 84 - aaedkbd->kbdscan_state[col] = rowd; 85 - } else if (++aaedkbd->kbdscan_count[col] >= KBDSCAN_STABLE_COUNT) { 86 - aaedkbd_report_col(aaedkbd, col, rowd); 87 - col++; 88 - } 89 - } while (col < KB_COLS); 90 - 91 - AAEC_GPIO_KSCAN = 0x07; 92 - input_sync(dev->input); 93 - } 94 - 95 - static int __devinit aaedkbd_probe(struct platform_device *pdev) 96 - { 97 - struct aaedkbd *aaedkbd; 98 - struct input_polled_dev *poll_dev; 99 - struct input_dev *input_dev; 100 - int i; 101 - int error; 102 - 103 - aaedkbd = kzalloc(sizeof(struct aaedkbd), GFP_KERNEL); 104 - poll_dev = input_allocate_polled_device(); 105 - if (!aaedkbd || !poll_dev) { 106 - error = -ENOMEM; 107 - goto fail; 108 - } 109 - 110 - platform_set_drvdata(pdev, aaedkbd); 111 - 112 - aaedkbd->poll_dev = poll_dev; 113 - memcpy(aaedkbd->keycode, aaedkbd_keycode, sizeof(aaedkbd->keycode)); 114 - 115 - poll_dev->private = aaedkbd; 116 - poll_dev->poll = aaedkbd_poll; 117 - poll_dev->poll_interval = SCAN_INTERVAL; 118 - 119 - input_dev = poll_dev->input; 120 - input_dev->name = "AAED-2000 Keyboard"; 121 - input_dev->phys = "aaedkbd/input0"; 122 - input_dev->id.bustype = BUS_HOST; 123 - input_dev->id.vendor = 0x0001; 124 - input_dev->id.product = 0x0001; 125 - input_dev->id.version = 0x0100; 126 - input_dev->dev.parent = &pdev->dev; 127 - 128 - input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP); 129 - input_dev->keycode = aaedkbd->keycode; 130 - input_dev->keycodesize = sizeof(unsigned char); 131 - input_dev->keycodemax = ARRAY_SIZE(aaedkbd_keycode); 132 - 133 - for (i = 0; i < ARRAY_SIZE(aaedkbd_keycode); i++) 134 - set_bit(aaedkbd->keycode[i], input_dev->keybit); 135 - clear_bit(0, input_dev->keybit); 136 - 137 - error = input_register_polled_device(aaedkbd->poll_dev); 138 - if (error) 139 - goto fail; 140 - 141 - return 0; 142 - 143 - fail: kfree(aaedkbd); 144 - input_free_polled_device(poll_dev); 145 - return error; 146 - } 147 - 148 - static int __devexit aaedkbd_remove(struct platform_device *pdev) 149 - { 150 - struct aaedkbd *aaedkbd = platform_get_drvdata(pdev); 151 - 152 - input_unregister_polled_device(aaedkbd->poll_dev); 153 - input_free_polled_device(aaedkbd->poll_dev); 154 - kfree(aaedkbd); 155 - 156 - return 0; 157 - } 158 - 159 - /* work with hotplug and coldplug */ 160 - MODULE_ALIAS("platform:aaed2000-keyboard"); 161 - 162 - static struct platform_driver aaedkbd_driver = { 163 - .probe = aaedkbd_probe, 164 - .remove = __devexit_p(aaedkbd_remove), 165 - .driver = { 166 - .name = "aaed2000-keyboard", 167 - .owner = THIS_MODULE, 168 - }, 169 - }; 170 - 171 - static int __init aaedkbd_init(void) 172 - { 173 - return platform_driver_register(&aaedkbd_driver); 174 - } 175 - 176 - static void __exit aaedkbd_exit(void) 177 - { 178 - platform_driver_unregister(&aaedkbd_driver); 179 - } 180 - 181 - module_init(aaedkbd_init); 182 - module_exit(aaedkbd_exit); 183 - 184 - MODULE_AUTHOR("Nicolas Bellido Y Ortega"); 185 - MODULE_DESCRIPTION("AAED-2000 Keyboard Driver"); 186 - MODULE_LICENSE("GPL v2");
+21
drivers/input/serio/i8042-x86ia64io.h
··· 424 424 DMI_MATCH(DMI_PRODUCT_VERSION, "0100"), 425 425 }, 426 426 }, 427 + { 428 + /* Dell Vostro V13 */ 429 + .matches = { 430 + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 431 + DMI_MATCH(DMI_PRODUCT_NAME, "Vostro V13"), 432 + }, 433 + }, 427 434 { } 428 435 }; 429 436 ··· 551 544 { } 552 545 }; 553 546 #endif 547 + 548 + static const struct dmi_system_id __initconst i8042_dmi_notimeout_table[] = { 549 + { 550 + /* Dell Vostro V13 */ 551 + .matches = { 552 + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 553 + DMI_MATCH(DMI_PRODUCT_NAME, "Vostro V13"), 554 + }, 555 + }, 556 + { } 557 + }; 554 558 555 559 /* 556 560 * Some Wistron based laptops need us to explicitly enable the 'Dritek ··· 913 895 914 896 if (dmi_check_system(i8042_dmi_nomux_table)) 915 897 i8042_nomux = true; 898 + 899 + if (dmi_check_system(i8042_dmi_notimeout_table)) 900 + i8042_notimeout = true; 916 901 917 902 if (dmi_check_system(i8042_dmi_dritek_table)) 918 903 i8042_dritek = true;
+5 -1
drivers/input/serio/i8042.c
··· 63 63 module_param_named(noloop, i8042_noloop, bool, 0); 64 64 MODULE_PARM_DESC(noloop, "Disable the AUX Loopback command while probing for the AUX port"); 65 65 66 + static bool i8042_notimeout; 67 + module_param_named(notimeout, i8042_notimeout, bool, 0); 68 + MODULE_PARM_DESC(notimeout, "Ignore timeouts signalled by i8042"); 69 + 66 70 #ifdef CONFIG_X86 67 71 static bool i8042_dritek; 68 72 module_param_named(dritek, i8042_dritek, bool, 0); ··· 508 504 } else { 509 505 510 506 dfl = ((str & I8042_STR_PARITY) ? SERIO_PARITY : 0) | 511 - ((str & I8042_STR_TIMEOUT) ? SERIO_TIMEOUT : 0); 507 + ((str & I8042_STR_TIMEOUT && !i8042_notimeout) ? SERIO_TIMEOUT : 0); 512 508 513 509 port_no = (str & I8042_STR_AUXDATA) ? 514 510 I8042_AUX_PORT_NO : I8042_KBD_PORT_NO;
+10 -7
drivers/input/touchscreen/ad7879-i2c.c
··· 10 10 #include <linux/i2c.h> 11 11 #include <linux/module.h> 12 12 #include <linux/types.h> 13 + #include <linux/pm.h> 13 14 14 15 #include "ad7879.h" 15 16 16 17 #define AD7879_DEVID 0x79 /* AD7879-1/AD7889-1 */ 17 18 18 19 #ifdef CONFIG_PM 19 - static int ad7879_i2c_suspend(struct i2c_client *client, pm_message_t message) 20 + static int ad7879_i2c_suspend(struct device *dev) 20 21 { 22 + struct i2c_client *client = to_i2c_client(dev); 21 23 struct ad7879 *ts = i2c_get_clientdata(client); 22 24 23 25 ad7879_suspend(ts); ··· 27 25 return 0; 28 26 } 29 27 30 - static int ad7879_i2c_resume(struct i2c_client *client) 28 + static int ad7879_i2c_resume(struct device *dev) 31 29 { 30 + struct i2c_client *client = to_i2c_client(dev); 32 31 struct ad7879 *ts = i2c_get_clientdata(client); 33 32 34 33 ad7879_resume(ts); 35 34 36 35 return 0; 37 36 } 38 - #else 39 - # define ad7879_i2c_suspend NULL 40 - # define ad7879_i2c_resume NULL 37 + 38 + static SIMPLE_DEV_PM_OPS(ad7879_i2c_pm, ad7879_i2c_suspend, ad7879_i2c_resume); 41 39 #endif 42 40 43 41 /* All registers are word-sized. ··· 119 117 .driver = { 120 118 .name = "ad7879", 121 119 .owner = THIS_MODULE, 120 + #ifdef CONFIG_PM 121 + .pm = &ad7879_i2c_pm, 122 + #endif 122 123 }, 123 124 .probe = ad7879_i2c_probe, 124 125 .remove = __devexit_p(ad7879_i2c_remove), 125 - .suspend = ad7879_i2c_suspend, 126 - .resume = ad7879_i2c_resume, 127 126 .id_table = ad7879_id, 128 127 }; 129 128
+9 -6
drivers/input/touchscreen/cy8ctmg110_ts.c
··· 280 280 } 281 281 282 282 #ifdef CONFIG_PM 283 - static int cy8ctmg110_suspend(struct i2c_client *client, pm_message_t mesg) 283 + static int cy8ctmg110_suspend(struct device *dev) 284 284 { 285 + struct i2c_client *client = to_i2c_client(dev); 285 286 struct cy8ctmg110 *ts = i2c_get_clientdata(client); 286 287 287 288 if (device_may_wakeup(&client->dev)) ··· 294 293 return 0; 295 294 } 296 295 297 - static int cy8ctmg110_resume(struct i2c_client *client) 296 + static int cy8ctmg110_resume(struct device *dev) 298 297 { 298 + struct i2c_client *client = to_i2c_client(dev); 299 299 struct cy8ctmg110 *ts = i2c_get_clientdata(client); 300 300 301 301 if (device_may_wakeup(&client->dev)) ··· 307 305 } 308 306 return 0; 309 307 } 308 + 309 + static SIMPLE_DEV_PM_OPS(cy8ctmg110_pm, cy8ctmg110_suspend, cy8ctmg110_resume); 310 310 #endif 311 311 312 312 static int __devexit cy8ctmg110_remove(struct i2c_client *client) ··· 339 335 .driver = { 340 336 .owner = THIS_MODULE, 341 337 .name = CY8CTMG110_DRIVER_NAME, 338 + #ifdef CONFIG_PM 339 + .pm = &cy8ctmg110_pm, 340 + #endif 342 341 }, 343 342 .id_table = cy8ctmg110_idtable, 344 343 .probe = cy8ctmg110_probe, 345 344 .remove = __devexit_p(cy8ctmg110_remove), 346 - #ifdef CONFIG_PM 347 - .suspend = cy8ctmg110_suspend, 348 - .resume = cy8ctmg110_resume, 349 - #endif 350 345 }; 351 346 352 347 static int __init cy8ctmg110_init(void)
+9 -7
drivers/input/touchscreen/eeti_ts.c
··· 261 261 } 262 262 263 263 #ifdef CONFIG_PM 264 - static int eeti_ts_suspend(struct i2c_client *client, pm_message_t mesg) 264 + static int eeti_ts_suspend(struct device *dev) 265 265 { 266 + struct i2c_client *client = to_i2c_client(dev); 266 267 struct eeti_ts_priv *priv = i2c_get_clientdata(client); 267 268 struct input_dev *input_dev = priv->input; 268 269 ··· 280 279 return 0; 281 280 } 282 281 283 - static int eeti_ts_resume(struct i2c_client *client) 282 + static int eeti_ts_resume(struct device *dev) 284 283 { 284 + struct i2c_client *client = to_i2c_client(dev); 285 285 struct eeti_ts_priv *priv = i2c_get_clientdata(client); 286 286 struct input_dev *input_dev = priv->input; 287 287 ··· 298 296 299 297 return 0; 300 298 } 301 - #else 302 - #define eeti_ts_suspend NULL 303 - #define eeti_ts_resume NULL 299 + 300 + static SIMPLE_DEV_PM_OPS(eeti_ts_pm, eeti_ts_suspend, eeti_ts_resume); 304 301 #endif 305 302 306 303 static const struct i2c_device_id eeti_ts_id[] = { ··· 311 310 static struct i2c_driver eeti_ts_driver = { 312 311 .driver = { 313 312 .name = "eeti_ts", 313 + #ifdef CONFIG_PM 314 + .pm = &eeti_ts_pm, 315 + #endif 314 316 }, 315 317 .probe = eeti_ts_probe, 316 318 .remove = __devexit_p(eeti_ts_remove), 317 - .suspend = eeti_ts_suspend, 318 - .resume = eeti_ts_resume, 319 319 .id_table = eeti_ts_id, 320 320 }; 321 321
+10 -7
drivers/input/touchscreen/mcs5000_ts.c
··· 261 261 } 262 262 263 263 #ifdef CONFIG_PM 264 - static int mcs5000_ts_suspend(struct i2c_client *client, pm_message_t mesg) 264 + static int mcs5000_ts_suspend(struct device *dev) 265 265 { 266 + struct i2c_client *client = to_i2c_client(dev); 267 + 266 268 /* Touch sleep mode */ 267 269 i2c_smbus_write_byte_data(client, MCS5000_TS_OP_MODE, OP_MODE_SLEEP); 268 270 269 271 return 0; 270 272 } 271 273 272 - static int mcs5000_ts_resume(struct i2c_client *client) 274 + static int mcs5000_ts_resume(struct device *dev) 273 275 { 276 + struct i2c_client *client = to_i2c_client(dev); 274 277 struct mcs5000_ts_data *data = i2c_get_clientdata(client); 275 278 276 279 mcs5000_ts_phys_init(data); 277 280 278 281 return 0; 279 282 } 280 - #else 281 - #define mcs5000_ts_suspend NULL 282 - #define mcs5000_ts_resume NULL 283 + 284 + static SIMPLE_DEV_PM_OPS(mcs5000_ts_pm, mcs5000_ts_suspend, mcs5000_ts_resume); 283 285 #endif 284 286 285 287 static const struct i2c_device_id mcs5000_ts_id[] = { ··· 293 291 static struct i2c_driver mcs5000_ts_driver = { 294 292 .probe = mcs5000_ts_probe, 295 293 .remove = __devexit_p(mcs5000_ts_remove), 296 - .suspend = mcs5000_ts_suspend, 297 - .resume = mcs5000_ts_resume, 298 294 .driver = { 299 295 .name = "mcs5000_ts", 296 + #ifdef CONFIG_PM 297 + .pm = &mcs5000_ts_pm, 298 + #endif 300 299 }, 301 300 .id_table = mcs5000_ts_id, 302 301 };
+8 -4
drivers/input/touchscreen/migor_ts.c
··· 23 23 #include <linux/kernel.h> 24 24 #include <linux/input.h> 25 25 #include <linux/interrupt.h> 26 + #include <linux/pm.h> 26 27 #include <linux/slab.h> 27 28 #include <asm/io.h> 28 29 #include <linux/i2c.h> ··· 227 226 return 0; 228 227 } 229 228 230 - static int migor_ts_suspend(struct i2c_client *client, pm_message_t mesg) 229 + static int migor_ts_suspend(struct device *dev) 231 230 { 231 + struct i2c_client *client = to_i2c_client(dev); 232 232 struct migor_ts_priv *priv = dev_get_drvdata(&client->dev); 233 233 234 234 if (device_may_wakeup(&client->dev)) ··· 238 236 return 0; 239 237 } 240 238 241 - static int migor_ts_resume(struct i2c_client *client) 239 + static int migor_ts_resume(struct device *dev) 242 240 { 241 + struct i2c_client *client = to_i2c_client(dev); 243 242 struct migor_ts_priv *priv = dev_get_drvdata(&client->dev); 244 243 245 244 if (device_may_wakeup(&client->dev)) ··· 248 245 249 246 return 0; 250 247 } 248 + 249 + static SIMPLE_DEV_PM_OPS(migor_ts_pm, migor_ts_suspend, migor_ts_resume); 251 250 252 251 static const struct i2c_device_id migor_ts_id[] = { 253 252 { "migor_ts", 0 }, ··· 260 255 static struct i2c_driver migor_ts_driver = { 261 256 .driver = { 262 257 .name = "migor_ts", 258 + .pm = &migor_ts_pm, 263 259 }, 264 260 .probe = migor_ts_probe, 265 261 .remove = migor_ts_remove, 266 - .suspend = migor_ts_suspend, 267 - .resume = migor_ts_resume, 268 262 .id_table = migor_ts_id, 269 263 }; 270 264
+149 -33
drivers/input/touchscreen/wacom_w8001.c
··· 3 3 * 4 4 * Copyright (c) 2008 Jaya Kumar 5 5 * Copyright (c) 2010 Red Hat, Inc. 6 + * Copyright (c) 2010 - 2011 Ping Cheng, Wacom. <pingc@wacom.com> 6 7 * 7 8 * This file is subject to the terms and conditions of the GNU General Public 8 9 * License. See the file COPYING in the main directory of this archive for ··· 65 64 66 65 /* touch query reply packet */ 67 66 struct w8001_touch_query { 67 + u16 x; 68 + u16 y; 68 69 u8 panel_res; 69 70 u8 capacity_res; 70 71 u8 sensor_id; 71 - u16 x; 72 - u16 y; 73 72 }; 74 73 75 74 /* ··· 88 87 char phys[32]; 89 88 int type; 90 89 unsigned int pktlen; 90 + u16 max_touch_x; 91 + u16 max_touch_y; 92 + u16 max_pen_x; 93 + u16 max_pen_y; 94 + char name[64]; 91 95 }; 92 96 93 - static void parse_data(u8 *data, struct w8001_coord *coord) 97 + static void parse_pen_data(u8 *data, struct w8001_coord *coord) 94 98 { 95 99 memset(coord, 0, sizeof(*coord)); 96 100 ··· 119 113 coord->tilt_y = data[8] & 0x7F; 120 114 } 121 115 122 - static void parse_touch(struct w8001 *w8001) 116 + static void parse_single_touch(u8 *data, struct w8001_coord *coord) 117 + { 118 + coord->x = (data[1] << 7) | data[2]; 119 + coord->y = (data[3] << 7) | data[4]; 120 + coord->tsw = data[0] & 0x01; 121 + } 122 + 123 + static void scale_touch_coordinates(struct w8001 *w8001, 124 + unsigned int *x, unsigned int *y) 125 + { 126 + if (w8001->max_pen_x && w8001->max_touch_x) 127 + *x = *x * w8001->max_pen_x / w8001->max_touch_x; 128 + 129 + if (w8001->max_pen_y && w8001->max_touch_y) 130 + *y = *y * w8001->max_pen_y / w8001->max_touch_y; 131 + } 132 + 133 + static void parse_multi_touch(struct w8001 *w8001) 123 134 { 124 135 struct input_dev *dev = w8001->dev; 125 136 unsigned char *data = w8001->data; 137 + unsigned int x, y; 126 138 int i; 139 + int count = 0; 127 140 128 141 for (i = 0; i < 2; i++) { 129 142 bool touch = data[0] & (1 << i); ··· 150 125 input_mt_slot(dev, i); 151 126 input_mt_report_slot_state(dev, MT_TOOL_FINGER, touch); 152 127 if (touch) { 153 - int x = (data[6 * i + 1] << 7) | (data[6 * i + 2]); 154 - int y = (data[6 * i + 3] << 7) | (data[6 * i + 4]); 128 + x = (data[6 * i + 1] << 7) | data[6 * i + 2]; 129 + y = (data[6 * i + 3] << 7) | data[6 * i + 4]; 155 130 /* data[5,6] and [11,12] is finger capacity */ 131 + 132 + /* scale to pen maximum */ 133 + scale_touch_coordinates(w8001, &x, &y); 156 134 157 135 input_report_abs(dev, ABS_MT_POSITION_X, x); 158 136 input_report_abs(dev, ABS_MT_POSITION_Y, y); 137 + count++; 159 138 } 139 + } 140 + 141 + /* emulate single touch events when stylus is out of proximity. 142 + * This is to make single touch backward support consistent 143 + * across all Wacom single touch devices. 144 + */ 145 + if (w8001->type != BTN_TOOL_PEN && 146 + w8001->type != BTN_TOOL_RUBBER) { 147 + w8001->type = count == 1 ? BTN_TOOL_FINGER : KEY_RESERVED; 148 + input_mt_report_pointer_emulation(dev, true); 160 149 } 161 150 162 151 input_sync(dev); ··· 191 152 query->y = data[5] << 9; 192 153 query->y |= data[6] << 2; 193 154 query->y |= (data[2] >> 3) & 0x3; 155 + 156 + /* Early days' single-finger touch models need the following defaults */ 157 + if (!query->x && !query->y) { 158 + query->x = 1024; 159 + query->y = 1024; 160 + if (query->panel_res) 161 + query->x = query->y = (1 << query->panel_res); 162 + query->panel_res = 10; 163 + } 194 164 } 195 165 196 166 static void report_pen_events(struct w8001 *w8001, struct w8001_coord *coord) ··· 209 161 /* 210 162 * We have 1 bit for proximity (rdy) and 3 bits for tip, side, 211 163 * side2/eraser. If rdy && f2 are set, this can be either pen + side2, 212 - * or eraser. assume 164 + * or eraser. Assume: 213 165 * - if dev is already in proximity and f2 is toggled → pen + side2 214 166 * - if dev comes into proximity with f2 set → eraser 215 167 * If f2 disappears after assuming eraser, fake proximity out for 216 168 * eraser and in for pen. 217 169 */ 218 170 219 - if (!w8001->type) { 220 - w8001->type = coord->f2 ? BTN_TOOL_RUBBER : BTN_TOOL_PEN; 221 - } else if (w8001->type == BTN_TOOL_RUBBER) { 171 + switch (w8001->type) { 172 + case BTN_TOOL_RUBBER: 222 173 if (!coord->f2) { 223 174 input_report_abs(dev, ABS_PRESSURE, 0); 224 175 input_report_key(dev, BTN_TOUCH, 0); ··· 227 180 input_sync(dev); 228 181 w8001->type = BTN_TOOL_PEN; 229 182 } 230 - } else { 183 + break; 184 + 185 + case BTN_TOOL_FINGER: 186 + input_report_key(dev, BTN_TOUCH, 0); 187 + input_report_key(dev, BTN_TOOL_FINGER, 0); 188 + input_sync(dev); 189 + /* fall through */ 190 + 191 + case KEY_RESERVED: 192 + w8001->type = coord->f2 ? BTN_TOOL_RUBBER : BTN_TOOL_PEN; 193 + break; 194 + 195 + default: 231 196 input_report_key(dev, BTN_STYLUS2, coord->f2); 197 + break; 232 198 } 233 199 234 200 input_report_abs(dev, ABS_X, coord->x); ··· 253 193 input_sync(dev); 254 194 255 195 if (!coord->rdy) 256 - w8001->type = 0; 196 + w8001->type = KEY_RESERVED; 197 + } 198 + 199 + static void report_single_touch(struct w8001 *w8001, struct w8001_coord *coord) 200 + { 201 + struct input_dev *dev = w8001->dev; 202 + unsigned int x = coord->x; 203 + unsigned int y = coord->y; 204 + 205 + /* scale to pen maximum */ 206 + scale_touch_coordinates(w8001, &x, &y); 207 + 208 + input_report_abs(dev, ABS_X, x); 209 + input_report_abs(dev, ABS_Y, y); 210 + input_report_key(dev, BTN_TOUCH, coord->tsw); 211 + input_report_key(dev, BTN_TOOL_FINGER, coord->tsw); 212 + 213 + input_sync(dev); 214 + 215 + w8001->type = coord->tsw ? BTN_TOOL_FINGER : KEY_RESERVED; 257 216 } 258 217 259 218 static irqreturn_t w8001_interrupt(struct serio *serio, ··· 293 214 294 215 case W8001_PKTLEN_TOUCH93 - 1: 295 216 case W8001_PKTLEN_TOUCH9A - 1: 296 - /* ignore one-finger touch packet. */ 297 - if (w8001->pktlen == w8001->idx) 217 + tmp = w8001->data[0] & W8001_TOUCH_BYTE; 218 + if (tmp != W8001_TOUCH_BYTE) 219 + break; 220 + 221 + if (w8001->pktlen == w8001->idx) { 298 222 w8001->idx = 0; 223 + if (w8001->type != BTN_TOOL_PEN && 224 + w8001->type != BTN_TOOL_RUBBER) { 225 + parse_single_touch(w8001->data, &coord); 226 + report_single_touch(w8001, &coord); 227 + } 228 + } 299 229 break; 300 230 301 231 /* Pen coordinates packet */ ··· 313 225 if (unlikely(tmp == W8001_TAB_BYTE)) 314 226 break; 315 227 316 - tmp = (w8001->data[0] & W8001_TOUCH_BYTE); 228 + tmp = w8001->data[0] & W8001_TOUCH_BYTE; 317 229 if (tmp == W8001_TOUCH_BYTE) 318 230 break; 319 231 320 232 w8001->idx = 0; 321 - parse_data(w8001->data, &coord); 233 + parse_pen_data(w8001->data, &coord); 322 234 report_pen_events(w8001, &coord); 323 235 break; 324 236 325 237 /* control packet */ 326 238 case W8001_PKTLEN_TPCCTL - 1: 327 - tmp = (w8001->data[0] & W8001_TOUCH_MASK); 239 + tmp = w8001->data[0] & W8001_TOUCH_MASK; 328 240 if (tmp == W8001_TOUCH_BYTE) 329 241 break; 330 242 ··· 337 249 /* 2 finger touch packet */ 338 250 case W8001_PKTLEN_TOUCH2FG - 1: 339 251 w8001->idx = 0; 340 - parse_touch(w8001); 252 + parse_multi_touch(w8001); 341 253 break; 342 254 } 343 255 ··· 367 279 { 368 280 struct input_dev *dev = w8001->dev; 369 281 struct w8001_coord coord; 282 + struct w8001_touch_query touch; 370 283 int error; 371 284 372 285 error = w8001_command(w8001, W8001_CMD_STOP, false); ··· 376 287 377 288 msleep(250); /* wait 250ms before querying the device */ 378 289 290 + dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); 291 + strlcat(w8001->name, "Wacom Serial", sizeof(w8001->name)); 292 + 379 293 /* penabled? */ 380 294 error = w8001_command(w8001, W8001_CMD_QUERY, true); 381 295 if (!error) { 296 + __set_bit(BTN_TOUCH, dev->keybit); 382 297 __set_bit(BTN_TOOL_PEN, dev->keybit); 383 298 __set_bit(BTN_TOOL_RUBBER, dev->keybit); 384 299 __set_bit(BTN_STYLUS, dev->keybit); 385 300 __set_bit(BTN_STYLUS2, dev->keybit); 386 - parse_data(w8001->response, &coord); 301 + 302 + parse_pen_data(w8001->response, &coord); 303 + w8001->max_pen_x = coord.x; 304 + w8001->max_pen_y = coord.y; 387 305 388 306 input_set_abs_params(dev, ABS_X, 0, coord.x, 0, 0); 389 307 input_set_abs_params(dev, ABS_Y, 0, coord.y, 0, 0); ··· 399 303 input_set_abs_params(dev, ABS_TILT_X, 0, coord.tilt_x, 0, 0); 400 304 input_set_abs_params(dev, ABS_TILT_Y, 0, coord.tilt_y, 0, 0); 401 305 } 306 + w8001->id = 0x90; 307 + strlcat(w8001->name, " Penabled", sizeof(w8001->name)); 402 308 } 403 309 404 310 /* Touch enabled? */ ··· 411 313 * second byte is empty, which indicates touch is not supported. 412 314 */ 413 315 if (!error && w8001->response[1]) { 414 - struct w8001_touch_query touch; 316 + __set_bit(BTN_TOUCH, dev->keybit); 317 + __set_bit(BTN_TOOL_FINGER, dev->keybit); 415 318 416 319 parse_touchquery(w8001->response, &touch); 320 + w8001->max_touch_x = touch.x; 321 + w8001->max_touch_y = touch.y; 322 + 323 + /* scale to pen maximum */ 324 + if (w8001->max_pen_x && w8001->max_pen_y) { 325 + touch.x = w8001->max_pen_x; 326 + touch.y = w8001->max_pen_y; 327 + } 417 328 418 329 input_set_abs_params(dev, ABS_X, 0, touch.x, 0, 0); 419 330 input_set_abs_params(dev, ABS_Y, 0, touch.y, 0, 0); 420 - __set_bit(BTN_TOOL_FINGER, dev->keybit); 421 331 422 332 switch (touch.sensor_id) { 423 333 case 0: 424 334 case 2: 425 335 w8001->pktlen = W8001_PKTLEN_TOUCH93; 336 + w8001->id = 0x93; 337 + strlcat(w8001->name, " 1FG", sizeof(w8001->name)); 426 338 break; 339 + 427 340 case 1: 428 341 case 3: 429 342 case 4: 430 343 w8001->pktlen = W8001_PKTLEN_TOUCH9A; 344 + strlcat(w8001->name, " 1FG", sizeof(w8001->name)); 345 + w8001->id = 0x9a; 431 346 break; 347 + 432 348 case 5: 433 349 w8001->pktlen = W8001_PKTLEN_TOUCH2FG; 434 350 ··· 453 341 0, touch.y, 0, 0); 454 342 input_set_abs_params(dev, ABS_MT_TOOL_TYPE, 455 343 0, MT_TOOL_MAX, 0, 0); 344 + 345 + strlcat(w8001->name, " 2FG", sizeof(w8001->name)); 346 + if (w8001->max_pen_x && w8001->max_pen_y) 347 + w8001->id = 0xE3; 348 + else 349 + w8001->id = 0xE2; 456 350 break; 457 351 } 458 352 } 353 + 354 + strlcat(w8001->name, " Touchscreen", sizeof(w8001->name)); 459 355 460 356 return w8001_command(w8001, W8001_CMD_START, false); 461 357 } ··· 504 384 } 505 385 506 386 w8001->serio = serio; 507 - w8001->id = serio->id.id; 508 387 w8001->dev = input_dev; 509 388 init_completion(&w8001->cmd_done); 510 389 snprintf(w8001->phys, sizeof(w8001->phys), "%s/input0", serio->phys); 511 - 512 - input_dev->name = "Wacom W8001 Penabled Serial TouchScreen"; 513 - input_dev->phys = w8001->phys; 514 - input_dev->id.bustype = BUS_RS232; 515 - input_dev->id.vendor = SERIO_W8001; 516 - input_dev->id.product = w8001->id; 517 - input_dev->id.version = 0x0100; 518 - input_dev->dev.parent = &serio->dev; 519 - 520 - input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); 521 - __set_bit(BTN_TOUCH, input_dev->keybit); 522 390 523 391 serio_set_drvdata(serio, w8001); 524 392 err = serio_open(serio, drv); ··· 516 408 err = w8001_setup(w8001); 517 409 if (err) 518 410 goto fail3; 411 + 412 + input_dev->name = w8001->name; 413 + input_dev->phys = w8001->phys; 414 + input_dev->id.product = w8001->id; 415 + input_dev->id.bustype = BUS_RS232; 416 + input_dev->id.vendor = 0x056a; 417 + input_dev->id.version = 0x0100; 418 + input_dev->dev.parent = &serio->dev; 519 419 520 420 err = input_register_device(w8001->dev); 521 421 if (err)
+1
include/linux/input.h
··· 802 802 #define SW_CAMERA_LENS_COVER 0x09 /* set = lens covered */ 803 803 #define SW_KEYPAD_SLIDE 0x0a /* set = keypad slide out */ 804 804 #define SW_FRONT_PROXIMITY 0x0b /* set = front proximity sensor active */ 805 + #define SW_ROTATE_LOCK 0x0c /* set = rotate locked/disabled */ 805 806 #define SW_MAX 0x0f 806 807 #define SW_CNT (SW_MAX+1) 807 808
+20
include/linux/input/as5011.h
··· 1 + #ifndef _AS5011_H 2 + #define _AS5011_H 3 + 4 + /* 5 + * Copyright (c) 2010, 2011 Fabien Marteau <fabien.marteau@armadeus.com> 6 + * 7 + * This program is free software; you can redistribute it and/or modify it 8 + * under the terms of the GNU General Public License version 2 as published by 9 + * the Free Software Foundation. 10 + */ 11 + 12 + struct as5011_platform_data { 13 + unsigned int button_gpio; 14 + unsigned int axis_irq; /* irq number */ 15 + unsigned long axis_irqflags; 16 + char xp, xn; /* threshold for x axis */ 17 + char yp, yn; /* threshold for y axis */ 18 + }; 19 + 20 + #endif /* _AS5011_H */