aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard/lkkbd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/keyboard/lkkbd.c')
-rw-r--r--drivers/input/keyboard/lkkbd.c62
1 files changed, 32 insertions, 30 deletions
diff --git a/drivers/input/keyboard/lkkbd.c b/drivers/input/keyboard/lkkbd.c
index 4730ef35c73..f9847e0fb55 100644
--- a/drivers/input/keyboard/lkkbd.c
+++ b/drivers/input/keyboard/lkkbd.c
@@ -525,12 +525,12 @@ lkkbd_event (struct input_dev *dev, unsigned int type, unsigned int code,
525 CHECK_LED (lk, leds_on, leds_off, LED_SCROLLL, LK_LED_SCROLLLOCK); 525 CHECK_LED (lk, leds_on, leds_off, LED_SCROLLL, LK_LED_SCROLLLOCK);
526 CHECK_LED (lk, leds_on, leds_off, LED_SLEEP, LK_LED_WAIT); 526 CHECK_LED (lk, leds_on, leds_off, LED_SLEEP, LK_LED_WAIT);
527 if (leds_on != 0) { 527 if (leds_on != 0) {
528 lk->serio->write (lk->serio, LK_CMD_LED_ON); 528 serio_write (lk->serio, LK_CMD_LED_ON);
529 lk->serio->write (lk->serio, leds_on); 529 serio_write (lk->serio, leds_on);
530 } 530 }
531 if (leds_off != 0) { 531 if (leds_off != 0) {
532 lk->serio->write (lk->serio, LK_CMD_LED_OFF); 532 serio_write (lk->serio, LK_CMD_LED_OFF);
533 lk->serio->write (lk->serio, leds_off); 533 serio_write (lk->serio, leds_off);
534 } 534 }
535 return 0; 535 return 0;
536 536
@@ -539,20 +539,20 @@ lkkbd_event (struct input_dev *dev, unsigned int type, unsigned int code,
539 case SND_CLICK: 539 case SND_CLICK:
540 if (value == 0) { 540 if (value == 0) {
541 DBG ("%s: Deactivating key clicks\n", __func__); 541 DBG ("%s: Deactivating key clicks\n", __func__);
542 lk->serio->write (lk->serio, LK_CMD_DISABLE_KEYCLICK); 542 serio_write (lk->serio, LK_CMD_DISABLE_KEYCLICK);
543 lk->serio->write (lk->serio, LK_CMD_DISABLE_CTRCLICK); 543 serio_write (lk->serio, LK_CMD_DISABLE_CTRCLICK);
544 } else { 544 } else {
545 DBG ("%s: Activating key clicks\n", __func__); 545 DBG ("%s: Activating key clicks\n", __func__);
546 lk->serio->write (lk->serio, LK_CMD_ENABLE_KEYCLICK); 546 serio_write (lk->serio, LK_CMD_ENABLE_KEYCLICK);
547 lk->serio->write (lk->serio, volume_to_hw (lk->keyclick_volume)); 547 serio_write (lk->serio, volume_to_hw (lk->keyclick_volume));
548 lk->serio->write (lk->serio, LK_CMD_ENABLE_CTRCLICK); 548 serio_write (lk->serio, LK_CMD_ENABLE_CTRCLICK);
549 lk->serio->write (lk->serio, volume_to_hw (lk->ctrlclick_volume)); 549 serio_write (lk->serio, volume_to_hw (lk->ctrlclick_volume));
550 } 550 }
551 return 0; 551 return 0;
552 552
553 case SND_BELL: 553 case SND_BELL:
554 if (value != 0) 554 if (value != 0)
555 lk->serio->write (lk->serio, LK_CMD_SOUND_BELL); 555 serio_write (lk->serio, LK_CMD_SOUND_BELL);
556 556
557 return 0; 557 return 0;
558 } 558 }
@@ -579,10 +579,10 @@ lkkbd_reinit (struct work_struct *work)
579 unsigned char leds_off = 0; 579 unsigned char leds_off = 0;
580 580
581 /* Ask for ID */ 581 /* Ask for ID */
582 lk->serio->write (lk->serio, LK_CMD_REQUEST_ID); 582 serio_write (lk->serio, LK_CMD_REQUEST_ID);
583 583
584 /* Reset parameters */ 584 /* Reset parameters */
585 lk->serio->write (lk->serio, LK_CMD_SET_DEFAULTS); 585 serio_write (lk->serio, LK_CMD_SET_DEFAULTS);
586 586
587 /* Set LEDs */ 587 /* Set LEDs */
588 CHECK_LED (lk, leds_on, leds_off, LED_CAPSL, LK_LED_SHIFTLOCK); 588 CHECK_LED (lk, leds_on, leds_off, LED_CAPSL, LK_LED_SHIFTLOCK);
@@ -590,12 +590,12 @@ lkkbd_reinit (struct work_struct *work)
590 CHECK_LED (lk, leds_on, leds_off, LED_SCROLLL, LK_LED_SCROLLLOCK); 590 CHECK_LED (lk, leds_on, leds_off, LED_SCROLLL, LK_LED_SCROLLLOCK);
591 CHECK_LED (lk, leds_on, leds_off, LED_SLEEP, LK_LED_WAIT); 591 CHECK_LED (lk, leds_on, leds_off, LED_SLEEP, LK_LED_WAIT);
592 if (leds_on != 0) { 592 if (leds_on != 0) {
593 lk->serio->write (lk->serio, LK_CMD_LED_ON); 593 serio_write (lk->serio, LK_CMD_LED_ON);
594 lk->serio->write (lk->serio, leds_on); 594 serio_write (lk->serio, leds_on);
595 } 595 }
596 if (leds_off != 0) { 596 if (leds_off != 0) {
597 lk->serio->write (lk->serio, LK_CMD_LED_OFF); 597 serio_write (lk->serio, LK_CMD_LED_OFF);
598 lk->serio->write (lk->serio, leds_off); 598 serio_write (lk->serio, leds_off);
599 } 599 }
600 600
601 /* 601 /*
@@ -603,31 +603,31 @@ lkkbd_reinit (struct work_struct *work)
603 * only work with a LK401 keyboard and grants access to 603 * only work with a LK401 keyboard and grants access to
604 * LAlt, RAlt, RCompose and RShift. 604 * LAlt, RAlt, RCompose and RShift.
605 */ 605 */
606 lk->serio->write (lk->serio, LK_CMD_ENABLE_LK401); 606 serio_write (lk->serio, LK_CMD_ENABLE_LK401);
607 607
608 /* Set all keys to UPDOWN mode */ 608 /* Set all keys to UPDOWN mode */
609 for (division = 1; division <= 14; division++) 609 for (division = 1; division <= 14; division++)
610 lk->serio->write (lk->serio, LK_CMD_SET_MODE (LK_MODE_UPDOWN, 610 serio_write (lk->serio, LK_CMD_SET_MODE (LK_MODE_UPDOWN,
611 division)); 611 division));
612 612
613 /* Enable bell and set volume */ 613 /* Enable bell and set volume */
614 lk->serio->write (lk->serio, LK_CMD_ENABLE_BELL); 614 serio_write (lk->serio, LK_CMD_ENABLE_BELL);
615 lk->serio->write (lk->serio, volume_to_hw (lk->bell_volume)); 615 serio_write (lk->serio, volume_to_hw (lk->bell_volume));
616 616
617 /* Enable/disable keyclick (and possibly set volume) */ 617 /* Enable/disable keyclick (and possibly set volume) */
618 if (test_bit (SND_CLICK, lk->dev->snd)) { 618 if (test_bit (SND_CLICK, lk->dev->snd)) {
619 lk->serio->write (lk->serio, LK_CMD_ENABLE_KEYCLICK); 619 serio_write (lk->serio, LK_CMD_ENABLE_KEYCLICK);
620 lk->serio->write (lk->serio, volume_to_hw (lk->keyclick_volume)); 620 serio_write (lk->serio, volume_to_hw (lk->keyclick_volume));
621 lk->serio->write (lk->serio, LK_CMD_ENABLE_CTRCLICK); 621 serio_write (lk->serio, LK_CMD_ENABLE_CTRCLICK);
622 lk->serio->write (lk->serio, volume_to_hw (lk->ctrlclick_volume)); 622 serio_write (lk->serio, volume_to_hw (lk->ctrlclick_volume));
623 } else { 623 } else {
624 lk->serio->write (lk->serio, LK_CMD_DISABLE_KEYCLICK); 624 serio_write (lk->serio, LK_CMD_DISABLE_KEYCLICK);
625 lk->serio->write (lk->serio, LK_CMD_DISABLE_CTRCLICK); 625 serio_write (lk->serio, LK_CMD_DISABLE_CTRCLICK);
626 } 626 }
627 627
628 /* Sound the bell if needed */ 628 /* Sound the bell if needed */
629 if (test_bit (SND_BELL, lk->dev->snd)) 629 if (test_bit (SND_BELL, lk->dev->snd))
630 lk->serio->write (lk->serio, LK_CMD_SOUND_BELL); 630 serio_write (lk->serio, LK_CMD_SOUND_BELL);
631} 631}
632 632
633/* 633/*
@@ -684,8 +684,10 @@ lkkbd_connect (struct serio *serio, struct serio_driver *drv)
684 input_dev->keycode = lk->keycode; 684 input_dev->keycode = lk->keycode;
685 input_dev->keycodesize = sizeof (lk_keycode_t); 685 input_dev->keycodesize = sizeof (lk_keycode_t);
686 input_dev->keycodemax = LK_NUM_KEYCODES; 686 input_dev->keycodemax = LK_NUM_KEYCODES;
687
687 for (i = 0; i < LK_NUM_KEYCODES; i++) 688 for (i = 0; i < LK_NUM_KEYCODES; i++)
688 set_bit (lk->keycode[i], input_dev->keybit); 689 __set_bit (lk->keycode[i], input_dev->keybit);
690 __clear_bit(KEY_RESERVED, input_dev->keybit);
689 691
690 serio_set_drvdata (serio, lk); 692 serio_set_drvdata (serio, lk);
691 693
@@ -697,7 +699,7 @@ lkkbd_connect (struct serio *serio, struct serio_driver *drv)
697 if (err) 699 if (err)
698 goto fail3; 700 goto fail3;
699 701
700 lk->serio->write (lk->serio, LK_CMD_POWERCYCLE_RESET); 702 serio_write (lk->serio, LK_CMD_POWERCYCLE_RESET);
701 703
702 return 0; 704 return 0;
703 705