[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100330110138.GA6164@hardeman.nu>
Date: Tue, 30 Mar 2010 13:01:38 +0200
From: David Härdeman <david@...deman.nu>
To: Mauro Carvalho Chehab <mchehab@...hat.com>
Cc: Dmitry Torokhov <dmitry.torokhov@...il.com>,
Jon Smirl <jonsmirl@...il.com>, Pavel Machek <pavel@....cz>,
Krzysztof Halasa <khc@...waw.pl>,
hermann pitton <hermann-pitton@...or.de>,
Christoph Bartelmus <lirc@...telmus.de>, awalls@...ix.net,
j@...nau.net, jarod@...hat.com, jarod@...sonet.com,
kraxel@...hat.com, linux-input@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-media@...r.kernel.org,
superm1@...ntu.com
Subject: Re: [RFC] What are the goals for the architecture of an in-kernel
IR system?
On Sun, Mar 28, 2010 at 09:51:17PM -0300, Mauro Carvalho Chehab wrote:
>
> I spoke too soon... removing the index causes a problem at the read ioctl: there's no way
> to retrieve just the non-sparsed values.
>
> There's one solution that would allow both read/write and compat to work nicely,
> but the API would become somewhat asymmetrical:
>
> At get (EVIOCGKEYCODEBIG):
> use index/len as input and keycode/scancode as output;
>
> At set (EVIOCSKEYCODEBIG):
> use scancode/keycode/len as input (and, optionally, index as output).
>
This was exactly the approach I had in mind when I suggested using
indexes.
> Having it asymmetrical doesn't sound good, but, on the other hand,
> using index for
> the set function also doesn't seem good, as the driver may reorder the entries after
> setting, for example to work with a binary tree or with hashes.
I don't think the assymetry is really a problem. As I see it, there are
basically two user cases:
1) Userspace wants scancode X to generate keypress Y
(In which case userspace doesn't care one iota what the index is)
2) Userspace wants to get the current keytable from the kernel
(In which case a loop with an index from 0 to n is appropriate)
and, possibly:
3) Userspace wants to know what keycode (if any) scancode X generates
(In which case approach 2 will work just as well, but this usecase
seems a bit contrived anyway...)
--
David Härdeman
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists