summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2010-08-25 13:02:14 +0200
committerHenrik Rydberg <rydberg@euromail.se>2010-08-25 13:02:14 +0200
commit14ff3671081190349b51d0183fa7c24be1b852aa (patch)
tree2325b61c8a02195edb300c909d7914506e423a28
initial version with Dell XT2 support only
-rw-r--r--.gitignore3
-rw-r--r--GIT1
-rw-r--r--HACKING27
-rw-r--r--Makefile30
-rw-r--r--debian/README.Debian15
-rw-r--r--debian/changelog6
-rw-r--r--debian/compat1
-rw-r--r--debian/control13
-rw-r--r--debian/copyright28
-rw-r--r--debian/dirs1
-rw-r--r--debian/postinst71
-rw-r--r--debian/postrm27
-rw-r--r--debian/prerm28
-rwxr-xr-xdebian/rules53
-rwxr-xr-xscripts/patch-name-version.sh9
-rw-r--r--usr/src/dkms_main_tree/dkms_dbversion1
-rw-r--r--usr/src/dkms_source_tree/Makefile5
-rw-r--r--usr/src/dkms_source_tree/dkms.conf10
-rw-r--r--usr/src/dkms_source_tree/hid-ids.h530
-rw-r--r--usr/src/dkms_source_tree/hid-ntrig.c362
20 files changed, 1221 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..f682682
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
1.bzr
2.bzrignore
3usr/src/bcm5974-*.dkms.tar.gz
diff --git a/GIT b/GIT
new file mode 100644
index 0000000..2fe3544
--- /dev/null
+++ b/GIT
@@ -0,0 +1 @@
git-clone http://bitmath.org/git/hid-ntrig-dkms.git
diff --git a/HACKING b/HACKING
new file mode 100644
index 0000000..4a27fda
--- /dev/null
+++ b/HACKING
@@ -0,0 +1,27 @@
1Modifying and building the DKMS package
2
31. use bzr to sync source with launchpad
4
52. make your changes
6
73. modify the VERSION variable in Makefile, then do
8
9 make bump
10
114. add a new entry to debian/changelog, matching VERSION
12
135. build binary package for testing with
14
15 dpkg-buildpackage
16
176. clean the checkout with
18
19 make distclean
20
217. build source package for upload with
22
23 debuild -S -sa
24
258. upload packacke to ppa with (see ~/.dput.cf)
26
27 dput your-mactel-ppa-dput-entry name-and-version_source.changes
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..b99b8bb
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,30 @@
1NAME = hid-ntrig
2VERSION = 1.0.0
3SRC = usr/src
4
5TARBALL = $(NAME)-$(VERSION).dkms.tar.gz
6PATCH = ./scripts/patch-name-version.sh $(NAME) $(VERSION)
7
8all: $(SRC)/$(TARBALL)
9
10$(SRC)/$(TARBALL): $(SRC)/dkms_source_tree/hid-ntrig.c
11 (cd $(SRC); tar cvfz $(TARBALL) dkms*)
12
13clean:
14 rm -f $(SRC)/$(TARBALL)
15
16distclean: clean
17 rm -rf *-stamp debian/$(NAME)-dkms debian/*.log debian/files
18
19install: $(SRC)/$(TARBALL)
20 install -d "$(DESTDIR)/$(SRC)"
21 install -m 644 $(SRC)/$(NAME)-$(VERSION).dkms.tar.gz "$(DESTDIR)/$(SRC)"
22
23bump:
24 $(PATCH) debian/postinst
25 $(PATCH) debian/postrm
26 $(PATCH) debian/prerm
27 $(PATCH) debian/rules
28 $(PATCH) debian/postinst
29 $(PATCH) usr/src/dkms_source_tree/dkms.conf
30 chmod 0755 debian/rules
diff --git a/debian/README.Debian b/debian/README.Debian
new file mode 100644
index 0000000..25b433d
--- /dev/null
+++ b/debian/README.Debian
@@ -0,0 +1,15 @@
1hid-ntrig DKMS module for Debian
2
3hid-ntrig: This driver adds MT support for the Dell XT2
4
5* Install the debian package (uses dkms)
6
7* Reboot
8
9Post installation
10
11* Make sure your /etc/X11/xorg.conf settings are sane.
12
13Enjoy!
14
15Henrik Rydberg <rydberg@bitmath.org>
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..1ff4aee
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,6 @@
1hid-ntrig-dkms (1.0.0-0ubuntu1) maverick; urgency=low
2
3 * Add support for Dell XT2 (hid-ntrig)
4
5 -- Henrik Rydberg <rydberg@bitmath.org> Fri, 13 Aug 2010 17:32:59 +0100
6
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..7ed6ff8
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
5
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..05eab82
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,13 @@
1Source: hid-ntrig-dkms
2Section: misc
3Priority: optional
4Maintainer: Henrik Rydberg <rydberg@bitmath.org>
5Build-Depends: debhelper (>= 5)
6Standards-Version: 3.7.2
7Homepage: http://bitmath.org/code/hid-ntrig-dkms/
8
9Package: hid-ntrig-dkms
10Architecture: all
11Depends: dkms (>= 1.95), bash (>> 1.99)
12Description: Supplementary multitouch support for Ntrig
13 This driver adds support for the Dell XT2.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..ad5c17e
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,28 @@
1The hid-ntrig-dkms package was created using DKMS <dkms-devel@dell.com>
2
3Source URL: http://bitmath.org/code/hid-ntrig-dkms/
4
5Upstream Author: Henrik Rydberg <rydberg@bitmath.org>
6
7Copyright:
8 Copyright (C) 2010 Henrik Rydberg (rydberg@bitmath.org)
9
10License:
11
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
16
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
21
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software
24 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25
26Packaging:
27 Copyright (C) 2010 by Henrik Rydberg <rydberg@bitmath.org>
28 released under GPL 2
diff --git a/debian/dirs b/debian/dirs
new file mode 100644
index 0000000..b601f22
--- /dev/null
+++ b/debian/dirs
@@ -0,0 +1 @@
usr/src
diff --git a/debian/postinst b/debian/postinst
new file mode 100644
index 0000000..a8c684c
--- /dev/null
+++ b/debian/postinst
@@ -0,0 +1,71 @@
1#!/bin/sh
2
3set -e
4
5NAME=hid-ntrig
6VERSION=1.0.0
7
8case "$1" in
9 configure)
10 # Determine current arch / kernel
11 c_arch=`uname -m`
12 c_kern=`uname -r`
13
14 if [ -e "/var/lib/dkms/$NAME/$VERSION" ]; then
15 echo "Removing old $NAME-$VERSION DKMS files..."
16 dkms remove -m $NAME -v $VERSION --all
17 fi
18
19 echo "Loading new $NAME-$VERSION DKMS files..."
20 #dkms add -m $NAME -v $VERSION
21 dkms ldtarball --archive "/usr/src/$NAME-$VERSION.dkms.tar.gz"
22 rm -f "/usr/src/$NAME-$VERSION.dkms.tar.gz"
23
24 echo "Installing prebuilt kernel module binaries (if any)"
25 set +e
26 IFS='
27'
28 for kern in `dkms status -m $NAME -v $VERSION -a $c_arch | grep ": built" | awk {'print $3'} | sed 's/,$//'`; do
29 echo "Trying kernel: $kern"
30 dkms install --force -m $NAME -v $VERSION -k $kern -a $c_arch
31 done
32 unset IFS
33 set -e
34
35 # If none installed, install.
36 ##if [ `dkms status -m $NAME -v $VERSION -k $c_kern -a $c_arch | grep -c ": installed"` -eq 0 ]; then
37 dkms_status=`dkms status -m $NAME -v $VERSION -k $c_kern -a $c_arch`
38 if [ `echo $dkms_status | grep -c ": installed"` -eq 0 ]; then
39 if [ `echo $c_kern | grep -c "BOOT"` -eq 0 ] && [ -e "/lib/modules/$c_kern/build/include" ]; then
40 # Only build if we need to.
41 if [ `echo $dkms_status | grep -c ": built"` -eq 0 ]; then
42 echo "Building module..."
43 dkms build -m $NAME -v $VERSION
44 fi
45 echo "Installing module..."
46 dkms install -m $NAME -v $VERSION
47 elif [ `echo $c_kern | grep -c "BOOT"` -gt 0 ]; then
48 echo -e ""
49 echo -e "Module build for the currently running kernel was skipped since you"
50 echo -e "are running a BOOT variant of the kernel."
51 else
52 echo -e ""
53 echo -e "Module build for the currently running kernel was skipped since the"
54 echo -e "kernel source for this kernel does not seem to be installed."
55 fi
56 fi
57 ;;
58
59 abort-upgrade|abort-remove|abort-deconfigure)
60 ;;
61
62 *)
63 echo "postinst called with unknown argument \`$1'" >&2
64 exit 1
65 ;;
66esac
67
68#DEBHELPER#
69
70exit 0
71
diff --git a/debian/postrm b/debian/postrm
new file mode 100644
index 0000000..60fa5ee
--- /dev/null
+++ b/debian/postrm
@@ -0,0 +1,27 @@
1#!/bin/sh
2
3NAME=hid-ntrig
4VERSION=1.0.0
5
6set -e
7
8case "$1" in
9 purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
10 moddir="/lib/modules/`uname -r`/kernel/"
11 depmod
12 if [ -d "/usr/src/$NAME-$VERSION" ]; then
13 echo "Removing old module source..."
14 rm -rf "/usr/src/$NAME-$VERSION"
15 fi
16 ;;
17
18 *)
19 echo "postrm called with unknown argument \`$1'" >&2
20 exit 1
21 ;;
22esac
23
24#DEBHELPER#
25
26exit 0
27
diff --git a/debian/prerm b/debian/prerm
new file mode 100644
index 0000000..a5e4880
--- /dev/null
+++ b/debian/prerm
@@ -0,0 +1,28 @@
1#!/bin/sh
2
3NAME=hid-ntrig
4VERSION=1.0.0
5
6set -e
7
8case "$1" in
9 remove|upgrade|deconfigure)
10 if [ "`dkms status -m $NAME`" ]; then
11 dkms remove -m $NAME -v $VERSION --all
12 fi
13 ;;
14
15 failed-upgrade)
16 ;;
17
18 *)
19 echo "prerm called with unknown argument \`$1'" >&2
20 exit 1
21 ;;
22esac
23
24#DEBHELPER#
25
26exit 0
27
28
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..878891f
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,53 @@
1#!/usr/bin/make -f
2# -*- makefile -*-
3
4# Uncomment this to turn on verbose mode.
5#export DH_VERBOSE=1
6
7NAME=hid-ntrig
8VERSION=1.0.0
9
10configure: configure-stamp
11configure-stamp:
12 dh_testdir
13 touch configure-stamp
14
15
16build: build-stamp
17
18build-stamp: configure-stamp
19 dh_testdir
20 $(MAKE)
21 touch $@
22
23clean:
24 dh_testdir
25 dh_testroot
26 rm -f build-stamp configure-stamp
27 -$(MAKE) clean
28 dh_clean
29
30install: build
31 dh_testdir
32 dh_testroot
33 dh_clean -k
34 dh_installdirs
35 $(MAKE) DESTDIR=$(CURDIR)/debian/$(NAME)-dkms NAME=$(NAME) VERSION=$(VERSION) install
36
37binary-arch: build install
38
39binary-indep: build install
40 dh_testdir
41 dh_testroot
42 dh_link
43 dh_strip
44 dh_compress
45 dh_fixperms
46 dh_installdeb
47 dh_shlibdeps
48 dh_gencontrol
49 dh_md5sums
50 dh_builddeb
51
52binary: binary-indep binary-arch
53.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/scripts/patch-name-version.sh b/scripts/patch-name-version.sh
new file mode 100755
index 0000000..d1a7796
--- /dev/null
+++ b/scripts/patch-name-version.sh
@@ -0,0 +1,9 @@
1#!/bin/sh
2#1: name
3#2: version
4#3: file
5cat $3 \
6| sed "s/^NAME=.*/NAME=$1/" \
7| sed "s/^VERSION=.*/VERSION=$2/" \
8> /tmp/$1.$$
9mv /tmp/$1.$$ $3
diff --git a/usr/src/dkms_main_tree/dkms_dbversion b/usr/src/dkms_main_tree/dkms_dbversion
new file mode 100644
index 0000000..227cea2
--- /dev/null
+++ b/usr/src/dkms_main_tree/dkms_dbversion
@@ -0,0 +1 @@
2.0.0
diff --git a/usr/src/dkms_source_tree/Makefile b/usr/src/dkms_source_tree/Makefile
new file mode 100644
index 0000000..f75f566
--- /dev/null
+++ b/usr/src/dkms_source_tree/Makefile
@@ -0,0 +1,5 @@
1#
2# Makefile for input/mouse drivers
3#
4
5obj-m := hid-ntrig.o
diff --git a/usr/src/dkms_source_tree/dkms.conf b/usr/src/dkms_source_tree/dkms.conf
new file mode 100644
index 0000000..8a2f828
--- /dev/null
+++ b/usr/src/dkms_source_tree/dkms.conf
@@ -0,0 +1,10 @@
1NAME=hid-ntrig
2VERSION=1.0.0
3PACKAGE_NAME="$NAME"
4PACKAGE_VERSION="$VERSION"
5MAKE[0]="make -C ${kernel_source_dir}
6 SUBDIRS=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build modules"
7BUILT_MODULE_NAME[0]="hid-ntrig"
8DEST_MODULE_LOCATION[0]="/kernel/drivers/hid"
9POST_INSTALL="scripts/hid-ntrig-post-install"
10AUTOINSTALL="yes"
diff --git a/usr/src/dkms_source_tree/hid-ids.h b/usr/src/dkms_source_tree/hid-ids.h
new file mode 100644
index 0000000..31601ee
--- /dev/null
+++ b/usr/src/dkms_source_tree/hid-ids.h
@@ -0,0 +1,530 @@
1/*
2 * USB HID quirks support for Linux
3 *
4 * Copyright (c) 1999 Andreas Gal
5 * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz>
6 * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc
7 * Copyright (c) 2006-2007 Jiri Kosina
8 * Copyright (c) 2007 Paul Walmsley
9 */
10
11/*
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the Free
14 * Software Foundation; either version 2 of the License, or (at your option)
15 * any later version.
16 */
17
18#ifndef HID_IDS_H_FILE
19#define HID_IDS_H_FILE
20
21#define USB_VENDOR_ID_3M 0x0596
22#define USB_DEVICE_ID_3M1968 0x0500
23#define USB_DEVICE_ID_3M2256 0x0502
24
25#define USB_VENDOR_ID_A4TECH 0x09da
26#define USB_DEVICE_ID_A4TECH_WCP32PU 0x0006
27#define USB_DEVICE_ID_A4TECH_X5_005D 0x000a
28
29#define USB_VENDOR_ID_AASHIMA 0x06d6
30#define USB_DEVICE_ID_AASHIMA_GAMEPAD 0x0025
31#define USB_DEVICE_ID_AASHIMA_PREDATOR 0x0026
32
33#define USB_VENDOR_ID_ACECAD 0x0460
34#define USB_DEVICE_ID_ACECAD_FLAIR 0x0004
35#define USB_DEVICE_ID_ACECAD_302 0x0008
36
37#define USB_VENDOR_ID_ADS_TECH 0x06e1
38#define USB_DEVICE_ID_ADS_TECH_RADIO_SI470X 0xa155
39
40#define USB_VENDOR_ID_AFATECH 0x15a4
41#define USB_DEVICE_ID_AFATECH_AF9016 0x9016
42
43#define USB_VENDOR_ID_AIPTEK 0x08ca
44#define USB_DEVICE_ID_AIPTEK_01 0x0001
45#define USB_DEVICE_ID_AIPTEK_10 0x0010
46#define USB_DEVICE_ID_AIPTEK_20 0x0020
47#define USB_DEVICE_ID_AIPTEK_21 0x0021
48#define USB_DEVICE_ID_AIPTEK_22 0x0022
49#define USB_DEVICE_ID_AIPTEK_23 0x0023
50#define USB_DEVICE_ID_AIPTEK_24 0x0024
51
52#define USB_VENDOR_ID_AIRCABLE 0x16CA
53#define USB_DEVICE_ID_AIRCABLE1 0x1502
54
55#define USB_VENDOR_ID_ALCOR 0x058f
56#define USB_DEVICE_ID_ALCOR_USBRS232 0x9720
57
58#define USB_VENDOR_ID_ALPS 0x0433
59#define USB_DEVICE_ID_IBM_GAMEPAD 0x1101
60
61#define USB_VENDOR_ID_APPLE 0x05ac
62#define USB_DEVICE_ID_APPLE_MIGHTYMOUSE 0x0304
63#define USB_DEVICE_ID_APPLE_MAGICMOUSE 0x030d
64#define USB_DEVICE_ID_APPLE_FOUNTAIN_ANSI 0x020e
65#define USB_DEVICE_ID_APPLE_FOUNTAIN_ISO 0x020f
66#define USB_DEVICE_ID_APPLE_GEYSER_ANSI 0x0214
67#define USB_DEVICE_ID_APPLE_GEYSER_ISO 0x0215
68#define USB_DEVICE_ID_APPLE_GEYSER_JIS 0x0216
69#define USB_DEVICE_ID_APPLE_GEYSER3_ANSI 0x0217
70#define USB_DEVICE_ID_APPLE_GEYSER3_ISO 0x0218
71#define USB_DEVICE_ID_APPLE_GEYSER3_JIS 0x0219
72#define USB_DEVICE_ID_APPLE_GEYSER4_ANSI 0x021a
73#define USB_DEVICE_ID_APPLE_GEYSER4_ISO 0x021b
74#define USB_DEVICE_ID_APPLE_GEYSER4_JIS 0x021c
75#define USB_DEVICE_ID_APPLE_ALU_MINI_ANSI 0x021d
76#define USB_DEVICE_ID_APPLE_ALU_MINI_ISO 0x021e
77#define USB_DEVICE_ID_APPLE_ALU_MINI_JIS 0x021f
78#define USB_DEVICE_ID_APPLE_ALU_ANSI 0x0220
79#define USB_DEVICE_ID_APPLE_ALU_ISO 0x0221
80#define USB_DEVICE_ID_APPLE_ALU_JIS 0x0222
81#define USB_DEVICE_ID_APPLE_WELLSPRING_ANSI 0x0223
82#define USB_DEVICE_ID_APPLE_WELLSPRING_ISO 0x0224
83#define USB_DEVICE_ID_APPLE_WELLSPRING_JIS 0x0225
84#define USB_DEVICE_ID_APPLE_GEYSER4_HF_ANSI 0x0229
85#define USB_DEVICE_ID_APPLE_GEYSER4_HF_ISO 0x022a
86#define USB_DEVICE_ID_APPLE_GEYSER4_HF_JIS 0x022b
87#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI 0x022c
88#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_ISO 0x022d
89#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_JIS 0x022e
90#define USB_DEVICE_ID_APPLE_WELLSPRING2_ANSI 0x0230
91#define USB_DEVICE_ID_APPLE_WELLSPRING2_ISO 0x0231
92#define USB_DEVICE_ID_APPLE_WELLSPRING2_JIS 0x0232
93#define USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI 0x0236
94#define USB_DEVICE_ID_APPLE_WELLSPRING3_ISO 0x0237
95#define USB_DEVICE_ID_APPLE_WELLSPRING3_JIS 0x0238
96#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI 0x0239
97#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO 0x023a
98#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS 0x023b
99#define USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY 0x030a
100#define USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY 0x030b
101#define USB_DEVICE_ID_APPLE_ATV_IRCONTROL 0x8241
102#define USB_DEVICE_ID_APPLE_IRCONTROL4 0x8242
103
104#define USB_VENDOR_ID_ASUS 0x0486
105#define USB_DEVICE_ID_ASUS_T91MT 0x0185
106
107#define USB_VENDOR_ID_ASUSTEK 0x0b05
108#define USB_DEVICE_ID_ASUSTEK_LCM 0x1726
109#define USB_DEVICE_ID_ASUSTEK_LCM2 0x175b
110
111#define USB_VENDOR_ID_ATEN 0x0557
112#define USB_DEVICE_ID_ATEN_UC100KM 0x2004
113#define USB_DEVICE_ID_ATEN_CS124U 0x2202
114#define USB_DEVICE_ID_ATEN_2PORTKVM 0x2204
115#define USB_DEVICE_ID_ATEN_4PORTKVM 0x2205
116#define USB_DEVICE_ID_ATEN_4PORTKVMC 0x2208
117
118#define USB_VENDOR_ID_AVERMEDIA 0x07ca
119#define USB_DEVICE_ID_AVER_FM_MR800 0xb800
120
121#define USB_VENDOR_ID_BELKIN 0x050d
122#define USB_DEVICE_ID_FLIP_KVM 0x3201
123
124#define USB_VENDOR_ID_BERKSHIRE 0x0c98
125#define USB_DEVICE_ID_BERKSHIRE_PCWD 0x1140
126
127#define USB_VENDOR_ID_BTC 0x046e
128#define USB_DEVICE_ID_BTC_EMPREX_REMOTE 0x5578
129
130#define USB_VENDOR_ID_CANDO 0x2087
131#define USB_DEVICE_ID_CANDO_MULTI_TOUCH 0x0a01
132#define USB_DEVICE_ID_CANDO_MULTI_TOUCH_11_6 0x0b03
133
134#define USB_VENDOR_ID_CH 0x068e
135#define USB_DEVICE_ID_CH_PRO_PEDALS 0x00f2
136#define USB_DEVICE_ID_CH_COMBATSTICK 0x00f4
137#define USB_DEVICE_ID_CH_FLIGHT_SIM_ECLIPSE_YOKE 0x0051
138#define USB_DEVICE_ID_CH_FLIGHT_SIM_YOKE 0x00ff
139#define USB_DEVICE_ID_CH_3AXIS_5BUTTON_STICK 0x00d3
140
141#define USB_VENDOR_ID_CHERRY 0x046a
142#define USB_DEVICE_ID_CHERRY_CYMOTION 0x0023
143#define USB_DEVICE_ID_CHERRY_CYMOTION_SOLAR 0x0027
144
145#define USB_VENDOR_ID_CHIC 0x05fe
146#define USB_DEVICE_ID_CHIC_GAMEPAD 0x0014
147
148#define USB_VENDOR_ID_CHICONY 0x04f2
149#define USB_DEVICE_ID_CHICONY_TACTICAL_PAD 0x0418
150
151#define USB_VENDOR_ID_CIDC 0x1677
152
153#define USB_VENDOR_ID_CMEDIA 0x0d8c
154#define USB_DEVICE_ID_CM109 0x000e
155
156#define USB_VENDOR_ID_CODEMERCS 0x07c0
157#define USB_DEVICE_ID_CODEMERCS_IOW_FIRST 0x1500
158#define USB_DEVICE_ID_CODEMERCS_IOW_LAST 0x15ff
159
160#define USB_VENDOR_ID_CREATIVELABS 0x041e
161#define USB_DEVICE_ID_PRODIKEYS_PCMIDI 0x2801
162
163#define USB_VENDOR_ID_CYGNAL 0x10c4
164#define USB_DEVICE_ID_CYGNAL_RADIO_SI470X 0x818a
165
166#define USB_VENDOR_ID_CYPRESS 0x04b4
167#define USB_DEVICE_ID_CYPRESS_MOUSE 0x0001
168#define USB_DEVICE_ID_CYPRESS_HIDCOM 0x5500
169#define USB_DEVICE_ID_CYPRESS_ULTRAMOUSE 0x7417
170#define USB_DEVICE_ID_CYPRESS_BARCODE_1 0xde61
171#define USB_DEVICE_ID_CYPRESS_BARCODE_2 0xde64
172#define USB_DEVICE_ID_CYPRESS_BARCODE_3 0xbca1
173
174#define USB_VENDOR_ID_DEALEXTREAME 0x10c5
175#define USB_DEVICE_ID_DEALEXTREAME_RADIO_SI4701 0x819a
176
177#define USB_VENDOR_ID_DELORME 0x1163
178#define USB_DEVICE_ID_DELORME_EARTHMATE 0x0100
179#define USB_DEVICE_ID_DELORME_EM_LT20 0x0200
180
181#define USB_VENDOR_ID_DMI 0x0c0b
182#define USB_DEVICE_ID_DMI_ENC 0x5fab
183
184#define USB_VENDOR_ID_DRAGONRISE 0x0079
185
186#define USB_VENDOR_ID_DWAV 0x0eef
187#define USB_DEVICE_ID_EGALAX_TOUCHCONTROLLER 0x0001
188#define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH 0x480d
189
190#define USB_VENDOR_ID_ELO 0x04E7
191#define USB_DEVICE_ID_ELO_TS2700 0x0020
192
193#define USB_VENDOR_ID_ESSENTIAL_REALITY 0x0d7f
194#define USB_DEVICE_ID_ESSENTIAL_REALITY_P5 0x0100
195
196#define USB_VENDOR_ID_ETURBOTOUCH 0x22b9
197#define USB_DEVICE_ID_ETURBOTOUCH 0x0006
198
199#define USB_VENDOR_ID_ETT 0x0664
200#define USB_DEVICE_ID_TC5UH 0x0309
201
202#define USB_VENDOR_ID_EZKEY 0x0518
203#define USB_DEVICE_ID_BTC_8193 0x0002
204
205#define USB_VENDOR_ID_GAMERON 0x0810
206#define USB_DEVICE_ID_GAMERON_DUAL_PSX_ADAPTOR 0x0001
207#define USB_DEVICE_ID_GAMERON_DUAL_PCS_ADAPTOR 0x0002
208
209#define USB_VENDOR_ID_GENERAL_TOUCH 0x0dfc
210
211#define USB_VENDOR_ID_GLAB 0x06c2
212#define USB_DEVICE_ID_4_PHIDGETSERVO_30 0x0038
213#define USB_DEVICE_ID_1_PHIDGETSERVO_30 0x0039
214#define USB_DEVICE_ID_0_0_4_IF_KIT 0x0040
215#define USB_DEVICE_ID_0_16_16_IF_KIT 0x0044
216#define USB_DEVICE_ID_8_8_8_IF_KIT 0x0045
217#define USB_DEVICE_ID_0_8_7_IF_KIT 0x0051
218#define USB_DEVICE_ID_0_8_8_IF_KIT 0x0053
219#define USB_DEVICE_ID_PHIDGET_MOTORCONTROL 0x0058
220
221#define USB_VENDOR_ID_GOTOP 0x08f2
222#define USB_DEVICE_ID_SUPER_Q2 0x007f
223#define USB_DEVICE_ID_GOGOPEN 0x00ce
224#define USB_DEVICE_ID_PENPOWER 0x00f4
225
226#define USB_VENDOR_ID_GREENASIA 0x0e8f
227
228#define USB_VENDOR_ID_GRETAGMACBETH 0x0971
229#define USB_DEVICE_ID_GRETAGMACBETH_HUEY 0x2005
230
231#define USB_VENDOR_ID_GRIFFIN 0x077d
232#define USB_DEVICE_ID_POWERMATE 0x0410
233#define USB_DEVICE_ID_SOUNDKNOB 0x04AA
234
235#define USB_VENDOR_ID_GTCO 0x078c
236#define USB_DEVICE_ID_GTCO_90 0x0090
237#define USB_DEVICE_ID_GTCO_100 0x0100
238#define USB_DEVICE_ID_GTCO_101 0x0101
239#define USB_DEVICE_ID_GTCO_103 0x0103
240#define USB_DEVICE_ID_GTCO_104 0x0104
241#define USB_DEVICE_ID_GTCO_105 0x0105
242#define USB_DEVICE_ID_GTCO_106 0x0106
243#define USB_DEVICE_ID_GTCO_107 0x0107
244#define USB_DEVICE_ID_GTCO_108 0x0108
245#define USB_DEVICE_ID_GTCO_200 0x0200
246#define USB_DEVICE_ID_GTCO_201 0x0201
247#define USB_DEVICE_ID_GTCO_202 0x0202
248#define USB_DEVICE_ID_GTCO_203 0x0203
249#define USB_DEVICE_ID_GTCO_204 0x0204
250#define USB_DEVICE_ID_GTCO_205 0x0205
251#define USB_DEVICE_ID_GTCO_206 0x0206
252#define USB_DEVICE_ID_GTCO_207 0x0207
253#define USB_DEVICE_ID_GTCO_300 0x0300
254#define USB_DEVICE_ID_GTCO_301 0x0301
255#define USB_DEVICE_ID_GTCO_302 0x0302
256#define USB_DEVICE_ID_GTCO_303 0x0303
257#define USB_DEVICE_ID_GTCO_304 0x0304
258#define USB_DEVICE_ID_GTCO_305 0x0305
259#define USB_DEVICE_ID_GTCO_306 0x0306
260#define USB_DEVICE_ID_GTCO_307 0x0307
261#define USB_DEVICE_ID_GTCO_308 0x0308
262#define USB_DEVICE_ID_GTCO_309 0x0309
263#define USB_DEVICE_ID_GTCO_400 0x0400
264#define USB_DEVICE_ID_GTCO_401 0x0401
265#define USB_DEVICE_ID_GTCO_402 0x0402
266#define USB_DEVICE_ID_GTCO_403 0x0403
267#define USB_DEVICE_ID_GTCO_404 0x0404
268#define USB_DEVICE_ID_GTCO_405 0x0405
269#define USB_DEVICE_ID_GTCO_500 0x0500
270#define USB_DEVICE_ID_GTCO_501 0x0501
271#define USB_DEVICE_ID_GTCO_502 0x0502
272#define USB_DEVICE_ID_GTCO_503 0x0503
273#define USB_DEVICE_ID_GTCO_504 0x0504
274#define USB_DEVICE_ID_GTCO_1000 0x1000
275#define USB_DEVICE_ID_GTCO_1001 0x1001
276#define USB_DEVICE_ID_GTCO_1002 0x1002
277#define USB_DEVICE_ID_GTCO_1003 0x1003
278#define USB_DEVICE_ID_GTCO_1004 0x1004
279#define USB_DEVICE_ID_GTCO_1005 0x1005
280#define USB_DEVICE_ID_GTCO_1006 0x1006
281#define USB_DEVICE_ID_GTCO_1007 0x1007
282
283#define USB_VENDOR_ID_GYRATION 0x0c16
284#define USB_DEVICE_ID_GYRATION_REMOTE 0x0002
285#define USB_DEVICE_ID_GYRATION_REMOTE_2 0x0003
286#define USB_DEVICE_ID_GYRATION_REMOTE_3 0x0008
287
288#define USB_VENDOR_ID_HAPP 0x078b
289#define USB_DEVICE_ID_UGCI_DRIVING 0x0010
290#define USB_DEVICE_ID_UGCI_FLYING 0x0020
291#define USB_DEVICE_ID_UGCI_FIGHTING 0x0030
292
293#define USB_VENDOR_ID_IMATION 0x0718
294#define USB_DEVICE_ID_DISC_STAKKA 0xd000
295
296#define USB_VENDOR_ID_KBGEAR 0x084e
297#define USB_DEVICE_ID_KBGEAR_JAMSTUDIO 0x1001
298
299#define USB_VENDOR_ID_KWORLD 0x1b80
300#define USB_DEVICE_ID_KWORLD_RADIO_FM700 0xd700
301
302#define USB_VENDOR_ID_LABTEC 0x1020
303#define USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD 0x0006
304
305#define USB_VENDOR_ID_LD 0x0f11
306#define USB_DEVICE_ID_LD_CASSY 0x1000
307#define USB_DEVICE_ID_LD_POCKETCASSY 0x1010
308#define USB_DEVICE_ID_LD_MOBILECASSY 0x1020
309#define USB_DEVICE_ID_LD_JWM 0x1080
310#define USB_DEVICE_ID_LD_DMMP 0x1081
311#define USB_DEVICE_ID_LD_UMIP 0x1090
312#define USB_DEVICE_ID_LD_XRAY1 0x1100
313#define USB_DEVICE_ID_LD_XRAY2 0x1101
314#define USB_DEVICE_ID_LD_VIDEOCOM 0x1200
315#define USB_DEVICE_ID_LD_COM3LAB 0x2000
316#define USB_DEVICE_ID_LD_TELEPORT 0x2010
317#define USB_DEVICE_ID_LD_NETWORKANALYSER 0x2020
318#define USB_DEVICE_ID_LD_POWERCONTROL 0x2030
319#define USB_DEVICE_ID_LD_MACHINETEST 0x2040
320
321#define USB_VENDOR_ID_KENSINGTON 0x047d
322#define USB_DEVICE_ID_KS_SLIMBLADE 0x2041
323
324#define USB_VENDOR_ID_LOGITECH 0x046d
325#define USB_DEVICE_ID_LOGITECH_RECEIVER 0xc101
326#define USB_DEVICE_ID_LOGITECH_HARMONY_FIRST 0xc110
327#define USB_DEVICE_ID_LOGITECH_HARMONY_LAST 0xc14f
328#define USB_DEVICE_ID_LOGITECH_RUMBLEPAD 0xc211
329#define USB_DEVICE_ID_LOGITECH_EXTREME_3D 0xc215
330#define USB_DEVICE_ID_LOGITECH_RUMBLEPAD2 0xc218
331#define USB_DEVICE_ID_LOGITECH_RUMBLEPAD2_2 0xc219
332#define USB_DEVICE_ID_LOGITECH_WINGMAN_F3D 0xc283
333#define USB_DEVICE_ID_LOGITECH_FORCE3D_PRO 0xc286
334#define USB_DEVICE_ID_LOGITECH_FLIGHT_SYSTEM_G940 0xc287
335#define USB_DEVICE_ID_LOGITECH_WHEEL 0xc294
336#define USB_DEVICE_ID_LOGITECH_WINGMAN_FFG 0xc293
337#define USB_DEVICE_ID_LOGITECH_MOMO_WHEEL 0xc295
338#define USB_DEVICE_ID_LOGITECH_G25_WHEEL 0xc299
339#define USB_DEVICE_ID_LOGITECH_ELITE_KBD 0xc30a
340#define USB_DEVICE_ID_S510_RECEIVER 0xc50c
341#define USB_DEVICE_ID_S510_RECEIVER_2 0xc517
342#define USB_DEVICE_ID_LOGITECH_CORDLESS_DESKTOP_LX500 0xc512
343#define USB_DEVICE_ID_MX3000_RECEIVER 0xc513
344#define USB_DEVICE_ID_SPACETRAVELLER 0xc623
345#define USB_DEVICE_ID_SPACENAVIGATOR 0xc626
346#define USB_DEVICE_ID_DINOVO_DESKTOP 0xc704
347#define USB_DEVICE_ID_DINOVO_EDGE 0xc714
348#define USB_DEVICE_ID_DINOVO_MINI 0xc71f
349#define USB_DEVICE_ID_LOGITECH_MOMO_WHEEL2 0xca03
350
351#define USB_VENDOR_ID_MCC 0x09db
352#define USB_DEVICE_ID_MCC_PMD1024LS 0x0076
353#define USB_DEVICE_ID_MCC_PMD1208LS 0x007a
354
355#define USB_VENDOR_ID_MGE 0x0463
356#define USB_DEVICE_ID_MGE_UPS 0xffff
357#define USB_DEVICE_ID_MGE_UPS1 0x0001
358
359#define USB_VENDOR_ID_MICROCHIP 0x04d8
360#define USB_DEVICE_ID_PICKIT1 0x0032
361#define USB_DEVICE_ID_PICKIT2 0x0033
362#define USB_DEVICE_ID_PICOLCD 0xc002
363#define USB_DEVICE_ID_PICOLCD_BOOTLOADER 0xf002
364
365#define USB_VENDOR_ID_MICROSOFT 0x045e
366#define USB_DEVICE_ID_SIDEWINDER_GV 0x003b
367#define USB_DEVICE_ID_WIRELESS_OPTICAL_DESKTOP_3_0 0x009d
368#define USB_DEVICE_ID_MS_NE4K 0x00db
369#define USB_DEVICE_ID_MS_LK6K 0x00f9
370#define USB_DEVICE_ID_MS_PRESENTER_8K_BT 0x0701
371#define USB_DEVICE_ID_MS_PRESENTER_8K_USB 0x0713
372
373#define USB_VENDOR_ID_MOJO 0x8282
374#define USB_DEVICE_ID_RETRO_ADAPTER 0x3201
375
376#define USB_VENDOR_ID_MONTEREY 0x0566
377#define USB_DEVICE_ID_GENIUS_KB29E 0x3004
378
379#define USB_VENDOR_ID_NCR 0x0404
380#define USB_DEVICE_ID_NCR_FIRST 0x0300
381#define USB_DEVICE_ID_NCR_LAST 0x03ff
382
383#define USB_VENDOR_ID_NATIONAL_SEMICONDUCTOR 0x0400
384#define USB_DEVICE_ID_N_S_HARMONY 0xc359
385
386#define USB_VENDOR_ID_NATSU 0x08b7
387#define USB_DEVICE_ID_NATSU_GAMEPAD 0x0001
388
389#define USB_VENDOR_ID_NEC 0x073e
390#define USB_DEVICE_ID_NEC_USB_GAME_PAD 0x0301
391
392#define USB_VENDOR_ID_NEXTWINDOW 0x1926
393#define USB_DEVICE_ID_NEXTWINDOW_TOUCHSCREEN 0x0003
394
395#define USB_VENDOR_ID_NTRIG 0x1b96
396#define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN 0x0001
397#define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_1 0x0003
398#define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_2 0x0004
399#define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_3 0x0005
400#define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_4 0x0006
401#define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_5 0x0007
402#define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_6 0x0008
403#define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_7 0x0009
404#define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_8 0x000A
405#define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_9 0x000B
406#define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_10 0x000C
407#define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_11 0x000D
408#define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_12 0x000E
409#define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_13 0x000F
410#define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_14 0x0010
411#define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_15 0x0011
412#define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_16 0x0012
413#define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_17 0x0013
414#define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_18 0x0014
415
416#define USB_VENDOR_ID_ONTRAK 0x0a07
417#define USB_DEVICE_ID_ONTRAK_ADU100 0x0064
418
419#define USB_VENDOR_ID_ORTEK 0x05a4
420#define USB_DEVICE_ID_ORTEK_WKB2000 0x2000
421
422#define USB_VENDOR_ID_PANJIT 0x134c
423
424#define USB_VENDOR_ID_PANTHERLORD 0x0810
425#define USB_DEVICE_ID_PANTHERLORD_TWIN_USB_JOYSTICK 0x0001
426
427#define USB_VENDOR_ID_PETALYNX 0x18b1
428#define USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE 0x0037
429
430#define USB_VENDOR_ID_PHILIPS 0x0471
431#define USB_DEVICE_ID_PHILIPS_IEEE802154_DONGLE 0x0617
432
433#define USB_VENDOR_ID_PLAYDOTCOM 0x0b43
434#define USB_DEVICE_ID_PLAYDOTCOM_EMS_USBII 0x0003
435
436#define USB_VENDOR_ID_POWERCOM 0x0d9f
437#define USB_DEVICE_ID_POWERCOM_UPS 0x0002
438
439#define USB_VENDOR_ID_PRODIGE 0x05af
440#define USB_DEVICE_ID_PRODIGE_CORDLESS 0x3062
441
442#define USB_VENDOR_ID_ROCCAT 0x1e7d
443#define USB_DEVICE_ID_ROCCAT_KONE 0x2ced
444
445#define USB_VENDOR_ID_SAITEK 0x06a3
446#define USB_DEVICE_ID_SAITEK_RUMBLEPAD 0xff17
447
448#define USB_VENDOR_ID_QUANTA 0x0408
449#define USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH 0x3000
450#define USB_DEVICE_ID_PIXART_IMAGING_INC_OPTICAL_TOUCH_SCREEN 0x3001
451
452#define USB_VENDOR_ID_SAMSUNG 0x0419
453#define USB_DEVICE_ID_SAMSUNG_IR_REMOTE 0x0001
454#define USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE 0x0600
455
456#define USB_VENDOR_ID_SONY 0x054c
457#define USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE 0x024b
458#define USB_DEVICE_ID_SONY_PS3_CONTROLLER 0x0268
459
460#define USB_VENDOR_ID_SOUNDGRAPH 0x15c2
461#define USB_DEVICE_ID_SOUNDGRAPH_IMON_FIRST 0x0034
462#define USB_DEVICE_ID_SOUNDGRAPH_IMON_LAST 0x0046
463
464#define USB_VENDOR_ID_STANTUM 0x1f87
465#define USB_DEVICE_ID_MTP 0x0002
466
467#define USB_VENDOR_ID_SUN 0x0430
468#define USB_DEVICE_ID_RARITAN_KVM_DONGLE 0xcdab
469
470#define USB_VENDOR_ID_SUNPLUS 0x04fc
471#define USB_DEVICE_ID_SUNPLUS_WDESKTOP 0x05d8
472
473#define USB_VENDOR_ID_THRUSTMASTER 0x044f
474
475#define USB_VENDOR_ID_TOUCHPACK 0x1bfd
476#define USB_DEVICE_ID_TOUCHPACK_RTS 0x1688
477
478#define USB_VENDOR_ID_TOPMAX 0x0663
479#define USB_DEVICE_ID_TOPMAX_COBRAPAD 0x0103
480
481#define USB_VENDOR_ID_TOPSEED 0x0766
482#define USB_DEVICE_ID_TOPSEED_CYBERLINK 0x0204
483
484#define USB_VENDOR_ID_TURBOX 0x062a
485#define USB_DEVICE_ID_TURBOX_KEYBOARD 0x0201
486
487#define USB_VENDOR_ID_TWINHAN 0x6253
488#define USB_DEVICE_ID_TWINHAN_IR_REMOTE 0x0100
489
490#define USB_VENDOR_ID_UCLOGIC 0x5543
491#define USB_DEVICE_ID_UCLOGIC_TABLET_PF1209 0x0042
492#define USB_DEVICE_ID_UCLOGIC_TABLET_WP4030U 0x0003
493
494#define USB_VENDOR_ID_VERNIER 0x08f7
495#define USB_DEVICE_ID_VERNIER_LABPRO 0x0001
496#define USB_DEVICE_ID_VERNIER_GOTEMP 0x0002
497#define USB_DEVICE_ID_VERNIER_SKIP 0x0003
498#define USB_DEVICE_ID_VERNIER_CYCLOPS 0x0004
499#define USB_DEVICE_ID_VERNIER_LCSPEC 0x0006
500
501#define USB_VENDOR_ID_WACOM 0x056a
502#define USB_DEVICE_ID_WACOM_GRAPHIRE_BLUETOOTH 0x81
503#define USB_DEVICE_ID_WACOM_INTUOS4_BLUETOOTH 0xbd
504
505#define USB_VENDOR_ID_WISEGROUP 0x0925
506#define USB_DEVICE_ID_SMARTJOY_PLUS 0x0005
507#define USB_DEVICE_ID_1_PHIDGETSERVO_20 0x8101
508#define USB_DEVICE_ID_4_PHIDGETSERVO_20 0x8104
509#define USB_DEVICE_ID_8_8_4_IF_KIT 0x8201
510#define USB_DEVICE_ID_QUAD_USB_JOYPAD 0x8800
511#define USB_DEVICE_ID_DUAL_USB_JOYPAD 0x8866
512
513#define USB_VENDOR_ID_WISEGROUP_LTD 0x6666
514#define USB_VENDOR_ID_WISEGROUP_LTD2 0x6677
515#define USB_DEVICE_ID_SMARTJOY_DUAL_PLUS 0x8802
516
517#define USB_VENDOR_ID_YEALINK 0x6993
518#define USB_DEVICE_ID_YEALINK_P1K_P4K_B2K 0xb001
519
520#define USB_VENDOR_ID_ZEROPLUS 0x0c12
521
522#define USB_VENDOR_ID_ZYDACRON 0x13EC
523#define USB_DEVICE_ID_ZYDACRON_REMOTE_CONTROL 0x0006
524
525#define USB_VENDOR_ID_KYE 0x0458
526#define USB_DEVICE_ID_KYE_ERGO_525V 0x0087
527#define USB_DEVICE_ID_KYE_GPEN_560 0x5003
528
529
530#endif
diff --git a/usr/src/dkms_source_tree/hid-ntrig.c b/usr/src/dkms_source_tree/hid-ntrig.c
new file mode 100644
index 0000000..7bc1a5e
--- /dev/null
+++ b/usr/src/dkms_source_tree/hid-ntrig.c
@@ -0,0 +1,362 @@
1/*
2 * HID driver for N-Trig touchscreens
3 *
4 * Copyright (c) 2008-2010 Rafi Rubin
5 * Copyright (c) 2009-2010 Stephane Chatty
6 *
7 */
8
9/*
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the Free
12 * Software Foundation; either version 2 of the License, or (at your option)
13 * any later version.
14 */
15
16#include <linux/device.h>
17#include <linux/hid.h>
18#include <linux/usb.h>
19#include <linux/module.h>
20#include <linux/slab.h>
21
22#include "hid-ids.h"
23
24void usbhid_submit_report
25(struct hid_device *hid, struct hid_report *report, unsigned char dir);
26
27#define NTRIG_DUPLICATE_USAGES 0x001
28
29struct mt_data {
30 int x, y, w, h;
31 int tipswitch;
32 int confidence;
33 int in_range;
34 int foot[4];
35 unsigned int nfoot;
36};
37
38struct ntrig_data {
39 unsigned int id;
40 struct mt_data data[16];
41 int contactcount;
42};
43
44#define SN_MOVE 100
45#define SN_SIZE 50
46
47/*
48 * this driver is aimed at two firmware versions in circulation:
49 * - dual pen/finger single touch
50 * - finger multitouch, pen not working
51 */
52
53static int ntrig_input_mapping(struct hid_device *hdev, struct hid_input *hi,
54 struct hid_field *field, struct hid_usage *usage,
55 unsigned long **bit, int *max)
56{
57 int delta = field->logical_maximum - field->logical_minimum;
58
59 /* No special mappings needed for the pen and single touch */
60 if (field->physical)
61 return 0;
62
63 switch (usage->hid & HID_USAGE_PAGE) {
64 case HID_UP_GENDESK:
65 switch (usage->hid) {
66 case HID_GD_X:
67 hid_map_usage(hi, usage, bit, max,
68 EV_ABS, ABS_MT_POSITION_X);
69 input_set_abs_params(hi->input, ABS_MT_POSITION_X,
70 field->logical_minimum,
71 field->logical_maximum,
72 delta / SN_MOVE, 0);
73 input_set_abs_params(hi->input, ABS_X,
74 field->logical_minimum,
75 field->logical_maximum,
76 delta / SN_MOVE, 0);
77 return 1;
78 case HID_GD_Y:
79 hid_map_usage(hi, usage, bit, max,
80 EV_ABS, ABS_MT_POSITION_Y);
81 input_set_abs_params(hi->input, ABS_MT_POSITION_Y,
82 field->logical_minimum,
83 field->logical_maximum,
84 delta / SN_MOVE, 0);
85 input_set_abs_params(hi->input, ABS_Y,
86 field->logical_minimum,
87 field->logical_maximum,
88 delta / SN_MOVE, 0);
89 return 1;
90 }
91 return 0;
92
93 case HID_UP_DIGITIZER:
94 switch (usage->hid) {
95 /* we do not want to map these for now */
96 case HID_DG_CONTACTID: /* Not trustworthy, squelch for now */
97 case HID_DG_INPUTMODE:
98 case HID_DG_DEVICEINDEX:
99 case HID_DG_CONTACTMAX:
100 return -1;
101
102 /* width/height mapped on TouchMajor/TouchMinor/Orientation */
103 case HID_DG_WIDTH:
104 hid_map_usage(hi, usage, bit, max,
105 EV_ABS, ABS_MT_TOUCH_MAJOR);
106 input_set_abs_params(hi->input, ABS_MT_TOUCH_MAJOR,
107 field->logical_minimum,
108 field->logical_maximum,
109 delta / SN_SIZE, 0);
110 return 1;
111 case HID_DG_HEIGHT:
112 hid_map_usage(hi, usage, bit, max,
113 EV_ABS, ABS_MT_TOUCH_MINOR);
114 input_set_abs_params(hi->input, ABS_MT_TOUCH_MINOR,
115 field->logical_minimum,
116 field->logical_maximum,
117 delta / SN_SIZE, 0);
118 input_set_abs_params(hi->input, ABS_MT_ORIENTATION,
119 0, 1, 0, 0);
120 return 1;
121 }
122 return 0;
123
124 case 0xff000000:
125 /* we do not want to map these: no input-oriented meaning */
126 return -1;
127 }
128
129 return 0;
130}
131
132static int ntrig_input_mapped(struct hid_device *hdev, struct hid_input *hi,
133 struct hid_field *field, struct hid_usage *usage,
134 unsigned long **bit, int *max)
135{
136 /* No special mappings needed for the pen and single touch */
137 if (field->physical)
138 return 0;
139
140 if (usage->type == EV_KEY || usage->type == EV_REL
141 || usage->type == EV_ABS)
142 clear_bit(usage->code, *bit);
143
144 return 0;
145}
146
147/*
148 * this function is called upon all reports
149 * so that we can filter contact point information,
150 * decide whether we are in multi or single touch mode
151 * and call input_mt_sync after each point if necessary
152 */
153static int ntrig_event (struct hid_device *hid, struct hid_field *field,
154 struct hid_usage *usage, __s32 value)
155{
156 struct input_dev *input = field->hidinput->input;
157 struct ntrig_data *nd = hid_get_drvdata(hid);
158 struct mt_data *p = &nd->data[nd->id];
159 int i, count;
160
161 /* No special handling needed for the pen */
162 if (field->application == HID_DG_PEN)
163 return 0;
164
165 if (hid->claimed & HID_CLAIMED_INPUT) {
166 switch (usage->hid) {
167 case HID_DG_INRANGE:
168 p->in_range = value;
169 break;
170 /* new mt packet */
171 case 0xff000001:
172 count = nd->contactcount;
173 for (i = 0; i < count; i++) {
174 p = &nd->data[i];
175 input_report_abs(input, ABS_MT_POSITION_X, p->x);
176 input_report_abs(input, ABS_MT_POSITION_Y, p->y);
177 input_report_abs(input, ABS_MT_TOUCH_MINOR, p->h);
178 input_report_abs(input, ABS_MT_TOUCH_MAJOR, p->w);
179 input_report_abs(input, ABS_MT_ORIENTATION, p->w > p->h);
180 input_mt_sync(field->hidinput->input);
181 }
182
183 input_mt_sync(input);
184 input_report_key(input, BTN_TOUCH, count > 0);
185 if (count > 0) {
186 p = &nd->data[0];
187 input_report_abs(input, ABS_X, p->x);
188 input_report_abs(input, ABS_Y, p->y);
189 }
190 //input_sync(input);
191
192 p = &nd->data[nd->id = 0];
193 memset(p, 0, sizeof(*p));
194 break;
195 case HID_DG_TIPSWITCH:
196 p->tipswitch = value;
197 break;
198 case HID_DG_CONFIDENCE:
199 p->confidence = value;
200 break;
201 case HID_DG_CONTACTID:
202 if (value >= 6)
203 break;
204 p = &nd->data[nd->id = value];
205 memset(p, 0, sizeof(*p));
206 break;
207 case HID_GD_X:
208 p->x = value;
209 break;
210 case HID_GD_Y:
211 p->y = value;
212 break;
213 case HID_DG_WIDTH:
214 p->w = value;
215 break;
216 case HID_DG_HEIGHT:
217 p->h = value;
218 break;
219 case 0xff000002:
220 if (p->nfoot < 4)
221 p->foot[p->nfoot++] = value;
222 else
223 printk(KERN_INFO "NTRIG: lots %d\n", value);
224 break;
225
226 case HID_DG_CONTACTCOUNT:
227 nd->contactcount = value;
228 break;
229
230 default:
231 return 0;
232 }
233 }
234
235 /* we have handled the hidinput part, now remains hiddev */
236 if ((hid->claimed & HID_CLAIMED_HIDDEV) && hid->hiddev_hid_event)
237 hid->hiddev_hid_event(hid, field, usage, value);
238
239 return 1;
240}
241
242static int ntrig_probe(struct hid_device *hdev, const struct hid_device_id *id)
243{
244 int ret;
245 struct ntrig_data *nd;
246 struct hid_input *hidinput;
247 struct input_dev *input;
248 struct hid_report *report;
249
250 if (id->driver_data & NTRIG_DUPLICATE_USAGES)
251 hdev->quirks |= HID_QUIRK_MULTI_INPUT;
252 //hdev->quirks |= HID_QUIRK_NO_INPUT_SYNC;
253
254 nd = kzalloc(sizeof(struct ntrig_data), GFP_KERNEL);
255 if (!nd) {
256 dev_err(&hdev->dev, "cannot allocate N-Trig data\n");
257 return -ENOMEM;
258 }
259
260 hid_set_drvdata(hdev, nd);
261
262 ret = hid_parse(hdev);
263 if (ret) {
264 dev_err(&hdev->dev, "parse failed\n");
265 goto err_free;
266 }
267
268 ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF);
269 if (ret) {
270 dev_err(&hdev->dev, "hw start failed\n");
271 goto err_free;
272 }
273
274
275 list_for_each_entry(hidinput, &hdev->inputs, list) {
276 if (hidinput->report->maxfield < 1)
277
278 continue;
279
280 input = hidinput->input;
281 switch (hidinput->report->field[0]->application) {
282 case HID_DG_PEN:
283 input->name = "N-Trig Pen";
284 break;
285 case HID_DG_TOUCHSCREEN:
286 /* These keys are redundant for fingers, clear them
287 * to prevent incorrect identification */
288 __clear_bit(BTN_TOOL_PEN, input->keybit);
289 __clear_bit(BTN_TOOL_FINGER, input->keybit);
290 __clear_bit(BTN_0, input->keybit);
291 __set_bit(BTN_TOOL_DOUBLETAP, input->keybit);
292 /*
293 * The physical touchscreen (single touch)
294 * input has a value for physical, whereas
295 * the multitouch only has logical input
296 * fields.
297 */
298 input->name =
299 (hidinput->report->field[0]
300 ->physical) ?
301 "N-Trig Touchscreen" :
302 "N-Trig MultiTouch";
303 break;
304 }
305 }
306
307 /* This is needed for devices with more recent firmware versions */
308 report = hdev->report_enum[HID_FEATURE_REPORT].report_id_hash[0x0a];
309 if (report)
310 usbhid_submit_report(hdev, report, USB_DIR_OUT);
311
312 return 0;
313err_free:
314 kfree(nd);
315 return ret;
316}
317
318static void ntrig_remove(struct hid_device *hdev)
319{
320 hid_hw_stop(hdev);
321 kfree(hid_get_drvdata(hdev));
322}
323
324#define NTRIG_DEVICE(id) \
325 { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, id), \
326 .driver_data = NTRIG_DUPLICATE_USAGES }
327
328static const struct hid_device_id ntrig_devices[] = {
329 NTRIG_DEVICE(0x0001),
330 { }
331};
332MODULE_DEVICE_TABLE(hid, ntrig_devices);
333
334static const struct hid_usage_id ntrig_grabbed_usages[] = {
335 { HID_ANY_ID, HID_ANY_ID, HID_ANY_ID },
336 { HID_ANY_ID - 1, HID_ANY_ID - 1, HID_ANY_ID - 1 }
337};
338
339static struct hid_driver ntrig_driver = {
340 .name = "ntrig",
341 .id_table = ntrig_devices,
342 .probe = ntrig_probe,
343 .remove = ntrig_remove,
344 .input_mapping = ntrig_input_mapping,
345 .input_mapped = ntrig_input_mapped,
346 .usage_table = ntrig_grabbed_usages,
347 .event = ntrig_event,
348};
349
350static int __init ntrig_init(void)
351{
352 return hid_register_driver(&ntrig_driver);
353}
354
355static void __exit ntrig_exit(void)
356{
357 hid_unregister_driver(&ntrig_driver);
358}
359
360module_init(ntrig_init);
361module_exit(ntrig_exit);
362MODULE_LICENSE("GPL");