RFC: make GS evdev relative by default

Andres Salomon dilinger at laptop.org
Wed Oct 10 16:57:00 EDT 2007


On Wed, 10 Oct 2007 16:21:32 -0400
Bernardo Innocenti <bernie at codewiz.org> wrote:

> NOTE: as the subject says, this is really just being released
> for *comment*.  Not as a candidate patch.
> 
> It seem to be needing this to get the GS to work fine with
> xf86-input-evdev 1.2, the version of the driver updated for the
> X sever 1.4.
> 
> I'm not sure why, but if I leave the GS in absolute mode, only
> the Y axis works fine.  The X axis gets stuck all the way to the
> left of the screen.

Hm, isn't it worth attempting to figure out why, then?  Userspace can
convert between ABS and REL axis with ioctls, I don't see why we'd want
to be dealing w/ relative axis in the driver.  I'm not quite sure what
your patch accomplishes..

> 
> I have to admit I forgot why I had to disable the ABS_PRESSURE
> axis.  Probably not needed, but I need to re-test just in case.
> 
> One last thing: where do those magic numbers 350, 512, 70 and 325
> come from?  They may have something to do with this bug:

Basically trial and error.  Those are the numbers that seemed to match
up best with the edge of the screen and touchpad.  I wouldn't be surprised
if the hardware has since changed, and those numbers need updating.

> 
>   https://dev.laptop.org/ticket/4055
> 
> If you want to reproduce my test environment, just download this
> file to /etc/yum.repo.d directory on your laptop:
> 
>   http://www.codewiz.org/pub/olpc-bernie/olpc-bernie.repo
> 
> Then, just do a "yum update".  Let me know if you need additional
> tweaks to get it to work.
> 
> 
> diff --git a/drivers/input/mouse/olpc.c b/drivers/input/mouse/olpc.c
> index dc575ac..daf2483 100644
> --- a/drivers/input/mouse/olpc.c
> +++ b/drivers/input/mouse/olpc.c
> @@ -508,10 +508,12 @@ int olpc_init(struct psmouse *psmouse)
>         dev2->keybit[LONG(BTN_TOOL_FINGER)] |= BIT(BTN_TOOL_FINGER);
>         dev2->keybit[LONG(BTN_LEFT)] |= BIT(BTN_LEFT) | BIT(BTN_RIGHT);
>  
> +       // bernie: argh -- needed for hal to see it as a mouse
> +       dev2->relbit[LONG(REL_X)] |= BIT(REL_X) | BIT(REL_Y);
>         dev2->evbit[LONG(EV_ABS)] |= BIT(EV_ABS);
>         input_set_abs_params(dev2, ABS_X, 350, 512, 0, 0);
>         input_set_abs_params(dev2, ABS_Y, 70, 325, 0, 0);
> -       input_set_abs_params(dev2, ABS_PRESSURE, 0, 63, 0, 0);
> +//     input_set_abs_params(dev2, ABS_PRESSURE, 0, 63, 0, 0);
>  
>         if (input_register_device(dev2)) {
>                 printk(KERN_ERR __FILE__ ": Failed to register GlideSensor\n");
> 
> -- 
>  \___/
>  |___|   Bernardo Innocenti - http://www.codewiz.org/
>   \___\  One Laptop Per Child - http://www.laptop.org/


-- 
Andres Salomon <dilinger at laptop.org>



More information about the Devel mailing list