Re: [PATCH] new driver for ITM Touch touchscreen
On Thu, Mar 10, 2005 at 05:41:42PM +0100, Hans-Christian Egtvedt wrote: > On Thu, 2005-03-10 at 17:18 +0100, Vojtech Pavlik wrote: > > On Tue, Mar 08, 2005 at 05:01:00PM +0100, Hans-Christian Egtvedt wrote: > > > > > I really don't think the controller can now anything about the size of > > > the screen. > > > > > > I've attached version 1.2.1 of the driver, fixed some typo, code cleanup > > > and discovered I used depricated functions so I moved to the new correct > > > way of doing killing of the urb. > > > > Pacth applied, with minor cleanups. > > Could you send me your changes? Here is the final patch: [EMAIL PROTECTED], 2005-03-10 17:17:56+01:00, [EMAIL PROTECTED] input: Add driver for ITM Touch USB touchscreens. From: Hans-Christian Egtvedt <[EMAIL PROTECTED]> Signed-off-by: Vojtech Pavlik <[EMAIL PROTECTED]> Kconfig| 12 ++ Makefile |1 itmtouch.c | 281 + 3 files changed, 294 insertions(+) diff -Nru a/drivers/usb/input/Kconfig b/drivers/usb/input/Kconfig --- a/drivers/usb/input/Kconfig 2005-03-10 17:45:56 +01:00 +++ b/drivers/usb/input/Kconfig 2005-03-10 17:45:56 +01:00 @@ -190,6 +190,18 @@ To compile this driver as a module, choose M here: the module will be called mtouchusb. +config USB_ITMTOUCH + tristate "ITM Touch USB Touchscreen Driver" + depends on USB && INPUT + ---help--- + Say Y here if you want to use a ITM Touch USB + Touchscreen controller. + + This touchscreen is used in LG 1510SF monitors. + + To compile this driver as a module, choose M here: the + module will be called itmtouch. + config USB_EGALAX tristate "eGalax TouchKit USB Touchscreen Driver" depends on USB && INPUT diff -Nru a/drivers/usb/input/Makefile b/drivers/usb/input/Makefile --- a/drivers/usb/input/Makefile2005-03-10 17:45:56 +01:00 +++ b/drivers/usb/input/Makefile2005-03-10 17:45:56 +01:00 @@ -33,6 +33,7 @@ obj-$(CONFIG_USB_KBTAB)+= kbtab.o obj-$(CONFIG_USB_MOUSE)+= usbmouse.o obj-$(CONFIG_USB_MTOUCH) += mtouchusb.o +obj-$(CONFIG_USB_ITMTOUCH) += itmtouch.o obj-$(CONFIG_USB_EGALAX) += touchkitusb.o obj-$(CONFIG_USB_POWERMATE)+= powermate.o obj-$(CONFIG_USB_WACOM)+= wacom.o diff -Nru a/drivers/usb/input/itmtouch.c b/drivers/usb/input/itmtouch.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/drivers/usb/input/itmtouch.c 2005-03-10 17:45:56 +01:00 @@ -0,0 +1,281 @@ +/** + * itmtouch.c -- Driver for ITM touchscreen panel + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * Based upon original work by Chris Collins <[EMAIL PROTECTED]>. + * + * Kudos to ITM for providing me with the datasheet for the panel, + * even though it was a day later than I had finished writing this + * driver. + * + * It has meant that I've been able to correct my interpretation of the + * protocol packets however. + * + * CC -- 2003/9/29 + * + * History + * 1.0 & 1.1 2003 (CC) [EMAIL PROTECTED] + * Original version for 2.4.x kernels + * + * 1.2 02/03/2005 (HCE) [EMAIL PROTECTED] + * Complete rewrite to support Linux 2.6.10, thanks to mtouchusb.c for hints. + * Unfortunately no calibration support at this time. + * + * 1.2.1 09/03/2005 (HCE) [EMAIL PROTECTED] + * Code cleanup and adjusting syntax to start matching kernel standards + * + */ + +#include + +#ifdef CONFIG_USB_DEBUG + #define DEBUG +#else + #undef DEBUG +#endif + +#include +#include +#include +#include +#include +#include + +/* only an 8 byte buffer necessary for a single packet */ +#define ITM_BUFSIZE8 +#define PATH_SIZE 64 + +#define USB_VENDOR_ID_ITMINC 0x0403 +#define USB_PRODUCT_ID_TOUCHPANEL 0xf9e9 + +#define DRIVER_AUTHOR "Hans-Christian Egtvedt <[EMAIL PROTECTED]>" +#define DRIVER_VERSION "v1.2.1" +#define DRIVER_DESC "USB ITM Inc Touch Panel Driver" +#define DRIVER_LICENSE "GPL" + +MODULE_AUTHOR( DRIVER_AUTHOR ); +MODULE_DESCRIPTION( DRIVER_DESC ); +MODULE_LICENSE( DRIVER_LICENSE ); + +struct it
Re: [PATCH] new driver for ITM Touch touchscreen
On Thu, 2005-03-10 at 17:18 +0100, Vojtech Pavlik wrote: > On Tue, Mar 08, 2005 at 05:01:00PM +0100, Hans-Christian Egtvedt wrote: > > > I really don't think the controller can now anything about the size of > > the screen. > > > > I've attached version 1.2.1 of the driver, fixed some typo, code cleanup > > and discovered I used depricated functions so I moved to the new correct > > way of doing killing of the urb. > > Pacth applied, with minor cleanups. Could you send me your changes? -- Hans-Christian Egtvedt <[EMAIL PROTECTED]> MIVU Solutions DA - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] new driver for ITM Touch touchscreen
On Tue, Mar 08, 2005 at 05:01:00PM +0100, Hans-Christian Egtvedt wrote: > I really don't think the controller can now anything about the size of > the screen. > > I've attached version 1.2.1 of the driver, fixed some typo, code cleanup > and discovered I used depricated functions so I moved to the new correct > way of doing killing of the urb. Pacth applied, with minor cleanups. > --- kernel-source-2.6.11/drivers/usb/input/Kconfig2004-12-24 > 22:35:23.0 +0100 > +++ linux-2.6.11/drivers/usb/input/Kconfig2005-03-02 10:58:41.0 > +0100 > @@ -190,6 +190,18 @@ > To compile this driver as a module, choose M here: the > module will be called mtouchusb. > > +config USB_ITMTOUCH > + tristate "ITM Touch USB Touchscreen Driver" > + depends on USB && INPUT > + ---help--- > + Say Y here if you want to use a ITM Touch USB > + Touchscreen controller. > + > + This touchscreen is used in LG 1510SF monitors. > + > + To compile this driver as a module, choose M here: the > + module will be called itmtouch. > + > config USB_EGALAX > tristate "eGalax TouchKit USB Touchscreen Driver" > depends on USB && INPUT > --- kernel-source-2.6.11/drivers/usb/input/Makefile 2004-12-24 > 22:35:00.0 +0100 > +++ linux-2.6.11/drivers/usb/input/Makefile 2005-03-02 10:57:11.0 > +0100 > @@ -33,6 +33,7 @@ > obj-$(CONFIG_USB_KBTAB) += kbtab.o > obj-$(CONFIG_USB_MOUSE) += usbmouse.o > obj-$(CONFIG_USB_MTOUCH) += mtouchusb.o > +obj-$(CONFIG_USB_ITMTOUCH) += itmtouch.o > obj-$(CONFIG_USB_EGALAX) += touchkitusb.o > obj-$(CONFIG_USB_POWERMATE) += powermate.o > obj-$(CONFIG_USB_WACOM) += wacom.o > --- /dev/null 2005-03-01 19:15:30.0 +0100 > +++ linux-2.6.11/drivers/usb/input/itmtouch.c 2005-03-02 11:05:04.0 > +0100 > @@ -0,0 +1,318 @@ > +/** > + * itmtouch.c -- Driver for ITM touchscreen panel > + * > + * This program is free software; you can redistribute it and/or > + * modify it under the terms of the GNU General Public License as > + * published by the Free Software Foundation; either version 2 of the > + * License, or (at your option) any later version. > + * > + * This program is distributed in the hope that it will be useful, but > + * WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + * General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program; if not, write to the Free Software > + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. > + * > + * Based upon original work by Chris Collins <[EMAIL PROTECTED]>. > + * > + * History > + * 1.0 & 1.1 2003 (CC) [EMAIL PROTECTED] > + * Original version for 2.4.x kernels > + * > + * 1.2 02/03/2005 (HCE) [EMAIL PROTECTED] > + * Complete rewrite to support Linux 2.6.10, thanks to mtouchusb.c for > hints. > + * Unfortunately no calibration support at this time. > + * > + * 1.2.1 09/03/2005 (HCE) [EMAIL PROTECTED] > + * Code cleanup and adjusting syntax to start matching kernel standards > + * > + > */ > + > +/* In order to prevent poluting device space with YET ANOTHER character > + * device, this driver pumps out raw coordinate events into the input > + * event stream. > + * > + * They can be extracted using the input core raw events module. > + * > + * Kudos to ITM for providing me with the datasheet for the panel, > + * even though it was a day later than I had finished writing this > + * driver. > + * > + * It has meant that I've been able to correct my interpretation of the > + * protocol packets however. > + * > + * CC -- 2003/9/29 > + */ > + > +#include > + > +#ifdef CONFIG_USB_DEBUG > + #define DEBUG > +#else > + #undef DEBUG > +#endif > + > +#include > +#include > +#include > +#include > +#include > +#include > + > +/* only an 8 byte buffer necessary for a single packet */ > +#define ITM_BUFSIZE 8 > +/* support a maximum of 4 such touchscreens at once */ > +#define MAXTOUCH 4 > +#define UCP(x) ((unsigned char*)(x)) > +#define UCOM(x,y,z) ((UCP((x)->transfer_buffer)[y]) & (z)) > +#define PATH_SIZE64 > + > +#define USB_VENDOR_ID_ITMINC 0x0403 > +#define USB_PRODUCT_ID_TOUCHPANEL0xf9e9 > + > +#define DRIVER_AUTHOR "Hans-Christian Egtvedt <[EMAIL PROTECTED]>" > +#define DRIVER_VERSION "v1.2.1" > +#define DRIVER_DESC "USB ITM Inc Touch Panel Driver" > +#define DRIVER_LICENSE "GPL" > + > +MODULE_AUTHOR( DRIVER_AUTHOR ); > +MODULE_DESCRIPTION( DRIVER_DESC ); > +MODULE_LICENSE( DRIVER_LICENSE ); > + > +struct itmtouch_dev { > + str
Re: [PATCH] new driver for ITM Touch touchscreen
Hans-Christian Egtvedt wrote: [...] Any tips are welcome. Is this done before with a touchscreen? Just a minor nitpick, not really related to the mouse problem. More of coding style problem. IMHO the UCP and UCOM macros just obfuscate the code. If you do not want to write "((unsigned char *) urb->transfer_buffer)[0]" every time (I can perfectly understand that), maybe using a local "u8 *" var would do the trick. Something like this: static void itmtouch_irq(struct urb *urb, struct pt_regs *regs) { struct itmtouch_dev * itmtouch = urb->context; int retval; u8 *tbuf; input_regs(&itmtouch->inputdev, regs); tbuf = (u8 *)(urb->transfer_buffer); /* if pressure has been released, then don't report X/Y */ if (!(tbuf[7] & 0x20)) { input_report_abs(&itmtouch->inputdev, ABS_X, (tbuf[0] & 0x1F) << 7 | (tbuf[3] & 0x7F)); input_report_abs(&itmtouch->inputdev, ABS_Y, (tbuf[1] & 0x1F) << 7 | (tbuf[4] & 0x7F)); } input_report_abs(&itmtouch->inputdev, ABS_PRESSURE, (tbuf[2] & 0x1) << 7 | (tbuf[5] & 0x7F)); input_report_key(&itmtouch->inputdev, BTN_TOUCH, !(tbuf[7] & 0x20)); /* TODO: Do we need to use input_sync() ? */ /* input_sync(&itmtouch->inputdev); */ .. This is perfectly readable without one having to find out what those macros mean, and it is even easier for the compiler to optimize (even though gcc will probably optimize both versions just fine). -- Paulo Marques - www.grupopie.com All that is necessary for the triumph of evil is that good men do nothing. Edmund Burke (1729 - 1797) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] new driver for ITM Touch touchscreen
On Tue, Mar 08, 2005 at 12:25:09PM -0500, Dmitry Torokhov wrote: > I am not sure... that BTN_TOUCH - look slike it works off a single > flag reported by hardware. You porobably do not need to change it. Indeed, if the hardware reports a touch flag it's best to use that. > Try loading mousedev module (after adding input_sync back to your > driver) - it provides cooked PS/2 protocol to userspace - it should > bind to your driver. Then you can use GPM or X (read from > /dev/input/mice) to test the touchscreen and see if you have issue > with double clicks. And for even better behavior, use 'evtouch' from Kenan Esau as an X driver. -- Vojtech Pavlik SuSE Labs, SuSE CR - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] new driver for ITM Touch touchscreen
On Tue, 08 Mar 2005 17:01:00 +0100, Hans-Christian Egtvedt <[EMAIL PROTECTED]> wrote: > On Fri, 2005-03-04 at 11:54 -0500, Dmitry Torokhov wrote: > > On Fri, 04 Mar 2005 17:20:24 +0100, Hans-Christian Egtvedt <[EMAIL > > PROTECTED]> wrote: > > > On Fri, 2005-03-04 at 09:52 -0500, Dmitry Torokhov wrote: > > > > On Fri, 4 Mar 2005 14:03:37 +0200, Alexey Dobriyan <[EMAIL PROTECTED]> > > > > wrote: > > > > > On Friday 04 March 2005 12:30, Hans-Christian Egtvedt wrote: > > > > As far as the driver goes: > > > > > > > > - yes, it does need input_sync; > > > > > > One problem with input_sync is that the panel get's too fast, and double > > > click is experienced quite often, maybe some threshold is needed for low > > > values in Z-direction? > > > > > > I'm probably doing something wrong here since I experience easy > > > doubleclicks when I just lightly touch the screen. > > > > Yes, I think you need to use some threshold when reporting BTN_TOUCH > > event. Still, always report ABS_PRESSURE as is. This way the > > touchscreen is useable via legacy interfaces (mousedev. tsdev) and if > > a specialized userspace driver is written it still can get pretty much > > unmangled data from /dev/input/eventX. This will also allow such > > driver adjust touchpad sensitivity, if needed. > > Do you have any pointers to where I should go to implement this > threshold? Is there an easy or smart way doing it? > I am not sure... that BTN_TOUCH - look slike it works off a single flag reported by hardware. You porobably do not need to change it. Try loading mousedev module (after adding input_sync back to your driver) - it provides cooked PS/2 protocol to userspace - it should bind to your driver. Then you can use GPM or X (read from /dev/input/mice) to test the touchscreen and see if you have issue with double clicks. -- Dmitry - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] new driver for ITM Touch touchscreen
On Fri, 2005-03-04 at 11:54 -0500, Dmitry Torokhov wrote: > On Fri, 04 Mar 2005 17:20:24 +0100, Hans-Christian Egtvedt <[EMAIL > PROTECTED]> wrote: > > On Fri, 2005-03-04 at 09:52 -0500, Dmitry Torokhov wrote: > > > On Fri, 4 Mar 2005 14:03:37 +0200, Alexey Dobriyan <[EMAIL PROTECTED]> > > > wrote: > > > > On Friday 04 March 2005 12:30, Hans-Christian Egtvedt wrote: > > > As far as the driver goes: > > > > > > - yes, it does need input_sync; > > > > One problem with input_sync is that the panel get's too fast, and double > > click is experienced quite often, maybe some threshold is needed for low > > values in Z-direction? > > > > I'm probably doing something wrong here since I experience easy > > doubleclicks when I just lightly touch the screen. > > Yes, I think you need to use some threshold when reporting BTN_TOUCH > event. Still, always report ABS_PRESSURE as is. This way the > touchscreen is useable via legacy interfaces (mousedev. tsdev) and if > a specialized userspace driver is written it still can get pretty much > unmangled data from /dev/input/eventX. This will also allow such > driver adjust touchpad sensitivity, if needed. Do you have any pointers to where I should go to implement this threshold? Is there an easy or smart way doing it? No, not physical sizes. I was wondering if soe touchscreens are > reporting let's say actual coordinates from 1100-3600 and others from > 600-3850, instead of full 0-4096. Is there a way to query the hardware > and find the actual min and max for a device so it can be reported to > userspace. I really don't think the controller can now anything about the size of the screen. I've attached version 1.2.1 of the driver, fixed some typo, code cleanup and discovered I used depricated functions so I moved to the new correct way of doing killing of the urb. Starting looking into ways of using the module directly as a standard mouse, that will take away loads of worries for me about converting X applications to x.org. Any tips are welcome. Is this done before with a touchscreen? -- Hans-Christian Egtvedt <[EMAIL PROTECTED]> MIVU Solutions DA --- kernel-source-2.6.11/drivers/usb/input/Kconfig 2004-12-24 22:35:23.0 +0100 +++ linux-2.6.11/drivers/usb/input/Kconfig 2005-03-02 10:58:41.0 +0100 @@ -190,6 +190,18 @@ To compile this driver as a module, choose M here: the module will be called mtouchusb. +config USB_ITMTOUCH + tristate "ITM Touch USB Touchscreen Driver" + depends on USB && INPUT + ---help--- + Say Y here if you want to use a ITM Touch USB + Touchscreen controller. + + This touchscreen is used in LG 1510SF monitors. + + To compile this driver as a module, choose M here: the + module will be called itmtouch. + config USB_EGALAX tristate "eGalax TouchKit USB Touchscreen Driver" depends on USB && INPUT --- kernel-source-2.6.11/drivers/usb/input/Makefile 2004-12-24 22:35:00.0 +0100 +++ linux-2.6.11/drivers/usb/input/Makefile 2005-03-02 10:57:11.0 +0100 @@ -33,6 +33,7 @@ obj-$(CONFIG_USB_KBTAB) += kbtab.o obj-$(CONFIG_USB_MOUSE) += usbmouse.o obj-$(CONFIG_USB_MTOUCH) += mtouchusb.o +obj-$(CONFIG_USB_ITMTOUCH) += itmtouch.o obj-$(CONFIG_USB_EGALAX) += touchkitusb.o obj-$(CONFIG_USB_POWERMATE) += powermate.o obj-$(CONFIG_USB_WACOM) += wacom.o --- /dev/null 2005-03-01 19:15:30.0 +0100 +++ linux-2.6.11/drivers/usb/input/itmtouch.c 2005-03-02 11:05:04.0 +0100 @@ -0,0 +1,318 @@ +/** + * itmtouch.c -- Driver for ITM touchscreen panel + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * Based upon original work by Chris Collins <[EMAIL PROTECTED]>. + * + * History + * 1.0 & 1.1 2003 (CC) [EMAIL PROTECTED] + * Original version for 2.4.x kernels + * + * 1.2 02/03/2005 (HCE) [EMAIL PROTECTED] + * Complete rewrite to support Linux 2.6.10, thanks to mtouchusb.c for hints. + * Unfortunately no calibration support at this time. + * + * 1.2.1 09/03/2005 (HCE) [EMAIL PROTECTED] + * Code cleanup and adjusting syntax to start matching kernel standards + * + */ + +/* In order to prevent poluting device space with YET ANOTHER character + * device, this driver pumps out raw
Re: [PATCH] new driver for ITM Touch touchscreen
On Fri, Mar 04, 2005 at 07:51:47PM +0100, Hans-Christian Egtvedt wrote: > OK, I'll try to find some better documentation about input devices, any > tips/pointers would be nice. I'm completly new to kernel drivers, I'm used to > writing drivers in embedded systems. > > The driver is made in the way it is today because there is also a driver for > X which read raw events from /dev/input/eventX. It's called lictouch, I have > the source for it too, but I'm not (yet) part of any developing there. Please take a look at 'evtouch' by Kenan Esau, which may fit your bill as an X driver, too. [http://www.conan.de/lifebook] > It would be a really nice feature if one could use the touchscreen as a > legacy interface, but then I would need to be able to calibrate the screen in > the driver and not frontend. At least preferable. It's possible to do that to a certain degree using the EVIOCSABS ioctl(). Only trivial linear calibration is supported, though. -- Vojtech Pavlik SuSE Labs, SuSE CR - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] new driver for ITM Touch touchscreen
On Fri, Mar 04, 2005 at 11:54:18AM -0500, Dmitry Torokhov wrote: > No, not physical sizes. I was wondering if soe touchscreens are > reporting let's say actual coordinates from 1100-3600 and others from > 600-3850, instead of full 0-4096. Is there a way to query the hardware > and find the actual min and max for a device so it can be reported to > userspace. Resistive touchscreens, due to their voltage-divider nature have near-full range all the time, independent of the controller and sensor combination, so setting min to 0 and max to 4096 is OK. > P.S. When you post the updated version could you please CC Vojtech > Pavlik <[EMAIL PROTECTED]> as he is the current input system maintainer > and linux-input mailing list at [EMAIL PROTECTED] Yes, please. ;) -- Vojtech Pavlik SuSE Labs, SuSE CR - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] new driver for ITM Touch touchscreen
Around Fri 04 Mar 2005 11:54:18 + or thereabout, Dmitry Torokhov wrote: > On Fri, 04 Mar 2005 17:20:24 +0100, Hans-Christian Egtvedt <[EMAIL > PROTECTED]> wrote: >> On Fri, 2005-03-04 at 09:52 -0500, Dmitry Torokhov wrote: >> > On Fri, 4 Mar 2005 14:03:37 +0200, Alexey Dobriyan <[EMAIL PROTECTED]> >> > wrote: >> > > On Friday 04 March 2005 12:30, Hans-Christian Egtvedt wrote: >> > As far as the driver goes: >> > >> > - yes, it does need input_sync; >> One problem with input_sync is that the panel get's too fast, and double >> click is experienced quite often, maybe some threshold is needed for low >> values in Z-direction? >> >> I'm probably doing something wrong here since I experience easy >> doubleclicks when I just lightly touch the screen. > Yes, I think you need to use some threshold when reporting BTN_TOUCH > event. Still, always report ABS_PRESSURE as is. This way the > touchscreen is useable via legacy interfaces (mousedev. tsdev) and if > a specialized userspace driver is written it still can get pretty much > unmangled data from /dev/input/eventX. This will also allow such > driver adjust touchpad sensitivity, if needed. OK, I'll try to find some better documentation about input devices, any tips/pointers would be nice. I'm completly new to kernel drivers, I'm used to writing drivers in embedded systems. The driver is made in the way it is today because there is also a driver for X which read raw events from /dev/input/eventX. It's called lictouch, I have the source for it too, but I'm not (yet) part of any developing there. It would be a really nice feature if one could use the touchscreen as a legacy interface, but then I would need to be able to calibrate the screen in the driver and not frontend. At least preferable. >> > Also, is there a way to query the screen for actual size? >> >> Sorry, the panel is a fixed size, and it gives out coordinates from 0 -> >> 4095 in both X- and Y-direction. In Z-direction (pressure strength) it >> goes from 0 to 255. >> >> Or did you want the size of the screen? Meaning you want to know if it's >> a 15", 17" and so on? > No, not physical sizes. I was wondering if soe touchscreens are > reporting let's say actual coordinates from 1100-3600 and others from > 600-3850, instead of full 0-4096. Is there a way to query the hardware > and find the actual min and max for a device so it can be reported to > userspace. I really don't have an answer, I'm still waiting for the datascheet to the controller beeing used. When I get that I can perhaps do calibration in the driver, and not with a config file or in xf86free/x.org config. -- Regards Hans-Christian Egtvedt MIVU Solutions DA - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] new driver for ITM Touch touchscreen
On Fri, 04 Mar 2005 17:20:24 +0100, Hans-Christian Egtvedt <[EMAIL PROTECTED]> wrote: > On Fri, 2005-03-04 at 09:52 -0500, Dmitry Torokhov wrote: > > On Fri, 4 Mar 2005 14:03:37 +0200, Alexey Dobriyan <[EMAIL PROTECTED]> > > wrote: > > > On Friday 04 March 2005 12:30, Hans-Christian Egtvedt wrote: > > > > > As far as the driver goes: > > > > - yes, it does need input_sync; > > One problem with input_sync is that the panel get's too fast, and double > click is experienced quite often, maybe some threshold is needed for low > values in Z-direction? > > I'm probably doing something wrong here since I experience easy > doubleclicks when I just lightly touch the screen. > Yes, I think you need to use some threshold when reporting BTN_TOUCH event. Still, always report ABS_PRESSURE as is. This way the touchscreen is useable via legacy interfaces (mousedev. tsdev) and if a specialized userspace driver is written it still can get pretty much unmangled data from /dev/input/eventX. This will also allow such driver adjust touchpad sensitivity, if needed. > > Also, is there a way to query the screen for actual size? > > Sorry, the panel is a fixed size, and it gives out coordinates from 0 -> > 4095 in both X- and Y-direction. In Z-direction (pressure strength) it > goes from 0 to 255. > > Or did you want the size of the screen? Meaning you want to know if it's > a 15", 17" and so on? > No, not physical sizes. I was wondering if soe touchscreens are reporting let's say actual coordinates from 1100-3600 and others from 600-3850, instead of full 0-4096. Is there a way to query the hardware and find the actual min and max for a device so it can be reported to userspace. -- Dmitry P.S. When you post the updated version could you please CC Vojtech Pavlik <[EMAIL PROTECTED]> as he is the current input system maintainer and linux-input mailing list at [EMAIL PROTECTED] Thanks! - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] new driver for ITM Touch touchscreen
On Fri, 2005-03-04 at 09:52 -0500, Dmitry Torokhov wrote: > On Fri, 4 Mar 2005 14:03:37 +0200, Alexey Dobriyan <[EMAIL PROTECTED]> wrote: > > On Friday 04 March 2005 12:30, Hans-Christian Egtvedt wrote: > As far as the driver goes: > > - yes, it does need input_sync; One problem with input_sync is that the panel get's too fast, and double click is experienced quite often, maybe some threshold is needed for low values in Z-direction? I'm probably doing something wrong here since I experience easy doubleclicks when I just lightly touch the screen. > - I prefer using input_set_abs_params instead of setting mix, max, > flat and fuzz for each axis manually; Thanks, I've adopted to those now, havn't had time to test with the panel today, but my guess is that this dosn't make a big deal. > - I believe "/* .. */" is preferred over "//" Done. > - kill the commented out bad prototypes. Done. > Also, is there a way to query the screen for actual size? Sorry, the panel is a fixed size, and it gives out coordinates from 0 -> 4095 in both X- and Y-direction. In Z-direction (pressure strength) it goes from 0 to 255. Or did you want the size of the screen? Meaning you want to know if it's a 15", 17" and so on? -- Hans-Christian Egtvedt <[EMAIL PROTECTED]> MIVU Solutions DA - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] new driver for ITM Touch touchscreen
On Fri, 4 Mar 2005 14:03:37 +0200, Alexey Dobriyan <[EMAIL PROTECTED]> wrote: > On Friday 04 March 2005 12:30, Hans-Christian Egtvedt wrote: > > > I've ported the works from Chris Collins so the drivers compiles without > > warnings and works (for me) with Linux 2.6.10 and 2.6.11. > > > Any comments on the driver would be much appreciated. > > > +struct itmtouch_dev { > > > + int refcount; // > > There is already generic interface for reference-counted objects. See > lib/kref.c and kref documentation at: > > http://marc.theaimsgroup.com/?l=linux-kernel&m=110987233406767&w=2 > ... which is absolutely unusable for this particular purpose - the touchscreen object is not going away when refcount is 0. The variable shoudl be renamed to "users" or something. Moreover it needs locking. Anyway, all of this will be handled by the input core very shortly so it can be left as is for now. As far as the driver goes: - yes, it does need input_sync; - I prefer using input_set_abs_params instead of setting mix, max, flat and fuzz for each axis manually; - I believe "/* .. */" is preferred over "//" - kill the commented out bad prototypes. Also, is there a way to query the screen for actual size? -- Dmitry - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] new driver for ITM Touch touchscreen
On Friday 04 March 2005 12:30, Hans-Christian Egtvedt wrote: > I've ported the works from Chris Collins so the drivers compiles without > warnings and works (for me) with Linux 2.6.10 and 2.6.11. > Any comments on the driver would be much appreciated. > +struct itmtouch_dev { > + int refcount; // There is already generic interface for reference-counted objects. See lib/kref.c and kref documentation at: http://marc.theaimsgroup.com/?l=linux-kernel&m=110987233406767&w=2 Alexey - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] new driver for ITM Touch touchscreen
Hi! I've ported the works from Chris Collins so the drivers compiles without warnings and works (for me) with Linux 2.6.10 and 2.6.11. The driver is not in the kernel now, but I would like to see it be a driver among all the other touchscreen drivers. The touchscreen panel is for example used on the LG L1510SF screen. Any comments on the driver would be much appreciated. -- Regards, Hans-Christian Egtvedt <[EMAIL PROTECTED]> MIVU Solutions DA --- kernel-source-2.6.11/drivers/usb/input/Kconfig 2004-12-24 22:35:23.0 +0100 +++ linux-2.6.11/drivers/usb/input/Kconfig 2005-03-02 10:58:41.0 +0100 @@ -190,6 +190,18 @@ To compile this driver as a module, choose M here: the module will be called mtouchusb. +config USB_ITMTOUCH + tristate "ITM Touch USB Touchscreen Driver" + depends on USB && INPUT + ---help--- + Say Y here if you want to use a ITM Touch USB + Touchscreen controller. + + This touchscreen is used in LG 1510SF monitors. + + To compile this driver as a module, choose M here: the + module will be called itmtouch. + config USB_EGALAX tristate "eGalax TouchKit USB Touchscreen Driver" depends on USB && INPUT --- kernel-source-2.6.11/drivers/usb/input/Makefile 2004-12-24 22:35:00.0 +0100 +++ linux-2.6.11/drivers/usb/input/Makefile 2005-03-02 10:57:11.0 +0100 @@ -33,6 +33,7 @@ obj-$(CONFIG_USB_KBTAB) += kbtab.o obj-$(CONFIG_USB_MOUSE) += usbmouse.o obj-$(CONFIG_USB_MTOUCH) += mtouchusb.o +obj-$(CONFIG_USB_ITMTOUCH) += itmtouch.o obj-$(CONFIG_USB_EGALAX) += touchkitusb.o obj-$(CONFIG_USB_POWERMATE) += powermate.o obj-$(CONFIG_USB_WACOM) += wacom.o --- /dev/null 2005-03-01 19:15:30.0 +0100 +++ linux-2.6.11/drivers/usb/input/itmtouch.c 2005-03-02 11:05:04.0 +0100 @@ -0,0 +1,326 @@ +/** + * itmtouch.c -- Driver for ITM touchscreen panel + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * Based upon original work by Chris Collins <[EMAIL PROTECTED]>. + * + * History + * 1.0 & 1.1 2003 (CC) [EMAIL PROTECTED] + * Original version for 2.4.x kernels + * + * 1.2 02/03/2005 (HCE) [EMAIL PROTECTED] + * Complete rewrite to support Linux 2.6.10, thanks to mtouchusb.c for hints. + * Unfortunately no calibration support at this time. + * + */ + +/* In order to prevent poluting device space with YET ANOTHER character + * device, this driver pumps out raw coordinate events into the input + * event stream. + * + * They can be extracted using the input core raw events module. + * + * Kudos to ITM for providing me with the datasheet for the panel, + * even though it was a day later than I had finished writing this + * driver. + * + * It has meant that I've been able to correct my interpretation of the + * protocol packets however. + * + * CC -- 2003/9/29 + */ + +#include + +#ifdef CONFIG_USB_DEBUG + #define DEBUG +#else + #undef DEBUG +#endif + +#include +#include +#include +#include +#include +#include + +/* only an 8 byte buffer necessary for a single packet */ +#define ITM_BUFSIZE 8 +/* support a maximum of 4 such touchscreens at once */ +#define MAXTOUCH 4 +#define UCP(x)((unsigned char*)(x)) +#define UCOM(x,y,z) ((UCP((x)->transfer_buffer)[y]) & (z)) +#define PATH_SIZE 64 + +#define USB_VENDOR_ID_ITMINC 0x0403 +#define USB_PRODUCT_ID_TOUCHPANEL 0xf9e9 + +#define DRIVER_AUTHOR "Hans-Christian Egtvedt <[EMAIL PROTECTED]>" +#define DRIVER_VERSION "v1.2" +#define DRIVER_DESC "USB ITM Inc Touch Panel Driver" +#define DRIVER_LICENSE "GPL" + +struct itmtouch_dev { + struct usb_device *usbdev; // usb device + struct input_dev inputdev; // input device + struct urb *readurb; // urb + char rbuf[ITM_BUFSIZE]; // data + int refcount; // + char name[128]; + char phys[64]; +}; + +struct usb_device_id itmtouch_ids [] = { + { USB_DEVICE(USB_VENDOR_ID_ITMINC, USB_PRODUCT_ID_TOUCHPANEL) }, + { } +}; + +static void itmtouch_irq(struct urb *urb, struct pt_regs *regs) +{ + struct itmtouch_dev * itmtouch = urb->context; + int retval; + + switch (urb->status) { +case 0: +/* success */ +break; +case -ETIMEDOUT: +