Re: [RFC][PATCH] USB touch screen driver, all-in-one

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2006-03-14 09:10:13 +0800, Lanslott Gish <[email protected]> wrote:
> i fixed some codes and add swap_x & swap_y functions.
> and test your patch passed for my touchset hrdware.
> here is the patch only for your usbtouchscreen.c
> could you help to apply this?
> thank you.
> 
> Regards,
> 
> Lanslott Gish
> 
> ==============================================================
> --- linux-2.6.16-rc6.patched/drivers/usb/input/usbtouchscreen.c
> +++ linux-2.6.16-rc6/drivers/usb/input/usbtouchscreen.c
> @@ -224,13 +224,24 @@
>   * PanJit Part
>   */
>  #ifdef CONFIG_USB_TOUCHSCREEN_PANJIT
> +
> +static int swap_x;
> +module_param(swap_x, bool, 0644);
> +MODULE_PARM_DESC(swap_x, "If set X axe is swapped before XY swapped.");
> +static int swap_y;
> +module_param(swap_y, bool, 0644);
> +MODULE_PARM_DESC(swap_y, "If set Y axe is swapped before XY swapped.");
> +
>  static int panjit_read_data(char *pkt, int *x, int *y, int *touch, int *press)
>  {
> -       *x = pkt[1] | (pkt[2] << 8);
> -       *y = pkt[3] | (pkt[4] << 8);
> +       *x = (pkt[1] & 0x0F) | ((pkt[2]& 0xFF) << 8);
> +       *y = (pkt[3] & 0x0F) | ((pkt[4]& 0xFF) << 8);
>         *touch = (pkt[0] & 0x01) ? 1 : 0;
> 
> -       return 1;
> +	if(swap_x) *x = *x ^ 0x0FFF;
> +	if(swap_y) *y = *y ^ 0x0FFF;
> +
> + 	return 1;
>  }
>  #endif
> 

Um, I think it's generally a good idea to allow this, but I'd say this
should go into the common code part using the pre-known number range.

MfG, JBG

-- 
Jan-Benedict Glaw       [email protected]    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
 für einen Freien Staat voll Freier Bürger"  | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux