linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-arm-kernel@lists.arm.linux.org.uk, linux-input@vger.kernel.org
Subject: Re: [PATCH 3/5] [ARM] pxa: lx: add keyboard driver
Date: Mon, 20 Apr 2009 12:06:40 +0100	[thread overview]
Message-ID: <20090420110640.GC3653@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20090418231018.GA32346@dtor-d630.eng.vmware.com>

On Sat, Apr 18, 2009 at 04:10:28PM -0700, Dmitry Torokhov wrote:
> > +config KEYBOARD_LX
> > +	tristate "LX Keyboard support"
> > +	depends on MACH_NETBOOKPRO && INPUT && INPUT_KEYBOARD
> 
> Dependancy on INPUT_KEYBOARD is not needed, strictly speaking.
> INPUT_KEYBOARD is only [menu]config syntactic sugar, there is no meat
> behind the option.

Gone.

> > +
> > +	/*
> > +	 * Some keys have additional operations after we have
> > +	 * decoded them.  We don't report these "special" keys
> > +	 * to the input layer.
> > +	 */
> > +	switch (key) {
> > +	case KEY_BRIGHTNESSUP:
> > +	case KEY_BRIGHTNESSDOWN:
> > +		input_event(kbd, EV_PWR, key, !up);
> 
> Umm... some userspace apps might still want to get these. Strictly
> speaking KEY_* codes belong to EV_KEY namespace.

Maybe, if someone wants it I guess they can modify the driver.

> > +static void lx_keyb_reset(struct input_dev *kbd)
> > +{
> > +	unsigned char *map;
> > +	int key;
> > +
> > +	for (key = 0; key < LX_NUMKEYCODES; key++)
> > +		if (keystate[key] & KP_DOWN) {
> > +			map = normal_map;
> > +			if (keystate[key] & KP_FN)
> > +				map = fn_map;
> > +			else if (keystate[key] & KP_NUMLCK)
> > +				map = numlck_map;
> > +			keystate[key] = KP_NONE;
> > +			input_report_key(kbd, map[key], 0);
> > +		}
> 
> Why don't you just send 'up' event for all known keys? Input core will
> filter out the ones that have not been 'down'ed... Better yet, don't do
> anything here, I should finish adding forced release at suspend/resume
> to the input core shortly.

I'll leave it as is until you've decided what to do with the input core.

> > +static void lx_keyb_write(void *data, unsigned int addr, unsigned char val)
> > +{
> > +	struct input_dev *kbd = data;
> 
> Blank line between variables and the code is always appreciated ;)

Added.

> > +	kbd->name        = "LX Keyboard";
> > +	kbd->phys        = "pcon/input0";
> > +	kbd->dev.parent  = &dev->dev;
> > +	kbd->evbit[0]    = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP) |
> > +			   BIT_MASK(EV_PWR);
> > +	kbd->keycode     = normal_map;
> > +	kbd->keycodesize = sizeof(unsigned char);
> > +	kbd->keycodemax  = ARRAY_SIZE(normal_map);
> > +
> 
> So we have 3 keymaps but only one can be changed form userspace... I
> suppose it is OK given how special the other 2 keymaps are. Or we could
> provide an alternative {get,set}keycode methods.

Yes, not sure what to do about those.  It is a rather specialised
keyboard in itself, so the standard maps wouldn't work with it.

The other issue here is that changing what's published may break the
existing userspace (and since I didn't take a copy of the userspace
build for this platform before the server was taken down, that could
present something of a problem resulting in my use of the device being
crippled.)  Let's leave it as is and if someone does want to change it
later...

> > +static int __init lx_keyb_init(void)
> > +{
> > +	printk(KERN_INFO "LX Keyboard Driver, (c) 2004 Simtec Electronics\n");
> 
> Is this needed? Input core will already add printk when input device is
> added and our boot is already chatty enough...

As mentioned in the other mail, now removed.

  parent reply	other threads:[~2009-04-20 11:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-18 14:19 [PATCH 0/5] PXA LX platform support Russell King - ARM Linux
2009-04-18 14:20 ` [PATCH 3/5] [ARM] pxa: lx: add keyboard driver Russell King
2009-04-18 23:10   ` Dmitry Torokhov
2009-04-20  8:25     ` Russell King - ARM Linux
2009-04-20  9:04       ` Dmitry Torokhov
2009-04-20 10:56         ` Russell King - ARM Linux
2009-04-20 11:06     ` Russell King - ARM Linux [this message]
2009-04-20 11:13       ` [PATCH 3/5 UPDATED] " Russell King - ARM Linux
2009-04-21  2:16         ` Dmitry Torokhov
2009-04-22 18:56           ` Russell King - ARM Linux
2009-04-21  2:15       ` [PATCH 3/5] " Dmitry Torokhov

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=20090420110640.GC3653@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-input@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;
as well as URLs for NNTP newsgroup(s).