aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/serio/hil_mlc.c
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2007-02-28 23:51:19 -0500
committerDmitry Torokhov <dtor@insightbb.com>2007-02-28 23:51:19 -0500
commit3acaf540a33199141695f2e2fcfa8829053159bf (patch)
tree8cc083df919078ec15665cfc34bc977f6996e939 /drivers/input/serio/hil_mlc.c
parent969111e900226a8dbd1f596f34c09eecd20afc7d (diff)
Input: HIL - various fixes for HIL drivers
- mark some structures const or __read_mostly - hilkbd.c: fix uninitialized spinlock in HIL keyboard driver - hil_mlc.c: use USEC_PER_SEC instead of 1000000 - hp_sdc: bugfix for request_irq()/free_irq() parameters, this prevented multiple load/unload cycles as module Signed-off-by: Helge Deller <deller@gmx.de> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/serio/hil_mlc.c')
-rw-r--r--drivers/input/serio/hil_mlc.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/input/serio/hil_mlc.c b/drivers/input/serio/hil_mlc.c
index 4fa93ff30919..0710704d2fd3 100644
--- a/drivers/input/serio/hil_mlc.c
+++ b/drivers/input/serio/hil_mlc.c
@@ -408,7 +408,7 @@ static int hilse_operate(hil_mlc *mlc, int repoll) {
408#define OUT_LAST(pack) \ 408#define OUT_LAST(pack) \
409{ HILSE_OUT_LAST, { .packet = pack }, 0, 0, 0, 0 }, 409{ HILSE_OUT_LAST, { .packet = pack }, 0, 0, 0, 0 },
410 410
411struct hilse_node hil_mlc_se[HILSEN_END] = { 411const struct hilse_node hil_mlc_se[HILSEN_END] = {
412 412
413 /* 0 HILSEN_START */ 413 /* 0 HILSEN_START */
414 FUNC(hilse_init_lcv, 0, HILSEN_NEXT, HILSEN_SLEEP, 0) 414 FUNC(hilse_init_lcv, 0, HILSEN_NEXT, HILSEN_SLEEP, 0)
@@ -530,7 +530,7 @@ struct hilse_node hil_mlc_se[HILSEN_END] = {
530 /* 60 HILSEN_END */ 530 /* 60 HILSEN_END */
531}; 531};
532 532
533static inline void hilse_setup_input(hil_mlc *mlc, struct hilse_node *node) { 533static inline void hilse_setup_input(hil_mlc *mlc, const struct hilse_node *node) {
534 534
535 switch (node->act) { 535 switch (node->act) {
536 case HILSE_EXPECT_DISC: 536 case HILSE_EXPECT_DISC:
@@ -563,21 +563,19 @@ static inline void hilse_setup_input(hil_mlc *mlc, struct hilse_node *node) {
563#ifdef HIL_MLC_DEBUG 563#ifdef HIL_MLC_DEBUG
564static int doze = 0; 564static int doze = 0;
565static int seidx; /* For debug */ 565static int seidx; /* For debug */
566static int kick = 1;
567#endif 566#endif
568 567
569static int hilse_donode (hil_mlc *mlc) { 568static int hilse_donode (hil_mlc *mlc) {
570 struct hilse_node *node; 569 const struct hilse_node *node;
571 int nextidx = 0; 570 int nextidx = 0;
572 int sched_long = 0; 571 int sched_long = 0;
573 unsigned long flags; 572 unsigned long flags;
574 573
575#ifdef HIL_MLC_DEBUG 574#ifdef HIL_MLC_DEBUG
576 if (mlc->seidx && (mlc->seidx != seidx) && mlc->seidx != 41 && mlc->seidx != 42 && mlc->seidx != 43) { 575 if (mlc->seidx && (mlc->seidx != seidx) && mlc->seidx != 41 && mlc->seidx != 42 && mlc->seidx != 43) {
577 printk(KERN_DEBUG PREFIX "z%i \n%s {%i}", doze, kick ? "K" : "", mlc->seidx); 576 printk(KERN_DEBUG PREFIX "z%i \n {%i}", doze, mlc->seidx);
578 doze = 0; 577 doze = 0;
579 } 578 }
580 kick = 0;
581 579
582 seidx = mlc->seidx; 580 seidx = mlc->seidx;
583#endif 581#endif
@@ -588,7 +586,7 @@ static int hilse_donode (hil_mlc *mlc) {
588 hil_packet pack; 586 hil_packet pack;
589 587
590 case HILSE_FUNC: 588 case HILSE_FUNC:
591 if (node->object.func == NULL) break; 589 BUG_ON(node->object.func == NULL);
592 rc = node->object.func(mlc, node->arg); 590 rc = node->object.func(mlc, node->arg);
593 nextidx = (rc > 0) ? node->ugly : 591 nextidx = (rc > 0) ? node->ugly :
594 ((rc < 0) ? node->bad : node->good); 592 ((rc < 0) ? node->bad : node->good);
@@ -674,10 +672,10 @@ static int hilse_donode (hil_mlc *mlc) {
674 if (!sched_long) goto sched; 672 if (!sched_long) goto sched;
675 673
676 do_gettimeofday(&tv); 674 do_gettimeofday(&tv);
677 tv.tv_usec += 1000000 * (tv.tv_sec - mlc->instart.tv_sec); 675 tv.tv_usec += USEC_PER_SEC * (tv.tv_sec - mlc->instart.tv_sec);
678 tv.tv_usec -= mlc->instart.tv_usec; 676 tv.tv_usec -= mlc->instart.tv_usec;
679 if (tv.tv_usec >= mlc->intimeout) goto sched; 677 if (tv.tv_usec >= mlc->intimeout) goto sched;
680 tv.tv_usec = (mlc->intimeout - tv.tv_usec) * HZ / 1000000; 678 tv.tv_usec = (mlc->intimeout - tv.tv_usec) * HZ / USEC_PER_SEC;
681 if (!tv.tv_usec) goto sched; 679 if (!tv.tv_usec) goto sched;
682 mod_timer(&hil_mlcs_kicker, jiffies + tv.tv_usec); 680 mod_timer(&hil_mlcs_kicker, jiffies + tv.tv_usec);
683 break; 681 break;
@@ -837,7 +835,7 @@ static void hil_mlc_serio_close(struct serio *serio) {
837 /* TODO wake up interruptable */ 835 /* TODO wake up interruptable */
838} 836}
839 837
840static struct serio_device_id hil_mlc_serio_id = { 838static const struct serio_device_id hil_mlc_serio_id = {
841 .type = SERIO_HIL_MLC, 839 .type = SERIO_HIL_MLC,
842 .proto = SERIO_HIL, 840 .proto = SERIO_HIL,
843 .extra = SERIO_ANY, 841 .extra = SERIO_ANY,
@@ -873,6 +871,8 @@ int hil_mlc_register(hil_mlc *mlc) {
873 hil_mlc_copy_di_scratch(mlc, i); 871 hil_mlc_copy_di_scratch(mlc, i);
874 mlc_serio = kzalloc(sizeof(*mlc_serio), GFP_KERNEL); 872 mlc_serio = kzalloc(sizeof(*mlc_serio), GFP_KERNEL);
875 mlc->serio[i] = mlc_serio; 873 mlc->serio[i] = mlc_serio;
874 snprintf(mlc_serio->name, sizeof(mlc_serio->name)-1, "HIL_SERIO%d", i);
875 snprintf(mlc_serio->phys, sizeof(mlc_serio->phys)-1, "HIL%d", i);
876 mlc_serio->id = hil_mlc_serio_id; 876 mlc_serio->id = hil_mlc_serio_id;
877 mlc_serio->write = hil_mlc_serio_write; 877 mlc_serio->write = hil_mlc_serio_write;
878 mlc_serio->open = hil_mlc_serio_open; 878 mlc_serio->open = hil_mlc_serio_open;