diff options
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/dell-wmi.c | 16 | ||||
-rw-r--r-- | drivers/platform/x86/hp-wmi.c | 15 | ||||
-rw-r--r-- | drivers/platform/x86/panasonic-laptop.c | 15 | ||||
-rw-r--r-- | drivers/platform/x86/sony-laptop.c | 91 | ||||
-rw-r--r-- | drivers/platform/x86/thinkpad_acpi.c | 4 | ||||
-rw-r--r-- | drivers/platform/x86/topstar-laptop.c | 13 | ||||
-rw-r--r-- | drivers/platform/x86/toshiba_acpi.c | 17 |
7 files changed, 83 insertions, 88 deletions
diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c index 1b1dddbd5744..bed764e3ea2a 100644 --- a/drivers/platform/x86/dell-wmi.c +++ b/drivers/platform/x86/dell-wmi.c | |||
@@ -142,7 +142,7 @@ static struct key_entry *dell_wmi_keymap = dell_legacy_wmi_keymap; | |||
142 | 142 | ||
143 | static struct input_dev *dell_wmi_input_dev; | 143 | static struct input_dev *dell_wmi_input_dev; |
144 | 144 | ||
145 | static struct key_entry *dell_wmi_get_entry_by_scancode(int code) | 145 | static struct key_entry *dell_wmi_get_entry_by_scancode(unsigned int code) |
146 | { | 146 | { |
147 | struct key_entry *key; | 147 | struct key_entry *key; |
148 | 148 | ||
@@ -153,7 +153,7 @@ static struct key_entry *dell_wmi_get_entry_by_scancode(int code) | |||
153 | return NULL; | 153 | return NULL; |
154 | } | 154 | } |
155 | 155 | ||
156 | static struct key_entry *dell_wmi_get_entry_by_keycode(int keycode) | 156 | static struct key_entry *dell_wmi_get_entry_by_keycode(unsigned int keycode) |
157 | { | 157 | { |
158 | struct key_entry *key; | 158 | struct key_entry *key; |
159 | 159 | ||
@@ -164,8 +164,8 @@ static struct key_entry *dell_wmi_get_entry_by_keycode(int keycode) | |||
164 | return NULL; | 164 | return NULL; |
165 | } | 165 | } |
166 | 166 | ||
167 | static int dell_wmi_getkeycode(struct input_dev *dev, int scancode, | 167 | static int dell_wmi_getkeycode(struct input_dev *dev, |
168 | int *keycode) | 168 | unsigned int scancode, unsigned int *keycode) |
169 | { | 169 | { |
170 | struct key_entry *key = dell_wmi_get_entry_by_scancode(scancode); | 170 | struct key_entry *key = dell_wmi_get_entry_by_scancode(scancode); |
171 | 171 | ||
@@ -177,13 +177,11 @@ static int dell_wmi_getkeycode(struct input_dev *dev, int scancode, | |||
177 | return -EINVAL; | 177 | return -EINVAL; |
178 | } | 178 | } |
179 | 179 | ||
180 | static int dell_wmi_setkeycode(struct input_dev *dev, int scancode, int keycode) | 180 | static int dell_wmi_setkeycode(struct input_dev *dev, |
181 | unsigned int scancode, unsigned int keycode) | ||
181 | { | 182 | { |
182 | struct key_entry *key; | 183 | struct key_entry *key; |
183 | int old_keycode; | 184 | unsigned int old_keycode; |
184 | |||
185 | if (keycode < 0 || keycode > KEY_MAX) | ||
186 | return -EINVAL; | ||
187 | 185 | ||
188 | key = dell_wmi_get_entry_by_scancode(scancode); | 186 | key = dell_wmi_get_entry_by_scancode(scancode); |
189 | if (key && key->type == KE_KEY) { | 187 | if (key && key->type == KE_KEY) { |
diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c index 7ccf33c08967..56086363becc 100644 --- a/drivers/platform/x86/hp-wmi.c +++ b/drivers/platform/x86/hp-wmi.c | |||
@@ -278,7 +278,7 @@ static DEVICE_ATTR(als, S_IRUGO | S_IWUSR, show_als, set_als); | |||
278 | static DEVICE_ATTR(dock, S_IRUGO, show_dock, NULL); | 278 | static DEVICE_ATTR(dock, S_IRUGO, show_dock, NULL); |
279 | static DEVICE_ATTR(tablet, S_IRUGO, show_tablet, NULL); | 279 | static DEVICE_ATTR(tablet, S_IRUGO, show_tablet, NULL); |
280 | 280 | ||
281 | static struct key_entry *hp_wmi_get_entry_by_scancode(int code) | 281 | static struct key_entry *hp_wmi_get_entry_by_scancode(unsigned int code) |
282 | { | 282 | { |
283 | struct key_entry *key; | 283 | struct key_entry *key; |
284 | 284 | ||
@@ -289,7 +289,7 @@ static struct key_entry *hp_wmi_get_entry_by_scancode(int code) | |||
289 | return NULL; | 289 | return NULL; |
290 | } | 290 | } |
291 | 291 | ||
292 | static struct key_entry *hp_wmi_get_entry_by_keycode(int keycode) | 292 | static struct key_entry *hp_wmi_get_entry_by_keycode(unsigned int keycode) |
293 | { | 293 | { |
294 | struct key_entry *key; | 294 | struct key_entry *key; |
295 | 295 | ||
@@ -300,7 +300,8 @@ static struct key_entry *hp_wmi_get_entry_by_keycode(int keycode) | |||
300 | return NULL; | 300 | return NULL; |
301 | } | 301 | } |
302 | 302 | ||
303 | static int hp_wmi_getkeycode(struct input_dev *dev, int scancode, int *keycode) | 303 | static int hp_wmi_getkeycode(struct input_dev *dev, |
304 | unsigned int scancode, unsigned int *keycode) | ||
304 | { | 305 | { |
305 | struct key_entry *key = hp_wmi_get_entry_by_scancode(scancode); | 306 | struct key_entry *key = hp_wmi_get_entry_by_scancode(scancode); |
306 | 307 | ||
@@ -312,13 +313,11 @@ static int hp_wmi_getkeycode(struct input_dev *dev, int scancode, int *keycode) | |||
312 | return -EINVAL; | 313 | return -EINVAL; |
313 | } | 314 | } |
314 | 315 | ||
315 | static int hp_wmi_setkeycode(struct input_dev *dev, int scancode, int keycode) | 316 | static int hp_wmi_setkeycode(struct input_dev *dev, |
317 | unsigned int scancode, unsigned int keycode) | ||
316 | { | 318 | { |
317 | struct key_entry *key; | 319 | struct key_entry *key; |
318 | int old_keycode; | 320 | unsigned int old_keycode; |
319 | |||
320 | if (keycode < 0 || keycode > KEY_MAX) | ||
321 | return -EINVAL; | ||
322 | 321 | ||
323 | key = hp_wmi_get_entry_by_scancode(scancode); | 322 | key = hp_wmi_get_entry_by_scancode(scancode); |
324 | if (key && key->type == KE_KEY) { | 323 | if (key && key->type == KE_KEY) { |
diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c index fe7cf0188acc..c9fc479fc290 100644 --- a/drivers/platform/x86/panasonic-laptop.c +++ b/drivers/platform/x86/panasonic-laptop.c | |||
@@ -200,7 +200,7 @@ static struct acpi_driver acpi_pcc_driver = { | |||
200 | }; | 200 | }; |
201 | 201 | ||
202 | #define KEYMAP_SIZE 11 | 202 | #define KEYMAP_SIZE 11 |
203 | static const int initial_keymap[KEYMAP_SIZE] = { | 203 | static const unsigned int initial_keymap[KEYMAP_SIZE] = { |
204 | /* 0 */ KEY_RESERVED, | 204 | /* 0 */ KEY_RESERVED, |
205 | /* 1 */ KEY_BRIGHTNESSDOWN, | 205 | /* 1 */ KEY_BRIGHTNESSDOWN, |
206 | /* 2 */ KEY_BRIGHTNESSUP, | 206 | /* 2 */ KEY_BRIGHTNESSUP, |
@@ -222,7 +222,7 @@ struct pcc_acpi { | |||
222 | struct acpi_device *device; | 222 | struct acpi_device *device; |
223 | struct input_dev *input_dev; | 223 | struct input_dev *input_dev; |
224 | struct backlight_device *backlight; | 224 | struct backlight_device *backlight; |
225 | int keymap[KEYMAP_SIZE]; | 225 | unsigned int keymap[KEYMAP_SIZE]; |
226 | }; | 226 | }; |
227 | 227 | ||
228 | struct pcc_keyinput { | 228 | struct pcc_keyinput { |
@@ -445,7 +445,8 @@ static struct attribute_group pcc_attr_group = { | |||
445 | 445 | ||
446 | /* hotkey input device driver */ | 446 | /* hotkey input device driver */ |
447 | 447 | ||
448 | static int pcc_getkeycode(struct input_dev *dev, int scancode, int *keycode) | 448 | static int pcc_getkeycode(struct input_dev *dev, |
449 | unsigned int scancode, unsigned int *keycode) | ||
449 | { | 450 | { |
450 | struct pcc_acpi *pcc = input_get_drvdata(dev); | 451 | struct pcc_acpi *pcc = input_get_drvdata(dev); |
451 | 452 | ||
@@ -457,7 +458,7 @@ static int pcc_getkeycode(struct input_dev *dev, int scancode, int *keycode) | |||
457 | return 0; | 458 | return 0; |
458 | } | 459 | } |
459 | 460 | ||
460 | static int keymap_get_by_keycode(struct pcc_acpi *pcc, int keycode) | 461 | static int keymap_get_by_keycode(struct pcc_acpi *pcc, unsigned int keycode) |
461 | { | 462 | { |
462 | int i; | 463 | int i; |
463 | 464 | ||
@@ -469,7 +470,8 @@ static int keymap_get_by_keycode(struct pcc_acpi *pcc, int keycode) | |||
469 | return 0; | 470 | return 0; |
470 | } | 471 | } |
471 | 472 | ||
472 | static int pcc_setkeycode(struct input_dev *dev, int scancode, int keycode) | 473 | static int pcc_setkeycode(struct input_dev *dev, |
474 | unsigned int scancode, unsigned int keycode) | ||
473 | { | 475 | { |
474 | struct pcc_acpi *pcc = input_get_drvdata(dev); | 476 | struct pcc_acpi *pcc = input_get_drvdata(dev); |
475 | int oldkeycode; | 477 | int oldkeycode; |
@@ -477,9 +479,6 @@ static int pcc_setkeycode(struct input_dev *dev, int scancode, int keycode) | |||
477 | if (scancode >= ARRAY_SIZE(pcc->keymap)) | 479 | if (scancode >= ARRAY_SIZE(pcc->keymap)) |
478 | return -EINVAL; | 480 | return -EINVAL; |
479 | 481 | ||
480 | if (keycode < 0 || keycode > KEY_MAX) | ||
481 | return -EINVAL; | ||
482 | |||
483 | oldkeycode = pcc->keymap[scancode]; | 482 | oldkeycode = pcc->keymap[scancode]; |
484 | pcc->keymap[scancode] = keycode; | 483 | pcc->keymap[scancode] = keycode; |
485 | 484 | ||
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c index 3f71a605a492..5a3d8514c66d 100644 --- a/drivers/platform/x86/sony-laptop.c +++ b/drivers/platform/x86/sony-laptop.c | |||
@@ -145,7 +145,7 @@ struct sony_laptop_input_s { | |||
145 | struct input_dev *key_dev; | 145 | struct input_dev *key_dev; |
146 | struct kfifo fifo; | 146 | struct kfifo fifo; |
147 | spinlock_t fifo_lock; | 147 | spinlock_t fifo_lock; |
148 | struct workqueue_struct *wq; | 148 | struct timer_list release_key_timer; |
149 | }; | 149 | }; |
150 | 150 | ||
151 | static struct sony_laptop_input_s sony_laptop_input = { | 151 | static struct sony_laptop_input_s sony_laptop_input = { |
@@ -299,20 +299,26 @@ static int sony_laptop_input_keycode_map[] = { | |||
299 | }; | 299 | }; |
300 | 300 | ||
301 | /* release buttons after a short delay if pressed */ | 301 | /* release buttons after a short delay if pressed */ |
302 | static void do_sony_laptop_release_key(struct work_struct *work) | 302 | static void do_sony_laptop_release_key(unsigned long unused) |
303 | { | 303 | { |
304 | struct sony_laptop_keypress kp; | 304 | struct sony_laptop_keypress kp; |
305 | unsigned long flags; | ||
306 | |||
307 | spin_lock_irqsave(&sony_laptop_input.fifo_lock, flags); | ||
305 | 308 | ||
306 | while (kfifo_out_locked(&sony_laptop_input.fifo, (unsigned char *)&kp, | 309 | if (kfifo_out(&sony_laptop_input.fifo, |
307 | sizeof(kp), &sony_laptop_input.fifo_lock) | 310 | (unsigned char *)&kp, sizeof(kp)) == sizeof(kp)) { |
308 | == sizeof(kp)) { | ||
309 | msleep(10); | ||
310 | input_report_key(kp.dev, kp.key, 0); | 311 | input_report_key(kp.dev, kp.key, 0); |
311 | input_sync(kp.dev); | 312 | input_sync(kp.dev); |
312 | } | 313 | } |
314 | |||
315 | /* If there is something in the fifo schedule next release. */ | ||
316 | if (kfifo_len(&sony_laptop_input.fifo) != 0) | ||
317 | mod_timer(&sony_laptop_input.release_key_timer, | ||
318 | jiffies + msecs_to_jiffies(10)); | ||
319 | |||
320 | spin_unlock_irqrestore(&sony_laptop_input.fifo_lock, flags); | ||
313 | } | 321 | } |
314 | static DECLARE_WORK(sony_laptop_release_key_work, | ||
315 | do_sony_laptop_release_key); | ||
316 | 322 | ||
317 | /* forward event to the input subsystem */ | 323 | /* forward event to the input subsystem */ |
318 | static void sony_laptop_report_input_event(u8 event) | 324 | static void sony_laptop_report_input_event(u8 event) |
@@ -366,13 +372,13 @@ static void sony_laptop_report_input_event(u8 event) | |||
366 | /* we emit the scancode so we can always remap the key */ | 372 | /* we emit the scancode so we can always remap the key */ |
367 | input_event(kp.dev, EV_MSC, MSC_SCAN, event); | 373 | input_event(kp.dev, EV_MSC, MSC_SCAN, event); |
368 | input_sync(kp.dev); | 374 | input_sync(kp.dev); |
369 | kfifo_in_locked(&sony_laptop_input.fifo, | ||
370 | (unsigned char *)&kp, sizeof(kp), | ||
371 | &sony_laptop_input.fifo_lock); | ||
372 | 375 | ||
373 | if (!work_pending(&sony_laptop_release_key_work)) | 376 | /* schedule key release */ |
374 | queue_work(sony_laptop_input.wq, | 377 | kfifo_in_locked(&sony_laptop_input.fifo, |
375 | &sony_laptop_release_key_work); | 378 | (unsigned char *)&kp, sizeof(kp), |
379 | &sony_laptop_input.fifo_lock); | ||
380 | mod_timer(&sony_laptop_input.release_key_timer, | ||
381 | jiffies + msecs_to_jiffies(10)); | ||
376 | } else | 382 | } else |
377 | dprintk("unknown input event %.2x\n", event); | 383 | dprintk("unknown input event %.2x\n", event); |
378 | } | 384 | } |
@@ -390,27 +396,21 @@ static int sony_laptop_setup_input(struct acpi_device *acpi_device) | |||
390 | 396 | ||
391 | /* kfifo */ | 397 | /* kfifo */ |
392 | spin_lock_init(&sony_laptop_input.fifo_lock); | 398 | spin_lock_init(&sony_laptop_input.fifo_lock); |
393 | error = | 399 | error = kfifo_alloc(&sony_laptop_input.fifo, |
394 | kfifo_alloc(&sony_laptop_input.fifo, SONY_LAPTOP_BUF_SIZE, GFP_KERNEL); | 400 | SONY_LAPTOP_BUF_SIZE, GFP_KERNEL); |
395 | if (error) { | 401 | if (error) { |
396 | printk(KERN_ERR DRV_PFX "kfifo_alloc failed\n"); | 402 | printk(KERN_ERR DRV_PFX "kfifo_alloc failed\n"); |
397 | goto err_dec_users; | 403 | goto err_dec_users; |
398 | } | 404 | } |
399 | 405 | ||
400 | /* init workqueue */ | 406 | setup_timer(&sony_laptop_input.release_key_timer, |
401 | sony_laptop_input.wq = create_singlethread_workqueue("sony-laptop"); | 407 | do_sony_laptop_release_key, 0); |
402 | if (!sony_laptop_input.wq) { | ||
403 | printk(KERN_ERR DRV_PFX | ||
404 | "Unable to create workqueue.\n"); | ||
405 | error = -ENXIO; | ||
406 | goto err_free_kfifo; | ||
407 | } | ||
408 | 408 | ||
409 | /* input keys */ | 409 | /* input keys */ |
410 | key_dev = input_allocate_device(); | 410 | key_dev = input_allocate_device(); |
411 | if (!key_dev) { | 411 | if (!key_dev) { |
412 | error = -ENOMEM; | 412 | error = -ENOMEM; |
413 | goto err_destroy_wq; | 413 | goto err_free_kfifo; |
414 | } | 414 | } |
415 | 415 | ||
416 | key_dev->name = "Sony Vaio Keys"; | 416 | key_dev->name = "Sony Vaio Keys"; |
@@ -419,18 +419,15 @@ static int sony_laptop_setup_input(struct acpi_device *acpi_device) | |||
419 | key_dev->dev.parent = &acpi_device->dev; | 419 | key_dev->dev.parent = &acpi_device->dev; |
420 | 420 | ||
421 | /* Initialize the Input Drivers: special keys */ | 421 | /* Initialize the Input Drivers: special keys */ |
422 | set_bit(EV_KEY, key_dev->evbit); | 422 | input_set_capability(key_dev, EV_MSC, MSC_SCAN); |
423 | set_bit(EV_MSC, key_dev->evbit); | 423 | |
424 | set_bit(MSC_SCAN, key_dev->mscbit); | 424 | __set_bit(EV_KEY, key_dev->evbit); |
425 | key_dev->keycodesize = sizeof(sony_laptop_input_keycode_map[0]); | 425 | key_dev->keycodesize = sizeof(sony_laptop_input_keycode_map[0]); |
426 | key_dev->keycodemax = ARRAY_SIZE(sony_laptop_input_keycode_map); | 426 | key_dev->keycodemax = ARRAY_SIZE(sony_laptop_input_keycode_map); |
427 | key_dev->keycode = &sony_laptop_input_keycode_map; | 427 | key_dev->keycode = &sony_laptop_input_keycode_map; |
428 | for (i = 0; i < ARRAY_SIZE(sony_laptop_input_keycode_map); i++) { | 428 | for (i = 0; i < ARRAY_SIZE(sony_laptop_input_keycode_map); i++) |
429 | if (sony_laptop_input_keycode_map[i] != KEY_RESERVED) { | 429 | __set_bit(sony_laptop_input_keycode_map[i], key_dev->keybit); |
430 | set_bit(sony_laptop_input_keycode_map[i], | 430 | __clear_bit(KEY_RESERVED, key_dev->keybit); |
431 | key_dev->keybit); | ||
432 | } | ||
433 | } | ||
434 | 431 | ||
435 | error = input_register_device(key_dev); | 432 | error = input_register_device(key_dev); |
436 | if (error) | 433 | if (error) |
@@ -450,9 +447,8 @@ static int sony_laptop_setup_input(struct acpi_device *acpi_device) | |||
450 | jog_dev->id.vendor = PCI_VENDOR_ID_SONY; | 447 | jog_dev->id.vendor = PCI_VENDOR_ID_SONY; |
451 | key_dev->dev.parent = &acpi_device->dev; | 448 | key_dev->dev.parent = &acpi_device->dev; |
452 | 449 | ||
453 | jog_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL); | 450 | input_set_capability(jog_dev, EV_KEY, BTN_MIDDLE); |
454 | jog_dev->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_MIDDLE); | 451 | input_set_capability(jog_dev, EV_REL, REL_WHEEL); |
455 | jog_dev->relbit[0] = BIT_MASK(REL_WHEEL); | ||
456 | 452 | ||
457 | error = input_register_device(jog_dev); | 453 | error = input_register_device(jog_dev); |
458 | if (error) | 454 | if (error) |
@@ -473,9 +469,6 @@ err_unregister_keydev: | |||
473 | err_free_keydev: | 469 | err_free_keydev: |
474 | input_free_device(key_dev); | 470 | input_free_device(key_dev); |
475 | 471 | ||
476 | err_destroy_wq: | ||
477 | destroy_workqueue(sony_laptop_input.wq); | ||
478 | |||
479 | err_free_kfifo: | 472 | err_free_kfifo: |
480 | kfifo_free(&sony_laptop_input.fifo); | 473 | kfifo_free(&sony_laptop_input.fifo); |
481 | 474 | ||
@@ -486,12 +479,23 @@ err_dec_users: | |||
486 | 479 | ||
487 | static void sony_laptop_remove_input(void) | 480 | static void sony_laptop_remove_input(void) |
488 | { | 481 | { |
489 | /* cleanup only after the last user has gone */ | 482 | struct sony_laptop_keypress kp = { NULL }; |
483 | |||
484 | /* Cleanup only after the last user has gone */ | ||
490 | if (!atomic_dec_and_test(&sony_laptop_input.users)) | 485 | if (!atomic_dec_and_test(&sony_laptop_input.users)) |
491 | return; | 486 | return; |
492 | 487 | ||
493 | /* flush workqueue first */ | 488 | del_timer_sync(&sony_laptop_input.release_key_timer); |
494 | flush_workqueue(sony_laptop_input.wq); | 489 | |
490 | /* | ||
491 | * Generate key-up events for remaining keys. Note that we don't | ||
492 | * need locking since nobody is adding new events to the kfifo. | ||
493 | */ | ||
494 | while (kfifo_out(&sony_laptop_input.fifo, | ||
495 | (unsigned char *)&kp, sizeof(kp)) == sizeof(kp)) { | ||
496 | input_report_key(kp.dev, kp.key, 0); | ||
497 | input_sync(kp.dev); | ||
498 | } | ||
495 | 499 | ||
496 | /* destroy input devs */ | 500 | /* destroy input devs */ |
497 | input_unregister_device(sony_laptop_input.key_dev); | 501 | input_unregister_device(sony_laptop_input.key_dev); |
@@ -502,7 +506,6 @@ static void sony_laptop_remove_input(void) | |||
502 | sony_laptop_input.jog_dev = NULL; | 506 | sony_laptop_input.jog_dev = NULL; |
503 | } | 507 | } |
504 | 508 | ||
505 | destroy_workqueue(sony_laptop_input.wq); | ||
506 | kfifo_free(&sony_laptop_input.fifo); | 509 | kfifo_free(&sony_laptop_input.fifo); |
507 | } | 510 | } |
508 | 511 | ||
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index e7b0c3bcef89..c64e3528889b 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c | |||
@@ -1668,7 +1668,7 @@ static void tpacpi_remove_driver_attributes(struct device_driver *drv) | |||
1668 | * Table of recommended minimum BIOS versions | 1668 | * Table of recommended minimum BIOS versions |
1669 | * | 1669 | * |
1670 | * Reasons for listing: | 1670 | * Reasons for listing: |
1671 | * 1. Stable BIOS, listed because the unknown ammount of | 1671 | * 1. Stable BIOS, listed because the unknown amount of |
1672 | * bugs and bad ACPI behaviour on older versions | 1672 | * bugs and bad ACPI behaviour on older versions |
1673 | * | 1673 | * |
1674 | * 2. BIOS or EC fw with known bugs that trigger on Linux | 1674 | * 2. BIOS or EC fw with known bugs that trigger on Linux |
@@ -7108,7 +7108,7 @@ static struct ibm_struct volume_driver_data = { | |||
7108 | * | 7108 | * |
7109 | * Fan speed changes of any sort (including those caused by the | 7109 | * Fan speed changes of any sort (including those caused by the |
7110 | * disengaged mode) are usually done slowly by the firmware as the | 7110 | * disengaged mode) are usually done slowly by the firmware as the |
7111 | * maximum ammount of fan duty cycle change per second seems to be | 7111 | * maximum amount of fan duty cycle change per second seems to be |
7112 | * limited. | 7112 | * limited. |
7113 | * | 7113 | * |
7114 | * Reading is not available if GFAN exists. | 7114 | * Reading is not available if GFAN exists. |
diff --git a/drivers/platform/x86/topstar-laptop.c b/drivers/platform/x86/topstar-laptop.c index 02f3d4e9e666..4d6516fded7e 100644 --- a/drivers/platform/x86/topstar-laptop.c +++ b/drivers/platform/x86/topstar-laptop.c | |||
@@ -46,7 +46,7 @@ static struct tps_key_entry topstar_keymap[] = { | |||
46 | { } | 46 | { } |
47 | }; | 47 | }; |
48 | 48 | ||
49 | static struct tps_key_entry *tps_get_key_by_scancode(int code) | 49 | static struct tps_key_entry *tps_get_key_by_scancode(unsigned int code) |
50 | { | 50 | { |
51 | struct tps_key_entry *key; | 51 | struct tps_key_entry *key; |
52 | 52 | ||
@@ -57,7 +57,7 @@ static struct tps_key_entry *tps_get_key_by_scancode(int code) | |||
57 | return NULL; | 57 | return NULL; |
58 | } | 58 | } |
59 | 59 | ||
60 | static struct tps_key_entry *tps_get_key_by_keycode(int code) | 60 | static struct tps_key_entry *tps_get_key_by_keycode(unsigned int code) |
61 | { | 61 | { |
62 | struct tps_key_entry *key; | 62 | struct tps_key_entry *key; |
63 | 63 | ||
@@ -126,7 +126,8 @@ static int acpi_topstar_fncx_switch(struct acpi_device *device, bool state) | |||
126 | return 0; | 126 | return 0; |
127 | } | 127 | } |
128 | 128 | ||
129 | static int topstar_getkeycode(struct input_dev *dev, int scancode, int *keycode) | 129 | static int topstar_getkeycode(struct input_dev *dev, |
130 | unsigned int scancode, unsigned int *keycode) | ||
130 | { | 131 | { |
131 | struct tps_key_entry *key = tps_get_key_by_scancode(scancode); | 132 | struct tps_key_entry *key = tps_get_key_by_scancode(scancode); |
132 | 133 | ||
@@ -137,14 +138,12 @@ static int topstar_getkeycode(struct input_dev *dev, int scancode, int *keycode) | |||
137 | return 0; | 138 | return 0; |
138 | } | 139 | } |
139 | 140 | ||
140 | static int topstar_setkeycode(struct input_dev *dev, int scancode, int keycode) | 141 | static int topstar_setkeycode(struct input_dev *dev, |
142 | unsigned int scancode, unsigned int keycode) | ||
141 | { | 143 | { |
142 | struct tps_key_entry *key; | 144 | struct tps_key_entry *key; |
143 | int old_keycode; | 145 | int old_keycode; |
144 | 146 | ||
145 | if (keycode < 0 || keycode > KEY_MAX) | ||
146 | return -EINVAL; | ||
147 | |||
148 | key = tps_get_key_by_scancode(scancode); | 147 | key = tps_get_key_by_scancode(scancode); |
149 | 148 | ||
150 | if (!key) | 149 | if (!key) |
diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c index 405b969734d6..789240d1b577 100644 --- a/drivers/platform/x86/toshiba_acpi.c +++ b/drivers/platform/x86/toshiba_acpi.c | |||
@@ -745,7 +745,7 @@ static struct backlight_ops toshiba_backlight_data = { | |||
745 | .update_status = set_lcd_status, | 745 | .update_status = set_lcd_status, |
746 | }; | 746 | }; |
747 | 747 | ||
748 | static struct key_entry *toshiba_acpi_get_entry_by_scancode(int code) | 748 | static struct key_entry *toshiba_acpi_get_entry_by_scancode(unsigned int code) |
749 | { | 749 | { |
750 | struct key_entry *key; | 750 | struct key_entry *key; |
751 | 751 | ||
@@ -756,7 +756,7 @@ static struct key_entry *toshiba_acpi_get_entry_by_scancode(int code) | |||
756 | return NULL; | 756 | return NULL; |
757 | } | 757 | } |
758 | 758 | ||
759 | static struct key_entry *toshiba_acpi_get_entry_by_keycode(int code) | 759 | static struct key_entry *toshiba_acpi_get_entry_by_keycode(unsigned int code) |
760 | { | 760 | { |
761 | struct key_entry *key; | 761 | struct key_entry *key; |
762 | 762 | ||
@@ -767,8 +767,8 @@ static struct key_entry *toshiba_acpi_get_entry_by_keycode(int code) | |||
767 | return NULL; | 767 | return NULL; |
768 | } | 768 | } |
769 | 769 | ||
770 | static int toshiba_acpi_getkeycode(struct input_dev *dev, int scancode, | 770 | static int toshiba_acpi_getkeycode(struct input_dev *dev, |
771 | int *keycode) | 771 | unsigned int scancode, unsigned int *keycode) |
772 | { | 772 | { |
773 | struct key_entry *key = toshiba_acpi_get_entry_by_scancode(scancode); | 773 | struct key_entry *key = toshiba_acpi_get_entry_by_scancode(scancode); |
774 | 774 | ||
@@ -780,14 +780,11 @@ static int toshiba_acpi_getkeycode(struct input_dev *dev, int scancode, | |||
780 | return -EINVAL; | 780 | return -EINVAL; |
781 | } | 781 | } |
782 | 782 | ||
783 | static int toshiba_acpi_setkeycode(struct input_dev *dev, int scancode, | 783 | static int toshiba_acpi_setkeycode(struct input_dev *dev, |
784 | int keycode) | 784 | unsigned int scancode, unsigned int keycode) |
785 | { | 785 | { |
786 | struct key_entry *key; | 786 | struct key_entry *key; |
787 | int old_keycode; | 787 | unsigned int old_keycode; |
788 | |||
789 | if (keycode < 0 || keycode > KEY_MAX) | ||
790 | return -EINVAL; | ||
791 | 788 | ||
792 | key = toshiba_acpi_get_entry_by_scancode(scancode); | 789 | key = toshiba_acpi_get_entry_by_scancode(scancode); |
793 | if (key && key->type == KE_KEY) { | 790 | if (key && key->type == KE_KEY) { |