diff options
author | Dmitry Torokhov <dtor_core@ameritech.net> | 2006-04-02 00:08:05 -0500 |
---|---|---|
committer | Dmitry Torokhov <dtor_core@ameritech.net> | 2006-04-02 00:08:05 -0500 |
commit | 95d465fd750897ab32462a6702fbfe1b122cbbc0 (patch) | |
tree | 65c38b2f11c51bb6932e44dd6c92f15b0091abfe /drivers/input | |
parent | 642fde17dceceb56c7ba2762733ac688666ae657 (diff) | |
parent | 683aa4012f53b2ada0f430487e05d37b0d94e90a (diff) |
Manual merge with Linus.
Conflicts:
arch/powerpc/kernel/setup-common.c
drivers/input/keyboard/hil_kbd.c
drivers/input/mouse/hil_ptr.c
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/input.c | 2 | ||||
-rw-r--r-- | drivers/input/keyboard/hil_kbd.c | 60 | ||||
-rw-r--r-- | drivers/input/keyboard/hilkbd.c | 53 | ||||
-rw-r--r-- | drivers/input/mouse/hil_ptr.c | 88 | ||||
-rw-r--r-- | drivers/input/serio/gscps2.c | 4 | ||||
-rw-r--r-- | drivers/input/serio/hil_mlc.c | 2 | ||||
-rw-r--r-- | drivers/input/serio/hp_sdc_mlc.c | 7 | ||||
-rw-r--r-- | drivers/input/touchscreen/ads7846.c | 1 |
8 files changed, 119 insertions, 98 deletions
diff --git a/drivers/input/input.c b/drivers/input/input.c index 3e22bb11ee05..de94ffcb0995 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c | |||
@@ -924,7 +924,7 @@ void input_unregister_handler(struct input_handler *handler) | |||
924 | static int input_open_file(struct inode *inode, struct file *file) | 924 | static int input_open_file(struct inode *inode, struct file *file) |
925 | { | 925 | { |
926 | struct input_handler *handler = input_table[iminor(inode) >> 5]; | 926 | struct input_handler *handler = input_table[iminor(inode) >> 5]; |
927 | struct file_operations *old_fops, *new_fops = NULL; | 927 | const struct file_operations *old_fops, *new_fops = NULL; |
928 | int err; | 928 | int err; |
929 | 929 | ||
930 | /* No load-on-demand here? */ | 930 | /* No load-on-demand here? */ |
diff --git a/drivers/input/keyboard/hil_kbd.c b/drivers/input/keyboard/hil_kbd.c index ed3271b71400..1dca3cf42a54 100644 --- a/drivers/input/keyboard/hil_kbd.c +++ b/drivers/input/keyboard/hil_kbd.c | |||
@@ -66,7 +66,7 @@ static unsigned int hil_kbd_set3[HIL_KEYCODES_SET3_TBLSIZE] = | |||
66 | static char hil_language[][16] = { HIL_LOCALE_MAP }; | 66 | static char hil_language[][16] = { HIL_LOCALE_MAP }; |
67 | 67 | ||
68 | struct hil_kbd { | 68 | struct hil_kbd { |
69 | struct input_dev dev; | 69 | struct input_dev *dev; |
70 | struct serio *serio; | 70 | struct serio *serio; |
71 | 71 | ||
72 | /* Input buffer and index for packets from HIL bus. */ | 72 | /* Input buffer and index for packets from HIL bus. */ |
@@ -86,7 +86,7 @@ struct hil_kbd { | |||
86 | /* Process a complete packet after transfer from the HIL */ | 86 | /* Process a complete packet after transfer from the HIL */ |
87 | static void hil_kbd_process_record(struct hil_kbd *kbd) | 87 | static void hil_kbd_process_record(struct hil_kbd *kbd) |
88 | { | 88 | { |
89 | struct input_dev *dev = &kbd->dev; | 89 | struct input_dev *dev = kbd->dev; |
90 | hil_packet *data = kbd->data; | 90 | hil_packet *data = kbd->data; |
91 | hil_packet p; | 91 | hil_packet p; |
92 | int idx, i, cnt; | 92 | int idx, i, cnt; |
@@ -240,8 +240,8 @@ static void hil_kbd_disconnect(struct serio *serio) | |||
240 | return; | 240 | return; |
241 | } | 241 | } |
242 | 242 | ||
243 | input_unregister_device(&kbd->dev); | ||
244 | serio_close(serio); | 243 | serio_close(serio); |
244 | input_unregister_device(kbd->dev); | ||
245 | kfree(kbd); | 245 | kfree(kbd); |
246 | } | 246 | } |
247 | 247 | ||
@@ -250,16 +250,22 @@ static int hil_kbd_connect(struct serio *serio, struct serio_driver *drv) | |||
250 | struct hil_kbd *kbd; | 250 | struct hil_kbd *kbd; |
251 | uint8_t did, *idd; | 251 | uint8_t did, *idd; |
252 | int i; | 252 | int i; |
253 | 253 | ||
254 | kbd = kzalloc(sizeof(*kbd), GFP_KERNEL); | 254 | kbd = kzalloc(sizeof(*kbd), GFP_KERNEL); |
255 | if (!kbd) | 255 | if (!kbd) |
256 | return -ENOMEM; | 256 | return -ENOMEM; |
257 | 257 | ||
258 | if (serio_open(serio, drv)) goto bail0; | 258 | kbd->dev = input_allocate_device(); |
259 | if (!kbd->dev) | ||
260 | goto bail0; | ||
261 | |||
262 | kbd->dev->private = kbd; | ||
263 | |||
264 | if (serio_open(serio, drv)) | ||
265 | goto bail1; | ||
259 | 266 | ||
260 | serio_set_drvdata(serio, kbd); | 267 | serio_set_drvdata(serio, kbd); |
261 | kbd->serio = serio; | 268 | kbd->serio = serio; |
262 | kbd->dev.private = kbd; | ||
263 | 269 | ||
264 | init_MUTEX_LOCKED(&(kbd->sem)); | 270 | init_MUTEX_LOCKED(&(kbd->sem)); |
265 | 271 | ||
@@ -301,38 +307,38 @@ static int hil_kbd_connect(struct serio *serio, struct serio_driver *drv) | |||
301 | did, hil_language[did & HIL_IDD_DID_TYPE_KB_LANG_MASK]); | 307 | did, hil_language[did & HIL_IDD_DID_TYPE_KB_LANG_MASK]); |
302 | break; | 308 | break; |
303 | default: | 309 | default: |
304 | goto bail1; | 310 | goto bail2; |
305 | } | 311 | } |
306 | 312 | ||
307 | if(HIL_IDD_NUM_BUTTONS(idd) || HIL_IDD_NUM_AXES_PER_SET(*idd)) { | 313 | if(HIL_IDD_NUM_BUTTONS(idd) || HIL_IDD_NUM_AXES_PER_SET(*idd)) { |
308 | printk(KERN_INFO PREFIX "keyboards only, no combo devices supported.\n"); | 314 | printk(KERN_INFO PREFIX "keyboards only, no combo devices supported.\n"); |
309 | goto bail1; | 315 | goto bail2; |
310 | } | 316 | } |
311 | 317 | ||
312 | 318 | ||
313 | kbd->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_REP); | 319 | kbd->dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP); |
314 | kbd->dev.ledbit[0] = BIT(LED_NUML) | BIT(LED_CAPSL) | BIT(LED_SCROLLL); | 320 | kbd->dev->ledbit[0] = BIT(LED_NUML) | BIT(LED_CAPSL) | BIT(LED_SCROLLL); |
315 | kbd->dev.keycodemax = HIL_KEYCODES_SET1_TBLSIZE; | 321 | kbd->dev->keycodemax = HIL_KEYCODES_SET1_TBLSIZE; |
316 | kbd->dev.keycodesize = sizeof(hil_kbd_set1[0]); | 322 | kbd->dev->keycodesize = sizeof(hil_kbd_set1[0]); |
317 | kbd->dev.keycode = hil_kbd_set1; | 323 | kbd->dev->keycode = hil_kbd_set1; |
318 | kbd->dev.name = strlen(kbd->rnm) ? kbd->rnm : HIL_GENERIC_NAME; | 324 | kbd->dev->name = strlen(kbd->rnm) ? kbd->rnm : HIL_GENERIC_NAME; |
319 | kbd->dev.phys = "hpkbd/input0"; /* XXX */ | 325 | kbd->dev->phys = "hpkbd/input0"; /* XXX */ |
320 | 326 | ||
321 | kbd->dev.id.bustype = BUS_HIL; | 327 | kbd->dev->id.bustype = BUS_HIL; |
322 | kbd->dev.id.vendor = PCI_VENDOR_ID_HP; | 328 | kbd->dev->id.vendor = PCI_VENDOR_ID_HP; |
323 | kbd->dev.id.product = 0x0001; /* TODO: get from kbd->rsc */ | 329 | kbd->dev->id.product = 0x0001; /* TODO: get from kbd->rsc */ |
324 | kbd->dev.id.version = 0x0100; /* TODO: get from kbd->rsc */ | 330 | kbd->dev->id.version = 0x0100; /* TODO: get from kbd->rsc */ |
325 | kbd->dev.dev = &serio->dev; | 331 | kbd->dev->dev = &serio->dev; |
326 | 332 | ||
327 | for (i = 0; i < 128; i++) { | 333 | for (i = 0; i < 128; i++) { |
328 | set_bit(hil_kbd_set1[i], kbd->dev.keybit); | 334 | set_bit(hil_kbd_set1[i], kbd->dev->keybit); |
329 | set_bit(hil_kbd_set3[i], kbd->dev.keybit); | 335 | set_bit(hil_kbd_set3[i], kbd->dev->keybit); |
330 | } | 336 | } |
331 | clear_bit(0, kbd->dev.keybit); | 337 | clear_bit(0, kbd->dev->keybit); |
332 | 338 | ||
333 | input_register_device(&kbd->dev); | 339 | input_register_device(kbd->dev); |
334 | printk(KERN_INFO "input: %s, ID: %d\n", | 340 | printk(KERN_INFO "input: %s, ID: %d\n", |
335 | kbd->dev.name, did); | 341 | kbd->dev->name, did); |
336 | 342 | ||
337 | serio->write(serio, 0); | 343 | serio->write(serio, 0); |
338 | serio->write(serio, 0); | 344 | serio->write(serio, 0); |
@@ -342,8 +348,10 @@ static int hil_kbd_connect(struct serio *serio, struct serio_driver *drv) | |||
342 | up(&(kbd->sem)); | 348 | up(&(kbd->sem)); |
343 | 349 | ||
344 | return 0; | 350 | return 0; |
345 | bail1: | 351 | bail2: |
346 | serio_close(serio); | 352 | serio_close(serio); |
353 | bail1: | ||
354 | input_free_device(kbd->dev); | ||
347 | bail0: | 355 | bail0: |
348 | kfree(kbd); | 356 | kfree(kbd); |
349 | serio_set_drvdata(serio, NULL); | 357 | serio_set_drvdata(serio, NULL); |
diff --git a/drivers/input/keyboard/hilkbd.c b/drivers/input/keyboard/hilkbd.c index e95bc052e32a..33edd030aa75 100644 --- a/drivers/input/keyboard/hilkbd.c +++ b/drivers/input/keyboard/hilkbd.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Copyright (C) 1998 Philip Blundell <philb@gnu.org> | 4 | * Copyright (C) 1998 Philip Blundell <philb@gnu.org> |
5 | * Copyright (C) 1999 Matthew Wilcox <willy@bofh.ai> | 5 | * Copyright (C) 1999 Matthew Wilcox <willy@bofh.ai> |
6 | * Copyright (C) 1999-2003 Helge Deller <deller@gmx.de> | 6 | * Copyright (C) 1999-2006 Helge Deller <deller@gmx.de> |
7 | * | 7 | * |
8 | * Very basic HP Human Interface Loop (HIL) driver. | 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 |
@@ -90,7 +90,7 @@ static unsigned int hphilkeyb_keycode[HIL_KEYCODES_SET1_TBLSIZE] = | |||
90 | 90 | ||
91 | /* HIL structure */ | 91 | /* HIL structure */ |
92 | static struct { | 92 | static struct { |
93 | struct input_dev dev; | 93 | struct input_dev *dev; |
94 | 94 | ||
95 | unsigned int curdev; | 95 | unsigned int curdev; |
96 | 96 | ||
@@ -117,7 +117,7 @@ static void poll_finished(void) | |||
117 | down = (hil_dev.data[1] & 1) == 0; | 117 | down = (hil_dev.data[1] & 1) == 0; |
118 | scode = hil_dev.data[1] >> 1; | 118 | scode = hil_dev.data[1] >> 1; |
119 | key = hphilkeyb_keycode[scode]; | 119 | key = hphilkeyb_keycode[scode]; |
120 | input_report_key(&hil_dev.dev, key, down); | 120 | input_report_key(hil_dev.dev, key, down); |
121 | break; | 121 | break; |
122 | } | 122 | } |
123 | hil_dev.curdev = 0; | 123 | hil_dev.curdev = 0; |
@@ -207,9 +207,14 @@ hil_keyb_init(void) | |||
207 | unsigned int i, kbid; | 207 | unsigned int i, kbid; |
208 | wait_queue_head_t hil_wait; | 208 | wait_queue_head_t hil_wait; |
209 | 209 | ||
210 | if (hil_dev.dev.id.bustype) { | 210 | if (hil_dev.dev) { |
211 | return -ENODEV; /* already initialized */ | 211 | return -ENODEV; /* already initialized */ |
212 | } | 212 | } |
213 | |||
214 | hil_dev.dev = input_allocate_device(); | ||
215 | if (!hil_dev.dev) | ||
216 | return -ENOMEM; | ||
217 | hil_dev.dev->private = &hil_dev; | ||
213 | 218 | ||
214 | #if defined(CONFIG_HP300) | 219 | #if defined(CONFIG_HP300) |
215 | if (!hwreg_present((void *)(HILBASE + HIL_DATA))) | 220 | if (!hwreg_present((void *)(HILBASE + HIL_DATA))) |
@@ -247,28 +252,26 @@ hil_keyb_init(void) | |||
247 | c = 0; | 252 | c = 0; |
248 | hil_do(HIL_WRITEKBDSADR, &c, 1); | 253 | hil_do(HIL_WRITEKBDSADR, &c, 1); |
249 | 254 | ||
250 | init_input_dev(&hil_dev.dev); | ||
251 | |||
252 | for (i = 0; i < HIL_KEYCODES_SET1_TBLSIZE; i++) | 255 | for (i = 0; i < HIL_KEYCODES_SET1_TBLSIZE; i++) |
253 | if (hphilkeyb_keycode[i] != KEY_RESERVED) | 256 | if (hphilkeyb_keycode[i] != KEY_RESERVED) |
254 | set_bit(hphilkeyb_keycode[i], hil_dev.dev.keybit); | 257 | set_bit(hphilkeyb_keycode[i], hil_dev.dev->keybit); |
255 | 258 | ||
256 | hil_dev.dev.evbit[0] = BIT(EV_KEY) | BIT(EV_REP); | 259 | hil_dev.dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP); |
257 | hil_dev.dev.ledbit[0] = BIT(LED_NUML) | BIT(LED_CAPSL) | BIT(LED_SCROLLL); | 260 | hil_dev.dev->ledbit[0] = BIT(LED_NUML) | BIT(LED_CAPSL) | BIT(LED_SCROLLL); |
258 | hil_dev.dev.keycodemax = HIL_KEYCODES_SET1_TBLSIZE; | 261 | hil_dev.dev->keycodemax = HIL_KEYCODES_SET1_TBLSIZE; |
259 | hil_dev.dev.keycodesize = sizeof(hphilkeyb_keycode[0]); | 262 | hil_dev.dev->keycodesize = sizeof(hphilkeyb_keycode[0]); |
260 | hil_dev.dev.keycode = hphilkeyb_keycode; | 263 | hil_dev.dev->keycode = hphilkeyb_keycode; |
261 | hil_dev.dev.name = "HIL keyboard"; | 264 | hil_dev.dev->name = "HIL keyboard"; |
262 | hil_dev.dev.phys = "hpkbd/input0"; | 265 | hil_dev.dev->phys = "hpkbd/input0"; |
263 | 266 | ||
264 | hil_dev.dev.id.bustype = BUS_HIL; | 267 | hil_dev.dev->id.bustype = BUS_HIL; |
265 | hil_dev.dev.id.vendor = PCI_VENDOR_ID_HP; | 268 | hil_dev.dev->id.vendor = PCI_VENDOR_ID_HP; |
266 | hil_dev.dev.id.product = 0x0001; | 269 | hil_dev.dev->id.product = 0x0001; |
267 | hil_dev.dev.id.version = 0x0010; | 270 | hil_dev.dev->id.version = 0x0010; |
268 | 271 | ||
269 | input_register_device(&hil_dev.dev); | 272 | input_register_device(hil_dev.dev); |
270 | printk(KERN_INFO "input: %s, ID %d at 0x%08lx (irq %d) found and attached\n", | 273 | printk(KERN_INFO "input: %s, ID %d at 0x%08lx (irq %d) found and attached\n", |
271 | hil_dev.dev.name, kbid, HILBASE, HIL_IRQ); | 274 | hil_dev.dev->name, kbid, HILBASE, HIL_IRQ); |
272 | 275 | ||
273 | return 0; | 276 | return 0; |
274 | } | 277 | } |
@@ -329,7 +332,9 @@ static void __exit hil_exit(void) | |||
329 | /* Turn off interrupts */ | 332 | /* Turn off interrupts */ |
330 | hil_do(HIL_INTOFF, NULL, 0); | 333 | hil_do(HIL_INTOFF, NULL, 0); |
331 | 334 | ||
332 | input_unregister_device(&hil_dev.dev); | 335 | input_unregister_device(hil_dev.dev); |
336 | |||
337 | hil_dev.dev = NULL; | ||
333 | 338 | ||
334 | #if defined(CONFIG_PARISC) | 339 | #if defined(CONFIG_PARISC) |
335 | unregister_parisc_driver(&hil_driver); | 340 | unregister_parisc_driver(&hil_driver); |
diff --git a/drivers/input/mouse/hil_ptr.c b/drivers/input/mouse/hil_ptr.c index 798f4a3ad7d2..69f02178c528 100644 --- a/drivers/input/mouse/hil_ptr.c +++ b/drivers/input/mouse/hil_ptr.c | |||
@@ -55,7 +55,7 @@ MODULE_LICENSE("Dual BSD/GPL"); | |||
55 | #define HIL_PTR_MAX_LENGTH 16 | 55 | #define HIL_PTR_MAX_LENGTH 16 |
56 | 56 | ||
57 | struct hil_ptr { | 57 | struct hil_ptr { |
58 | struct input_dev dev; | 58 | struct input_dev *dev; |
59 | struct serio *serio; | 59 | struct serio *serio; |
60 | 60 | ||
61 | /* Input buffer and index for packets from HIL bus. */ | 61 | /* Input buffer and index for packets from HIL bus. */ |
@@ -79,7 +79,7 @@ struct hil_ptr { | |||
79 | /* Process a complete packet after transfer from the HIL */ | 79 | /* Process a complete packet after transfer from the HIL */ |
80 | static void hil_ptr_process_record(struct hil_ptr *ptr) | 80 | static void hil_ptr_process_record(struct hil_ptr *ptr) |
81 | { | 81 | { |
82 | struct input_dev *dev = &ptr->dev; | 82 | struct input_dev *dev = ptr->dev; |
83 | hil_packet *data = ptr->data; | 83 | hil_packet *data = ptr->data; |
84 | hil_packet p; | 84 | hil_packet p; |
85 | int idx, i, cnt, laxis; | 85 | int idx, i, cnt, laxis; |
@@ -148,12 +148,12 @@ static void hil_ptr_process_record(struct hil_ptr *ptr) | |||
148 | if (absdev) { | 148 | if (absdev) { |
149 | val = lo + (hi<<8); | 149 | val = lo + (hi<<8); |
150 | #ifdef TABLET_AUTOADJUST | 150 | #ifdef TABLET_AUTOADJUST |
151 | if (val < ptr->dev.absmin[ABS_X + i]) | 151 | if (val < dev->absmin[ABS_X + i]) |
152 | ptr->dev.absmin[ABS_X + i] = val; | 152 | dev->absmin[ABS_X + i] = val; |
153 | if (val > ptr->dev.absmax[ABS_X + i]) | 153 | if (val > dev->absmax[ABS_X + i]) |
154 | ptr->dev.absmax[ABS_X + i] = val; | 154 | dev->absmax[ABS_X + i] = val; |
155 | #endif | 155 | #endif |
156 | if (i%3) val = ptr->dev.absmax[ABS_X + i] - val; | 156 | if (i%3) val = dev->absmax[ABS_X + i] - val; |
157 | input_report_abs(dev, ABS_X + i, val); | 157 | input_report_abs(dev, ABS_X + i, val); |
158 | } else { | 158 | } else { |
159 | val = (int) (((int8_t)lo) | ((int8_t)hi<<8)); | 159 | val = (int) (((int8_t)lo) | ((int8_t)hi<<8)); |
@@ -233,27 +233,32 @@ static void hil_ptr_disconnect(struct serio *serio) | |||
233 | return; | 233 | return; |
234 | } | 234 | } |
235 | 235 | ||
236 | input_unregister_device(&ptr->dev); | ||
237 | serio_close(serio); | 236 | serio_close(serio); |
237 | input_unregister_device(ptr->dev); | ||
238 | kfree(ptr); | 238 | kfree(ptr); |
239 | } | 239 | } |
240 | 240 | ||
241 | static int hil_ptr_connect(struct serio *serio, struct serio_driver *driver) | 241 | static int hil_ptr_connect(struct serio *serio, struct serio_driver *driver) |
242 | { | 242 | { |
243 | struct hil_ptr *ptr; | 243 | struct hil_ptr *ptr; |
244 | char *txt; | 244 | char *txt; |
245 | unsigned int i, naxsets, btntype; | 245 | unsigned int i, naxsets, btntype; |
246 | uint8_t did, *idd; | 246 | uint8_t did, *idd; |
247 | 247 | ||
248 | if (!(ptr = kzalloc(sizeof(struct hil_ptr), GFP_KERNEL))) | 248 | if (!(ptr = kzalloc(sizeof(struct hil_ptr), GFP_KERNEL))) |
249 | return -ENOMEM; | 249 | return -ENOMEM; |
250 | 250 | ||
251 | if (serio_open(serio, driver)) | 251 | ptr->dev = input_allocate_device(); |
252 | if (!ptr->dev) | ||
252 | goto bail0; | 253 | goto bail0; |
253 | 254 | ||
255 | ptr->dev->private = ptr; | ||
256 | |||
257 | if (serio_open(serio, driver)) | ||
258 | goto bail1; | ||
259 | |||
254 | serio_set_drvdata(serio, ptr); | 260 | serio_set_drvdata(serio, ptr); |
255 | ptr->serio = serio; | 261 | ptr->serio = serio; |
256 | ptr->dev.private = ptr; | ||
257 | 262 | ||
258 | init_MUTEX_LOCKED(&(ptr->sem)); | 263 | init_MUTEX_LOCKED(&(ptr->sem)); |
259 | 264 | ||
@@ -284,25 +289,24 @@ static int hil_ptr_connect(struct serio *serio, struct serio_driver *driver) | |||
284 | 289 | ||
285 | up(&(ptr->sem)); | 290 | up(&(ptr->sem)); |
286 | 291 | ||
287 | init_input_dev(&ptr->dev); | ||
288 | did = ptr->idd[0]; | 292 | did = ptr->idd[0]; |
289 | idd = ptr->idd + 1; | 293 | idd = ptr->idd + 1; |
290 | txt = "unknown"; | 294 | txt = "unknown"; |
291 | if ((did & HIL_IDD_DID_TYPE_MASK) == HIL_IDD_DID_TYPE_REL) { | 295 | if ((did & HIL_IDD_DID_TYPE_MASK) == HIL_IDD_DID_TYPE_REL) { |
292 | ptr->dev.evbit[0] = BIT(EV_REL); | 296 | ptr->dev->evbit[0] = BIT(EV_REL); |
293 | txt = "relative"; | 297 | txt = "relative"; |
294 | } | 298 | } |
295 | 299 | ||
296 | if ((did & HIL_IDD_DID_TYPE_MASK) == HIL_IDD_DID_TYPE_ABS) { | 300 | if ((did & HIL_IDD_DID_TYPE_MASK) == HIL_IDD_DID_TYPE_ABS) { |
297 | ptr->dev.evbit[0] = BIT(EV_ABS); | 301 | ptr->dev->evbit[0] = BIT(EV_ABS); |
298 | txt = "absolute"; | 302 | txt = "absolute"; |
299 | } | 303 | } |
300 | if (!ptr->dev.evbit[0]) { | 304 | if (!ptr->dev->evbit[0]) { |
301 | goto bail1; | 305 | goto bail2; |
302 | } | 306 | } |
303 | 307 | ||
304 | ptr->nbtn = HIL_IDD_NUM_BUTTONS(idd); | 308 | ptr->nbtn = HIL_IDD_NUM_BUTTONS(idd); |
305 | if (ptr->nbtn) ptr->dev.evbit[0] |= BIT(EV_KEY); | 309 | if (ptr->nbtn) ptr->dev->evbit[0] |= BIT(EV_KEY); |
306 | 310 | ||
307 | naxsets = HIL_IDD_NUM_AXSETS(*idd); | 311 | naxsets = HIL_IDD_NUM_AXSETS(*idd); |
308 | ptr->naxes = HIL_IDD_NUM_AXES_PER_SET(*idd); | 312 | ptr->naxes = HIL_IDD_NUM_AXES_PER_SET(*idd); |
@@ -326,7 +330,7 @@ static int hil_ptr_connect(struct serio *serio, struct serio_driver *driver) | |||
326 | btntype = BTN_MOUSE; | 330 | btntype = BTN_MOUSE; |
327 | 331 | ||
328 | for (i = 0; i < ptr->nbtn; i++) { | 332 | for (i = 0; i < ptr->nbtn; i++) { |
329 | set_bit(btntype | i, ptr->dev.keybit); | 333 | set_bit(btntype | i, ptr->dev->keybit); |
330 | ptr->btnmap[i] = btntype | i; | 334 | ptr->btnmap[i] = btntype | i; |
331 | } | 335 | } |
332 | 336 | ||
@@ -338,50 +342,52 @@ static int hil_ptr_connect(struct serio *serio, struct serio_driver *driver) | |||
338 | 342 | ||
339 | if ((did & HIL_IDD_DID_TYPE_MASK) == HIL_IDD_DID_TYPE_REL) { | 343 | if ((did & HIL_IDD_DID_TYPE_MASK) == HIL_IDD_DID_TYPE_REL) { |
340 | for (i = 0; i < ptr->naxes; i++) { | 344 | for (i = 0; i < ptr->naxes; i++) { |
341 | set_bit(REL_X + i, ptr->dev.relbit); | 345 | set_bit(REL_X + i, ptr->dev->relbit); |
342 | } | 346 | } |
343 | for (i = 3; (i < ptr->naxes + 3) && (naxsets > 1); i++) { | 347 | for (i = 3; (i < ptr->naxes + 3) && (naxsets > 1); i++) { |
344 | set_bit(REL_X + i, ptr->dev.relbit); | 348 | set_bit(REL_X + i, ptr->dev->relbit); |
345 | } | 349 | } |
346 | } else { | 350 | } else { |
347 | for (i = 0; i < ptr->naxes; i++) { | 351 | for (i = 0; i < ptr->naxes; i++) { |
348 | set_bit(ABS_X + i, ptr->dev.absbit); | 352 | set_bit(ABS_X + i, ptr->dev->absbit); |
349 | ptr->dev.absmin[ABS_X + i] = 0; | 353 | ptr->dev->absmin[ABS_X + i] = 0; |
350 | ptr->dev.absmax[ABS_X + i] = | 354 | ptr->dev->absmax[ABS_X + i] = |
351 | HIL_IDD_AXIS_MAX((ptr->idd + 1), i); | 355 | HIL_IDD_AXIS_MAX((ptr->idd + 1), i); |
352 | } | 356 | } |
353 | for (i = 3; (i < ptr->naxes + 3) && (naxsets > 1); i++) { | 357 | for (i = 3; (i < ptr->naxes + 3) && (naxsets > 1); i++) { |
354 | set_bit(ABS_X + i, ptr->dev.absbit); | 358 | set_bit(ABS_X + i, ptr->dev->absbit); |
355 | ptr->dev.absmin[ABS_X + i] = 0; | 359 | ptr->dev->absmin[ABS_X + i] = 0; |
356 | ptr->dev.absmax[ABS_X + i] = | 360 | ptr->dev->absmax[ABS_X + i] = |
357 | HIL_IDD_AXIS_MAX((ptr->idd + 1), (i - 3)); | 361 | HIL_IDD_AXIS_MAX((ptr->idd + 1), (i - 3)); |
358 | } | 362 | } |
359 | #ifdef TABLET_AUTOADJUST | 363 | #ifdef TABLET_AUTOADJUST |
360 | for (i = 0; i < ABS_MAX; i++) { | 364 | for (i = 0; i < ABS_MAX; i++) { |
361 | int diff = ptr->dev.absmax[ABS_X + i] / 10; | 365 | int diff = ptr->dev->absmax[ABS_X + i] / 10; |
362 | ptr->dev.absmin[ABS_X + i] += diff; | 366 | ptr->dev->absmin[ABS_X + i] += diff; |
363 | ptr->dev.absmax[ABS_X + i] -= diff; | 367 | ptr->dev->absmax[ABS_X + i] -= diff; |
364 | } | 368 | } |
365 | #endif | 369 | #endif |
366 | } | 370 | } |
367 | 371 | ||
368 | ptr->dev.name = strlen(ptr->rnm) ? ptr->rnm : HIL_GENERIC_NAME; | 372 | ptr->dev->name = strlen(ptr->rnm) ? ptr->rnm : HIL_GENERIC_NAME; |
369 | 373 | ||
370 | ptr->dev.id.bustype = BUS_HIL; | 374 | ptr->dev->id.bustype = BUS_HIL; |
371 | ptr->dev.id.vendor = PCI_VENDOR_ID_HP; | 375 | ptr->dev->id.vendor = PCI_VENDOR_ID_HP; |
372 | ptr->dev.id.product = 0x0001; /* TODO: get from ptr->rsc */ | 376 | ptr->dev->id.product = 0x0001; /* TODO: get from ptr->rsc */ |
373 | ptr->dev.id.version = 0x0100; /* TODO: get from ptr->rsc */ | 377 | ptr->dev->id.version = 0x0100; /* TODO: get from ptr->rsc */ |
374 | ptr->dev.dev = &serio->dev; | 378 | ptr->dev->dev = &serio->dev; |
375 | 379 | ||
376 | input_register_device(&ptr->dev); | 380 | input_register_device(ptr->dev); |
377 | printk(KERN_INFO "input: %s (%s), ID: %d\n", | 381 | printk(KERN_INFO "input: %s (%s), ID: %d\n", |
378 | ptr->dev.name, | 382 | ptr->dev->name, |
379 | (btntype == BTN_MOUSE) ? "HIL mouse":"HIL tablet or touchpad", | 383 | (btntype == BTN_MOUSE) ? "HIL mouse":"HIL tablet or touchpad", |
380 | did); | 384 | did); |
381 | 385 | ||
382 | return 0; | 386 | return 0; |
383 | bail1: | 387 | bail2: |
384 | serio_close(serio); | 388 | serio_close(serio); |
389 | bail1: | ||
390 | input_free_device(ptr->dev); | ||
385 | bail0: | 391 | bail0: |
386 | kfree(ptr); | 392 | kfree(ptr); |
387 | serio_set_drvdata(serio, NULL); | 393 | serio_set_drvdata(serio, NULL); |
diff --git a/drivers/input/serio/gscps2.c b/drivers/input/serio/gscps2.c index a7b0de0f92b2..c0b1e4becad3 100644 --- a/drivers/input/serio/gscps2.c +++ b/drivers/input/serio/gscps2.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * drivers/input/serio/gscps2.c | 2 | * drivers/input/serio/gscps2.c |
3 | * | 3 | * |
4 | * Copyright (c) 2004 Helge Deller <deller@gmx.de> | 4 | * Copyright (c) 2004-2006 Helge Deller <deller@gmx.de> |
5 | * Copyright (c) 2002 Laurent Canet <canetl@esiee.fr> | 5 | * Copyright (c) 2002 Laurent Canet <canetl@esiee.fr> |
6 | * Copyright (c) 2002 Thibaut Varene <varenet@parisc-linux.org> | 6 | * Copyright (c) 2002 Thibaut Varene <varenet@parisc-linux.org> |
7 | * | 7 | * |
@@ -354,7 +354,7 @@ static int __init gscps2_probe(struct parisc_device *dev) | |||
354 | memset(serio, 0, sizeof(struct serio)); | 354 | memset(serio, 0, sizeof(struct serio)); |
355 | ps2port->port = serio; | 355 | ps2port->port = serio; |
356 | ps2port->padev = dev; | 356 | ps2port->padev = dev; |
357 | ps2port->addr = ioremap(hpa, GSC_STATUS + 4); | 357 | ps2port->addr = ioremap_nocache(hpa, GSC_STATUS + 4); |
358 | spin_lock_init(&ps2port->lock); | 358 | spin_lock_init(&ps2port->lock); |
359 | 359 | ||
360 | gscps2_reset(ps2port); | 360 | gscps2_reset(ps2port); |
diff --git a/drivers/input/serio/hil_mlc.c b/drivers/input/serio/hil_mlc.c index 73aa8df84bcd..bbbe15e21904 100644 --- a/drivers/input/serio/hil_mlc.c +++ b/drivers/input/serio/hil_mlc.c | |||
@@ -556,7 +556,7 @@ static inline void hilse_setup_input(hil_mlc *mlc, struct hilse_node *node) { | |||
556 | do_gettimeofday(&(mlc->instart)); | 556 | do_gettimeofday(&(mlc->instart)); |
557 | mlc->icount = 15; | 557 | mlc->icount = 15; |
558 | memset(mlc->ipacket, 0, 16 * sizeof(hil_packet)); | 558 | memset(mlc->ipacket, 0, 16 * sizeof(hil_packet)); |
559 | if (down_trylock(&(mlc->isem))) BUG(); | 559 | BUG_ON(down_trylock(&(mlc->isem))); |
560 | 560 | ||
561 | return; | 561 | return; |
562 | } | 562 | } |
diff --git a/drivers/input/serio/hp_sdc_mlc.c b/drivers/input/serio/hp_sdc_mlc.c index 1c9426fd5205..aa4a8a4ccfdb 100644 --- a/drivers/input/serio/hp_sdc_mlc.c +++ b/drivers/input/serio/hp_sdc_mlc.c | |||
@@ -270,9 +270,10 @@ static void hp_sdc_mlc_out (hil_mlc *mlc) { | |||
270 | 270 | ||
271 | do_control: | 271 | do_control: |
272 | priv->emtestmode = mlc->opacket & HIL_CTRL_TEST; | 272 | priv->emtestmode = mlc->opacket & HIL_CTRL_TEST; |
273 | if ((mlc->opacket & (HIL_CTRL_APE | HIL_CTRL_IPF)) == HIL_CTRL_APE) { | 273 | |
274 | BUG(); /* we cannot emulate this, it should not be used. */ | 274 | /* we cannot emulate this, it should not be used. */ |
275 | } | 275 | BUG_ON((mlc->opacket & (HIL_CTRL_APE | HIL_CTRL_IPF)) == HIL_CTRL_APE); |
276 | |||
276 | if ((mlc->opacket & HIL_CTRL_ONLY) == HIL_CTRL_ONLY) goto control_only; | 277 | if ((mlc->opacket & HIL_CTRL_ONLY) == HIL_CTRL_ONLY) goto control_only; |
277 | if (mlc->opacket & HIL_CTRL_APE) { | 278 | if (mlc->opacket & HIL_CTRL_APE) { |
278 | BUG(); /* Should not send command/data after engaging APE */ | 279 | BUG(); /* Should not send command/data after engaging APE */ |
diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c index 8c12a974b411..46d1fec2cfd8 100644 --- a/drivers/input/touchscreen/ads7846.c +++ b/drivers/input/touchscreen/ads7846.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/slab.h> | 23 | #include <linux/slab.h> |
24 | #include <linux/spi/spi.h> | 24 | #include <linux/spi/spi.h> |
25 | #include <linux/spi/ads7846.h> | 25 | #include <linux/spi/ads7846.h> |
26 | #include <asm/irq.h> | ||
26 | 27 | ||
27 | #ifdef CONFIG_ARM | 28 | #ifdef CONFIG_ARM |
28 | #include <asm/mach-types.h> | 29 | #include <asm/mach-types.h> |