Matteo Croce | 18 Sep 19:12

[PATCH] usbtouchscreen: option to swap X and Y axes

Here there is a patch to invert the X and Y axes, as my controller swaps it:

Signed-off-by: Matteo Croce <matteo <at> openwrt.org>

--- a/drivers/input/touchscreen/usbtouchscreen.c	2008-09-18
18:50:44.294868149 +0200
+++ b/drivers/input/touchscreen/usbtouchscreen.c	2008-09-18
18:50:44.226867816 +0200
@@ -56,8 +56,16 @@
 #define DRIVER_DESC		"USB Touchscreen Driver"

 static int swap_xy;
+static int invert_x;
+static int invert_y;
+
 module_param(swap_xy, bool, 0644);
+module_param(invert_x, bool, 0644);
+module_param(invert_y, bool, 0644);
+
 MODULE_PARM_DESC(swap_xy, "If set X and Y axes are swapped.");
+MODULE_PARM_DESC(invert_x, "If set X axe is inverted.");
+MODULE_PARM_DESC(invert_y, "If set Y axe is inverted.");

 /* device specifc data/functions */
 struct usbtouch_usb;
@@ -683,6 +691,7 @@
                                  unsigned char *pkt, int len)
 {
 	struct usbtouch_device_info *type = usbtouch->type;
+	int x, y;
(Continue reading)

Jiri Kosina | 20 Sep 04:45
Favicon

Re: [PATCH] usbtouchscreen: option to swap X and Y axes

On Thu, 18 Sep 2008, Matteo Croce wrote:

> Here there is a patch to invert the X and Y axes, as my controller swaps it:
> 
> Signed-off-by: Matteo Croce <matteo <at> openwrt.org>
> 
> --- a/drivers/input/touchscreen/usbtouchscreen.c	2008-09-18
> 18:50:44.294868149 +0200
> +++ b/drivers/input/touchscreen/usbtouchscreen.c	2008-09-18
> 18:50:44.226867816 +0200
> @@ -56,8 +56,16 @@
>  #define DRIVER_DESC		"USB Touchscreen Driver"
> 
>  static int swap_xy;
> +static int invert_x;
> +static int invert_y;
> +
>  module_param(swap_xy, bool, 0644);
> +module_param(invert_x, bool, 0644);
> +module_param(invert_y, bool, 0644);
> +
>  MODULE_PARM_DESC(swap_xy, "If set X and Y axes are swapped.");
> +MODULE_PARM_DESC(invert_x, "If set X axe is inverted.");
> +MODULE_PARM_DESC(invert_y, "If set Y axe is inverted.");

If this is done just by certain devices, maybe VID/PID-based autodetection 
might be much more user friendly than using module parameter?

--

-- 
Jiri Kosina
(Continue reading)

Matteo Croce | 20 Sep 18:47

Re: [PATCH] usbtouchscreen: option to swap X and Y axes

On Saturday 20 September 2008 04:45:48 Jiri Kosina wrote:
> On Thu, 18 Sep 2008, Matteo Croce wrote:
> > Here there is a patch to invert the X and Y axes, as my controller swaps
> > it:
> >
> > Signed-off-by: Matteo Croce <matteo <at> openwrt.org>
> >
> > --- a/drivers/input/touchscreen/usbtouchscreen.c	2008-09-18
> > 18:50:44.294868149 +0200
> > +++ b/drivers/input/touchscreen/usbtouchscreen.c	2008-09-18
> > 18:50:44.226867816 +0200
> > @@ -56,8 +56,16 @@
> >  #define DRIVER_DESC		"USB Touchscreen Driver"
> >
> >  static int swap_xy;
> > +static int invert_x;
> > +static int invert_y;
> > +
> >  module_param(swap_xy, bool, 0644);
> > +module_param(invert_x, bool, 0644);
> > +module_param(invert_y, bool, 0644);
> > +
> >  MODULE_PARM_DESC(swap_xy, "If set X and Y axes are swapped.");
> > +MODULE_PARM_DESC(invert_x, "If set X axe is inverted.");
> > +MODULE_PARM_DESC(invert_y, "If set Y axe is inverted.");
>
> If this is done just by certain devices, maybe VID/PID-based autodetection
> might be much more user friendly than using module parameter?

no, sometimes you have to swap just because you attached it in the wrong 
(Continue reading)


Gmane