From: Jan-Benedict Glaw <jbglaw@lug-owl.de>
To: Dmitry Torokhov <dtor_core@ameritech.net>
Cc: linux-kernel@vger.kernel.org, Greg K-H <greg@kroah.com>
Subject: Re: [PATCH] drivers/input/keyboard: convert to dynamic input_dev allocation
Date: Sat, 29 Oct 2005 17:04:51 +0200 [thread overview]
Message-ID: <20051029150451.GV27184@lug-owl.de> (raw)
In-Reply-To: <200510290059.37135.dtor_core@ameritech.net>
[-- Attachment #1: Type: text/plain, Size: 5451 bytes --]
Hi Dmitry!
On Sat, 2005-10-29 00:59:36 -0500, Dmitry Torokhov <dtor_core@ameritech.net> wrote:
[...a patch I don't like]
Please use this patch instead:
Input: lkkbd - consolidate messages in lkkbd_interrup()
Signed-off-by: Jan-Benedict Glaw <jbglaw@lug-owl.de>
---
lkkbd.c | 99 ++++++++++++++++++++++++++++++++++++----------------------------
1 files changed, 57 insertions(+), 42 deletions(-)
diff --git a/drivers/input/keyboard/lkkbd.c b/drivers/input/keyboard/lkkbd.c
index 7f06780..f72a9ce 100644
--- a/drivers/input/keyboard/lkkbd.c
+++ b/drivers/input/keyboard/lkkbd.c
@@ -273,11 +273,11 @@ static lk_keycode_t lkkbd_keycode[LK_NUM
[0xfb] = KEY_APOSTROPHE,
};
-#define CHECK_LED(LED, BITS) do { \
- if (test_bit (LED, lk->dev->led)) \
- leds_on |= BITS; \
- else \
- leds_off |= BITS; \
+#define CHECK_LED(LK, VAR_ON, VAR_OFF, LED, BITS) do { \
+ if (test_bit (LED, (LK)->dev->led)) \
+ VAR_ON |= BITS; \
+ else \
+ VAR_OFF |= BITS; \
} while (0)
/*
@@ -299,6 +299,40 @@ struct lkkbd {
};
/*
+ * Responses from the keyboard and mapping back to their names.
+ */
+struct {
+ unsigned char value;
+ unsigned char *name;
+} lk_response[] = {
+#define RESPONSE(x) { .value = (x), .name = #x, }
+ RESPONSE (LK_STUCK_KEY),
+ RESPONSE (LK_SELFTEST_FAILED),
+ RESPONSE (LK_ALL_KEYS_UP),
+ RESPONSE (LK_METRONOME),
+ RESPONSE (LK_OUTPUT_ERROR),
+ RESPONSE (LK_INPUT_ERROR),
+ RESPONSE (LK_KBD_LOCKED),
+ RESPONSE (LK_KBD_TEST_MODE_ACK),
+ RESPONSE (LK_PREFIX_KEY_DOWN),
+ RESPONSE (LK_MODE_CHANGE_ACK),
+ RESPONSE (LK_RESPONSE_RESERVED),
+#undef RESPONSE
+};
+
+unsigned char *
+response_name (unsigned char value)
+{
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE (lk_response); i++)
+ if (lk_response[i].value == value)
+ return lk_response[i].name;
+
+ return "unknown";
+}
+
+/*
* Calculate volume parameter byte for a given volume.
*/
static unsigned char
@@ -440,43 +474,24 @@ lkkbd_interrupt (struct serio *serio, un
input_report_key (lk->dev, lk->keycode[i], 0);
input_sync (lk->dev);
break;
- case LK_METRONOME:
- DBG (KERN_INFO "Got %#d and don't "
- "know how to handle...\n");
+
+ case 0x01:
+ DBG (KERN_INFO "Got 0x01, scheduling re-initialization\n");
+ lk->ignore_bytes = LK_NUM_IGNORE_BYTES;
+ lk->id[LK_NUM_IGNORE_BYTES - lk->ignore_bytes--] = data;
+ schedule_work (&lk->tq);
break;
+
+ case LK_METRONOME:
case LK_OUTPUT_ERROR:
- DBG (KERN_INFO "Got LK_OUTPUT_ERROR and don't "
- "know how to handle...\n");
- break;
case LK_INPUT_ERROR:
- DBG (KERN_INFO "Got LK_INPUT_ERROR and don't "
- "know how to handle...\n");
- break;
case LK_KBD_LOCKED:
- DBG (KERN_INFO "Got LK_KBD_LOCKED and don't "
- "know how to handle...\n");
- break;
case LK_KBD_TEST_MODE_ACK:
- DBG (KERN_INFO "Got LK_KBD_TEST_MODE_ACK and don't "
- "know how to handle...\n");
- break;
case LK_PREFIX_KEY_DOWN:
- DBG (KERN_INFO "Got LK_PREFIX_KEY_DOWN and don't "
- "know how to handle...\n");
- break;
case LK_MODE_CHANGE_ACK:
- DBG (KERN_INFO "Got LK_MODE_CHANGE_ACK and ignored "
- "it properly...\n");
- break;
case LK_RESPONSE_RESERVED:
- DBG (KERN_INFO "Got LK_RESPONSE_RESERVED and don't "
- "know how to handle...\n");
- break;
- case 0x01:
- DBG (KERN_INFO "Got 0x01, scheduling re-initialization\n");
- lk->ignore_bytes = LK_NUM_IGNORE_BYTES;
- lk->id[LK_NUM_IGNORE_BYTES - lk->ignore_bytes--] = data;
- schedule_work (&lk->tq);
+ DBG (KERN_INFO "Got %s and don't know how to handle...\n",
+ response_name (data));
break;
default:
@@ -509,10 +524,10 @@ lkkbd_event (struct input_dev *dev, unsi
switch (type) {
case EV_LED:
- CHECK_LED (LED_CAPSL, LK_LED_SHIFTLOCK);
- CHECK_LED (LED_COMPOSE, LK_LED_COMPOSE);
- CHECK_LED (LED_SCROLLL, LK_LED_SCROLLLOCK);
- CHECK_LED (LED_SLEEP, LK_LED_WAIT);
+ CHECK_LED (lk, leds_on, leds_off, LED_CAPSL, LK_LED_SHIFTLOCK);
+ CHECK_LED (lk, leds_on, leds_off, LED_COMPOSE, LK_LED_COMPOSE);
+ CHECK_LED (lk, leds_on, leds_off, LED_SCROLLL, LK_LED_SCROLLLOCK);
+ CHECK_LED (lk, leds_on, leds_off, LED_SLEEP, LK_LED_WAIT);
if (leds_on != 0) {
lk->serio->write (lk->serio, LK_CMD_LED_ON);
lk->serio->write (lk->serio, leds_on);
@@ -574,10 +589,10 @@ lkkbd_reinit (void *data)
lk->serio->write (lk->serio, LK_CMD_SET_DEFAULTS);
/* Set LEDs */
- CHECK_LED (LED_CAPSL, LK_LED_SHIFTLOCK);
- CHECK_LED (LED_COMPOSE, LK_LED_COMPOSE);
- CHECK_LED (LED_SCROLLL, LK_LED_SCROLLLOCK);
- CHECK_LED (LED_SLEEP, LK_LED_WAIT);
+ CHECK_LED (lk, leds_on, leds_off, LED_CAPSL, LK_LED_SHIFTLOCK);
+ CHECK_LED (lk, leds_on, leds_off, LED_COMPOSE, LK_LED_COMPOSE);
+ CHECK_LED (lk, leds_on, leds_off, LED_SCROLLL, LK_LED_SCROLLLOCK);
+ CHECK_LED (lk, leds_on, leds_off, LED_SLEEP, LK_LED_WAIT);
if (leds_on != 0) {
lk->serio->write (lk->serio, LK_CMD_LED_ON);
lk->serio->write (lk->serio, leds_on);
Thanks, JBG
--
Jan-Benedict Glaw jbglaw@lug-owl.de . +49-172-7608481 _ O _
"Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg _ _ O
für einen Freien Staat voll Freier Bürger" | im Internet! | im Irak! O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2005-10-29 15:04 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-28 6:29 [GIT PATCH] Driver Core patches for 2.6.14 Greg KH
2005-10-28 6:30 ` [PATCH] aoe: update to version 14 Greg KH
2005-10-28 6:30 ` [PATCH] aoe: use get_unaligned for accesses in ATA id buffer Greg KH
2005-10-28 6:30 ` [PATCH] kobject_uevent.c has a typo in a comment Greg KH
2005-10-28 6:30 ` [PATCH] changes device to driver in porting.txt Greg KH
2005-10-28 6:30 ` [PATCH] kobject: fix gfp flags type Greg KH
2005-10-28 6:30 ` [PATCH] pci device wakeup flags Greg KH
2005-10-28 6:30 ` [PATCH] driver model " Greg KH
2005-10-28 6:30 ` [PATCH] add sysfs support for ide tape Greg KH
2005-10-28 6:30 ` [PATCH] usb device wakeup flags Greg KH
2005-10-28 6:30 ` [PATCH] I2O: Clean up some pretty bad driver model abuses in the i2o code Greg KH
2005-10-28 6:30 ` [PATCH] Driver core: pass interface to class interface methods Greg KH
2005-10-28 6:30 ` [PATCH] Driver core: send hotplug event before adding class interfaces Greg KH
2005-10-28 6:30 ` [PATCH] I2O: remove i2o_device_class Greg KH
2005-10-28 6:30 ` [PATCH] add sysfs attr to re-emit device hotplug event Greg KH
2005-10-28 6:30 ` [PATCH] I2O: remove class interface Greg KH
2005-10-28 6:30 ` [PATCH] Driver Core: add the ability for class_device structures to be nested Greg KH
2005-10-28 6:30 ` [PATCH] Driver Core: fix up all callers of class_device_create() Greg KH
2005-10-28 6:30 ` [PATCH] Input: prepare to sysfs integration Greg KH
2005-10-28 6:30 ` [PATCH] Driver Core: document struct class_device properly Greg KH
2005-10-28 6:30 ` [PATCH] drivers/input/mouse: convert to dynamic input_dev allocation Greg KH
2005-10-28 6:30 ` [PATCH] Input: kill devfs references Greg KH
2005-10-28 6:30 ` [PATCH] Input: convert sonypi to dynamic input_dev allocation Greg KH
2005-10-28 6:30 ` [PATCH] Input: convert ucb1x00-ts " Greg KH
2005-10-28 6:30 ` [PATCH] drivers/input/keyboard: convert " Greg KH
2005-10-28 6:30 ` [PATCH] Input: convert onetouch " Greg KH
2005-10-28 6:30 ` [PATCH] drivers/input/touchscreen: convert " Greg KH
2005-10-28 6:55 ` [PATCH] drivers/input/keyboard: " Jan-Benedict Glaw
2005-10-28 7:05 ` Dmitry Torokhov
2005-10-29 5:59 ` Dmitry Torokhov
2005-10-29 14:37 ` Jan-Benedict Glaw
2005-10-29 15:04 ` Jan-Benedict Glaw [this message]
2005-10-29 16:28 ` Dmitry Torokhov
2005-10-29 18:53 ` Jan-Benedict Glaw
2005-10-31 7:02 ` Dmitry Torokhov
2005-10-31 7:20 ` [PATCH] input/lkkbd: misc fixes Jan-Benedict Glaw
2005-10-28 6:54 ` [PATCH] Driver Core: document struct class_device properly Dmitry Torokhov
2005-10-28 19:09 ` Greg KH
2005-10-28 19:18 ` Dmitry Torokhov
2005-11-07 8:00 ` Miles Bader
2005-11-07 17:00 ` Greg KH
2005-10-29 7:55 ` [PATCH] driver model wakeup flags Pavel Machek
2005-11-02 21:59 ` Greg KH
2005-11-04 17:43 ` David Brownell
2005-10-28 10:51 ` [PATCH] pci device " Andrew Morton
2005-10-28 14:31 ` Linus Torvalds
2005-10-28 23:03 ` Benjamin Herrenschmidt
2005-10-28 15:50 ` Greg KH
2005-10-28 19:34 ` Andrew Morton
2005-10-28 19:45 ` Greg KH
2005-10-28 19:47 ` Linus Torvalds
2005-10-28 19:56 ` Russell King
2005-10-28 20:08 ` Greg KH
2005-10-28 20:01 ` Greg KH
2005-10-28 9:21 ` [PATCH] kobject: fix gfp flags type Al Viro
2005-10-28 17:48 ` [GIT PATCH] Driver Core patches for 2.6.14 Greg KH
2005-10-28 18:55 ` Jan-Benedict Glaw
2005-10-28 19:11 ` Greg KH
2005-10-28 19:16 ` Jan-Benedict Glaw
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20051029150451.GV27184@lug-owl.de \
--to=jbglaw@lug-owl.de \
--cc=dtor_core@ameritech.net \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox