usbtouchscreen: add support for DMC TSC-10/25 devices
Adds support for the DMC TSC-10 and TSC-25 usb touchscreen controllers. Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de> Signed-off-by: Daniel Ritz <daniel.ritz@gmx.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
9ce8540c88
commit
24ced062a2
@ -221,6 +221,7 @@ config USB_TOUCHSCREEN
|
|||||||
- ITM
|
- ITM
|
||||||
- some other eTurboTouch
|
- some other eTurboTouch
|
||||||
- Gunze AHL61
|
- Gunze AHL61
|
||||||
|
- DMC TSC-10/25
|
||||||
|
|
||||||
Have a look at <http://linux.chapter7.ch/touchkit/> for
|
Have a look at <http://linux.chapter7.ch/touchkit/> for
|
||||||
a usage description and the required user-space stuff.
|
a usage description and the required user-space stuff.
|
||||||
@ -258,6 +259,11 @@ config USB_TOUCHSCREEN_GUNZE
|
|||||||
bool "Gunze AHL61 device support" if EMBEDDED
|
bool "Gunze AHL61 device support" if EMBEDDED
|
||||||
depends on USB_TOUCHSCREEN
|
depends on USB_TOUCHSCREEN
|
||||||
|
|
||||||
|
config USB_TOUCHSCREEN_DMC_TSC10
|
||||||
|
default y
|
||||||
|
bool "DMC TSC-10/25 device support" if EMBEDDED
|
||||||
|
depends on USB_TOUCHSCREEN
|
||||||
|
|
||||||
config USB_YEALINK
|
config USB_YEALINK
|
||||||
tristate "Yealink usb-p1k voip phone"
|
tristate "Yealink usb-p1k voip phone"
|
||||||
depends on USB && INPUT && EXPERIMENTAL
|
depends on USB && INPUT && EXPERIMENTAL
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
* - PanJit TouchSet
|
* - PanJit TouchSet
|
||||||
* - eTurboTouch
|
* - eTurboTouch
|
||||||
* - Gunze AHL61
|
* - Gunze AHL61
|
||||||
|
* - DMC TSC-10/25
|
||||||
*
|
*
|
||||||
* Copyright (C) 2004-2006 by Daniel Ritz <daniel.ritz@gmx.ch>
|
* Copyright (C) 2004-2006 by Daniel Ritz <daniel.ritz@gmx.ch>
|
||||||
* Copyright (C) by Todd E. Johnson (mtouchusb.c)
|
* Copyright (C) by Todd E. Johnson (mtouchusb.c)
|
||||||
@ -30,6 +31,8 @@
|
|||||||
* - ITM parts are from itmtouch.c
|
* - ITM parts are from itmtouch.c
|
||||||
* - 3M parts are from mtouchusb.c
|
* - 3M parts are from mtouchusb.c
|
||||||
* - PanJit parts are from an unmerged driver by Lanslott Gish
|
* - PanJit parts are from an unmerged driver by Lanslott Gish
|
||||||
|
* - DMC TSC 10/25 are from Holger Schurig, with ideas from an unmerged
|
||||||
|
* driver from Marius Vollmer
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
@ -44,7 +47,7 @@
|
|||||||
#include <linux/usb/input.h>
|
#include <linux/usb/input.h>
|
||||||
|
|
||||||
|
|
||||||
#define DRIVER_VERSION "v0.4"
|
#define DRIVER_VERSION "v0.5"
|
||||||
#define DRIVER_AUTHOR "Daniel Ritz <daniel.ritz@gmx.ch>"
|
#define DRIVER_AUTHOR "Daniel Ritz <daniel.ritz@gmx.ch>"
|
||||||
#define DRIVER_DESC "USB Touchscreen Driver"
|
#define DRIVER_DESC "USB Touchscreen Driver"
|
||||||
|
|
||||||
@ -103,6 +106,7 @@ enum {
|
|||||||
DEVTYPE_ITM,
|
DEVTYPE_ITM,
|
||||||
DEVTYPE_ETURBO,
|
DEVTYPE_ETURBO,
|
||||||
DEVTYPE_GUNZE,
|
DEVTYPE_GUNZE,
|
||||||
|
DEVTYPE_DMC_TSC10,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct usb_device_id usbtouch_devices[] = {
|
static struct usb_device_id usbtouch_devices[] = {
|
||||||
@ -139,6 +143,10 @@ static struct usb_device_id usbtouch_devices[] = {
|
|||||||
{USB_DEVICE(0x0637, 0x0001), .driver_info = DEVTYPE_GUNZE},
|
{USB_DEVICE(0x0637, 0x0001), .driver_info = DEVTYPE_GUNZE},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_USB_TOUCHSCREEN_DMC_TSC10
|
||||||
|
{USB_DEVICE(0x0afa, 0x03e8), .driver_info = DEVTYPE_DMC_TSC10},
|
||||||
|
#endif
|
||||||
|
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -312,6 +320,80 @@ static int gunze_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
* DMC TSC-10/25 Part
|
||||||
|
*
|
||||||
|
* Documentation about the controller and it's protocol can be found at
|
||||||
|
* http://www.dmccoltd.com/files/controler/tsc10usb_pi_e.pdf
|
||||||
|
* http://www.dmccoltd.com/files/controler/tsc25_usb_e.pdf
|
||||||
|
*/
|
||||||
|
#ifdef CONFIG_USB_TOUCHSCREEN_DMC_TSC10
|
||||||
|
|
||||||
|
/* supported data rates. currently using 130 */
|
||||||
|
#define TSC10_RATE_POINT 0x50
|
||||||
|
#define TSC10_RATE_30 0x40
|
||||||
|
#define TSC10_RATE_50 0x41
|
||||||
|
#define TSC10_RATE_80 0x42
|
||||||
|
#define TSC10_RATE_100 0x43
|
||||||
|
#define TSC10_RATE_130 0x44
|
||||||
|
#define TSC10_RATE_150 0x45
|
||||||
|
|
||||||
|
/* commands */
|
||||||
|
#define TSC10_CMD_RESET 0x55
|
||||||
|
#define TSC10_CMD_RATE 0x05
|
||||||
|
#define TSC10_CMD_DATA1 0x01
|
||||||
|
|
||||||
|
static int dmc_tsc10_init(struct usbtouch_usb *usbtouch)
|
||||||
|
{
|
||||||
|
struct usb_device *dev = usbtouch->udev;
|
||||||
|
int ret;
|
||||||
|
unsigned char buf[2];
|
||||||
|
|
||||||
|
/* reset */
|
||||||
|
buf[0] = buf[1] = 0xFF;
|
||||||
|
ret = usb_control_msg(dev, usb_rcvctrlpipe (dev, 0),
|
||||||
|
TSC10_CMD_RESET,
|
||||||
|
USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
|
||||||
|
0, 0, buf, 2, USB_CTRL_SET_TIMEOUT);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
if (buf[0] != 0x06 || buf[1] != 0x00)
|
||||||
|
return -ENODEV;
|
||||||
|
|
||||||
|
/* set coordinate output rate */
|
||||||
|
buf[0] = buf[1] = 0xFF;
|
||||||
|
ret = usb_control_msg(dev, usb_rcvctrlpipe (dev, 0),
|
||||||
|
TSC10_CMD_RATE,
|
||||||
|
USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
|
||||||
|
TSC10_RATE_150, 0, buf, 2, USB_CTRL_SET_TIMEOUT);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
if (buf[0] != 0x06 || buf[1] != 0x00)
|
||||||
|
return -ENODEV;
|
||||||
|
|
||||||
|
/* start sending data */
|
||||||
|
ret = usb_control_msg(dev, usb_rcvctrlpipe (dev, 0),
|
||||||
|
TSC10_CMD_DATA1,
|
||||||
|
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
|
||||||
|
0, 0, NULL, 0, USB_CTRL_SET_TIMEOUT);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int dmc_tsc10_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *press)
|
||||||
|
{
|
||||||
|
*x = ((pkt[2] & 0x03) << 8) | pkt[1];
|
||||||
|
*y = ((pkt[4] & 0x03) << 8) | pkt[3];
|
||||||
|
*touch = pkt[0] & 0x01;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* the different device descriptors
|
* the different device descriptors
|
||||||
*/
|
*/
|
||||||
@ -389,6 +471,18 @@ static struct usbtouch_device_info usbtouch_dev_info[] = {
|
|||||||
.read_data = gunze_read_data,
|
.read_data = gunze_read_data,
|
||||||
},
|
},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_USB_TOUCHSCREEN_DMC_TSC10
|
||||||
|
[DEVTYPE_DMC_TSC10] = {
|
||||||
|
.min_xc = 0x0,
|
||||||
|
.max_xc = 0x03ff,
|
||||||
|
.min_yc = 0x0,
|
||||||
|
.max_yc = 0x03ff,
|
||||||
|
.rept_size = 5,
|
||||||
|
.init = dmc_tsc10_init,
|
||||||
|
.read_data = dmc_tsc10_read_data,
|
||||||
|
},
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user