* [PATCH] uinput: Allow for 0/0 min/max on absolute axes.
@ 2011-03-31 5:05 Peter Hutterer
2011-03-31 5:25 ` Dmitry Torokhov
0 siblings, 1 reply; 2+ messages in thread
From: Peter Hutterer @ 2011-03-31 5:05 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input, linux-kernel
Some devices provide absolute axes with min/max of 0/0 (e.g. wacom's
ABS_MISC axis). Current uinput restrictions do not allow duplication of
these devices and require hacks in userspace to work around this.
If the kernel accepts physical devices with a min/max of 0/0, uinput
shouldn't disallow the same range.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
---
drivers/input/misc/uinput.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c
index b941078..d7cc037 100644
--- a/drivers/input/misc/uinput.c
+++ b/drivers/input/misc/uinput.c
@@ -301,10 +301,14 @@ static int uinput_validate_absbits(struct input_dev *dev)
int retval = 0;
for (cnt = 0; cnt < ABS_CNT; cnt++) {
+ int min, max;
if (!test_bit(cnt, dev->absbit))
continue;
- if (input_abs_get_max(dev, cnt) <= input_abs_get_min(dev, cnt)) {
+ min = input_abs_get_min(dev, cnt);
+ max = input_abs_get_max(dev, cnt);
+
+ if ((min != 0 || max != 0) && max <= min) {
printk(KERN_DEBUG
"%s: invalid abs[%02x] min:%d max:%d\n",
UINPUT_NAME, cnt,
--
1.7.4.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] uinput: Allow for 0/0 min/max on absolute axes.
2011-03-31 5:05 [PATCH] uinput: Allow for 0/0 min/max on absolute axes Peter Hutterer
@ 2011-03-31 5:25 ` Dmitry Torokhov
0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2011-03-31 5:25 UTC (permalink / raw)
To: Peter Hutterer; +Cc: linux-input, linux-kernel
On Thu, Mar 31, 2011 at 03:05:03PM +1000, Peter Hutterer wrote:
> Some devices provide absolute axes with min/max of 0/0 (e.g. wacom's
> ABS_MISC axis). Current uinput restrictions do not allow duplication of
> these devices and require hacks in userspace to work around this.
>
> If the kernel accepts physical devices with a min/max of 0/0, uinput
> shouldn't disallow the same range.
>
Right, we should treat 0/0 as unlimited, or not specified, not
applicable.
Applied, thank you Peter.
--
Dmitry
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-03-31 5:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-31 5:05 [PATCH] uinput: Allow for 0/0 min/max on absolute axes Peter Hutterer
2011-03-31 5:25 ` Dmitry Torokhov
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).