Android u 触摸屏驱动手机u驱动「Android u 触摸屏驱动」
时间2025-01-16 19:08:07发布yu分类文章浏览128
导读:/****************************************************************************** * utouchscreen.c * Driver for U Touchscreens, supporting those devices: * - eGalax Touchk...
/******************************************************************************
* utouchscreen.c
* Driver for U Touchscreens, supporting those devices:
* - eGalax Touchkit
* includes eTurboTouch CT-410/510/700
* - 3M/Microtouch EX II series
* - ITM
* - PanJit TouchSet
* - eTurboTouch
* - Gunze AHL61
* - DMC TSC-10/25
* - IRTOUCHSYSTEMS/UNITOP
* - IdealTEK URTC1000
* - General Touch
* - GoTop Super_Q2/GogoPen/PenPower tablets
* - JASTEC U touch controller/DigiTech DTR-02U
* - Zytronic capacitive touchscreen
* - NEXIO/iNexio
*
* Copyright (C) 2004-2007 by Daniel Ritz
* Copyright (C) by Todd E. Johnson (mtouchu.c)
*
* 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.
*
* Driver is based on touchkitu.c
* - ITM parts are from itmtouch.c
* - 3M parts are from mtouchu.c
* - 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
*
*****************************************************************************/
//#define DEBUG
#include
#include
#include
#include
#include
#include
#include
#include
#define DRIVER_VERSION "v0.6"
#define DRIVER_AUTHOR "Daniel Ritz "
#define DRIVER_DESC "USB Touchscreen Driver"
static int swap_xy;
module_param(swap_xy, bool, 0644);
MODULE_PARM_DESC(swap_xy, "If set X and Y axes are swapped.");
static int hwcalib_xy;
module_param(hwcalib_xy, bool, 0644);
MODULE_PARM_DESC(hwcalib_xy, "If set hw-calibrated X/Y are used if available");
static int calibration[9]={
527000,
1000,
-162648000,
1650,
402450,
-134121600,
2356550,
};
//module_param_array(calibration, int, NULL, S_IRUGO | S_IWUSR);
/* device specifc data/functions */
struct usbtouch_usb;
struct usbtouch_device_info {
int min_xc, max_xc;
int min_yc, max_yc;
int min_press, max_press;
int rept_size;
/*
* Always service the USB devices irq not just when the input device is
* open. This is useful when devices have a watchdog which prevents us
* from periodically polling the device. Leave this unset unless your
* touchscreen device requires it, as it does consume more of the USB
* bandwidth.
*/
bool irq_always;
void (*process_pkt) (struct usbtouch_usb *usbtouch, unsigned char *pkt, int len);
/*
* used to get the packet len. possible return values:
* > 0: packet len
* = 0: skip one byte
* < 0: -return value more bytes needed
*/
int (*get_pkt_len) (unsigned char *pkt, int len);
int (*read_data) (struct utouch_u *utouch, unsigned char *pkt);
int (*alloc) (struct utouch_u *utouch);
int (*init) (struct utouch_u *utouch);
void (*exit) (struct utouch_u *utouch);
};
/* a utouch device */
struct utouch_u {
unsigned char *data;
dma_addr_t data_dma;
unsigned char *buffer;
int buf_len;
struct urb *irq;
struct u_interface *interface;
struct input_dev *input;
struct utouch_device_info *type;
char name[128];
char phys[64];
void *priv;
int x, y;
int touch, press;
};
/* device types */
enum {
DEVTYPE_IGNORE = -1,
DEVTYPE_EGALAX,
DEVTYPE_PANJIT,
DEVTYPE_3M,
DEVTYPE_ITM,
DEVTYPE_ETURBO,
DEVTYPE_GUNZE,
DEVTYPE_DMC_TSC10,
DEVTYPE_IRTOUCH,
DEVTYPE_IDEALTEK,
DEVTYPE_GENERAL_TOUCH,
DEVTYPE_GOTOP,
DEVTYPE_JASTEC,
DEVTYPE_E2I,
DEVTYPE_ZYTRONIC,
DEVTYPE_TC45U,
DEVTYPE_NEXIO,
};
#define U_DEVICE_HID_CLASS(vend, prod)
.match_flags = U_DEVICE_ID_MATCH_INT_CLASS
| U_DEVICE_ID_MATCH_INT_PROTOCOL
| U_DEVICE_ID_MATCH_DEVICE,
.idVendor = (vend),
.idProduct = (prod),
.bInterfaceClass = U_INTERFACE_CLASS_HID,
.bInterfaceProtocol = U_INTERFACE_PROTOCOL_MOUSE
static const struct u_device_id utouch_devices[] = {
#ifdef CONFIG_TOUCHSCREEN_U_EGALAX
/* ignore the HID capable devices, handled by uhid */
{U_DEVICE_HID_CLASS(0x0eef, 0x0001), .driver_info = DEVTYPE_IGNORE},
{U_DEVICE_HID_CLASS(0x0eef, 0x0002), .driver_info = DEVTYPE_IGNORE},
/* normal device IDs */
{U_DEVICE(0x3823, 0x0001), .driver_info = DEVTYPE_EGALAX},
{U_DEVICE(0x3823, 0x0002), .driver_info = DEVTYPE_EGALAX},
{U_DEVICE(0x0123, 0x0001), .driver_info = DEVTYPE_EGALAX},
{U_DEVICE(0x0eef, 0x0001), .driver_info = DEVTYPE_EGALAX},
{U_DEVICE(0x0eef, 0x0002), .driver_info = DEVTYPE_EGALAX},
{U_DEVICE(0x1234, 0x0001), .driver_info = DEVTYPE_EGALAX},
{U_DEVICE(0x1234, 0x0002), .driver_info = DEVTYPE_EGALAX},
#endif
#ifdef CONFIG_TOUCHSCREEN_U_PANJIT
{U_DEVICE(0x134c, 0x0001), .driver_info = DEVTYPE_PANJIT},
{U_DEVICE(0x134c, 0x0002), .driver_info = DEVTYPE_PANJIT},
{U_DEVICE(0x134c, 0x0003), .driver_info = DEVTYPE_PANJIT},
{U_DEVICE(0x134c, 0x0004), .driver_info = DEVTYPE_PANJIT},
#endif
#ifdef CONFIG_TOUCHSCREEN_U_3M
{U_DEVICE(0x0596, 0x0001), .driver_info = DEVTYPE_3M},
#endif
#ifdef CONFIG_TOUCHSCREEN_U_ITM
{U_DEVICE(0x0403, 0xf9e9), .driver_info = DEVTYPE_ITM},
{U_DEVICE(0x16e3, 0xf9e9), .driver_info = DEVTYPE_ITM},
#endif
#ifdef CONFIG_TOUCHSCREEN_U_ETURBO
{U_DEVICE(0x1234, 0x5678), .driver_info = DEVTYPE_ETURBO},
#endif
#ifdef CONFIG_TOUCHSCREEN_U_GUNZE
{U_DEVICE(0x0637, 0x0001), .driver_info = DEVTYPE_GUNZE},
#endif
#ifdef CONFIG_TOUCHSCREEN_U_DMC_TSC10
{U_DEVICE(0x0afa, 0x03e8), .driver_info = DEVTYPE_DMC_TSC10},
#endif
#ifdef CONFIG_TOUCHSCREEN_U_IRTOUCH
{U_DEVICE(0x595a, 0x0001), .driver_info = DEVTYPE_IRTOUCH},
{U_DEVICE(0x6615, 0x0001), .driver_info = DEVTYPE_IRTOUCH},
#endif
#ifdef CONFIG_TOUCHSCREEN_U_IDEALTEK
{U_DEVICE(0x1391, 0x1000), .driver_info = DEVTYPE_IDEALTEK},
#endif
#ifdef CONFIG_TOUCHSCREEN_U_GENERAL_TOUCH
{U_DEVICE(0x0dfc, 0x0001), .driver_info = DEVTYPE_GENERAL_TOUCH},
#endif
#ifdef CONFIG_TOUCHSCREEN_U_GOTOP
{U_DEVICE(0x08f2, 0x007f), .driver_info = DEVTYPE_GOTOP},
{U_DEVICE(0x08f2, 0x00ce), .driver_info = DEVTYPE_GOTOP},
{U_DEVICE(0x08f2, 0x00f4), .driver_info = DEVTYPE_GOTOP},
#endif
#ifdef CONFIG_TOUCHSCREEN_U_JASTEC
{U_DEVICE(0x0f92, 0x0001), .driver_info = DEVTYPE_JASTEC},
#endif
#ifdef CONFIG_TOUCHSCREEN_U_E2I
{U_DEVICE(0x1ac7, 0x0001), .driver_info = DEVTYPE_E2I},
#endif
#ifdef CONFIG_TOUCHSCREEN_U_ZYTRONIC
{U_DEVICE(0x14c8, 0x0003), .driver_info = DEVTYPE_ZYTRONIC},
#endif
#ifdef CONFIG_TOUCHSCREEN_U_ETT_TC45U
/* TC5UH */
{U_DEVICE(0x0664, 0x0309), .driver_info = DEVTYPE_TC45U},
/* TC4UM */
{U_DEVICE(0x0664, 0x0306), .driver_info = DEVTYPE_TC45U},
#endif
#ifdef CONFIG_TOUCHSCREEN_U_NEXIO
/* data interface only */
{U_DEVICE_AND_INTERFACE_INFO(0x10f0, 0x2002, 0x0a, 0x00, 0x00),
.driver_info = DEVTYPE_NEXIO},
{U_DEVICE_AND_INTERFACE_INFO(0x1870, 0x0001, 0x0a, 0x00, 0x00),
.driver_info = DEVTYPE_NEXIO},
#endif
{}
};
/*****************************************************************************
* e2i Part
*/
#ifdef CONFIG_TOUCHSCREEN_U_E2I宣威版权声明:本网信息来自于互联网,目的在于传递更多信息,并不代表本网赞同其观点。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,并请自行核实相关内容。本站不承担此类作品侵权行为的直接责任及连带责任。如若本网有任何内容侵犯您的权益,请及时联系我们,本站将会在24小时内处理完毕,E-mail:xinmeigg88@163.com