Penmount Touch Driver



Penmount Touch Driver

  1. Penmount Dmc9000 Touch Screen Driver

Hello, When I got this Windows 10 It came with touch screen. After a year of using My PC It said no Touch screen or pen. I want to 'Device Manger,' And I did not saw any 'HID Touch,' So is there any way to get the touch screen driver back? Dos Driver V1.01.zip (PenMount Touchscreen driver for Dos) 2004-02-17: Primary; Secondary; Windows 3.1 Driver V1.0.zip (PenMount Touchscreen driver for Win3.1) 2004-02-17: Primary; Secondary; Windows 95 Driver V2.1.zip (PenMount Touchscreen driver for Win95) 2004-02-17: Primary; Secondary; Windows 98-Me Driver V3.1.zip (PenMount Touchscreen. . Penmount serial touchscreen driver. Copyright (c) 2006 Rick Koch. Copyright (c) 2011 John Sung penmount.touch@gmail.com. Based on ELO. The PenMount device driver supports two types of device type configurations: mouse and digitizer. The moues device type is compatible to all Windows operating systems, while the digitizer device only works on systems that supports Tablet PC Input. In general, installing the PenMount controller as mouse device is recommended. Touch Screen Utilities - Link to Archive Files: POS Equipment: POS Peripherials - Link to Utilities: Touch Computer Link to Touch Computer Drivers and Utilities: TWAP Penmount: Penmount TWAP Touch. Universal Windows Drivers: Multi Monitor PDF: Screen Inc - GV Driver XP and Vista Driver Windows 7 Drivers Windows 8 Drivers: Champion M6 Touch.

PenmountDmc9000

Penmount Dmc9000 Touch Screen Driver

1/*
2 * Penmount serial touchscreen driver
3 *
4 * Copyright (c) 2006 Rick Koch <n1gp@hotmail.com>
5 * Copyright (c) 2011 John Sung <penmount.touch@gmail.com>
6 *
7 * Based on ELO driver (drivers/input/touchscreen/elo.c)
8 * Copyright (c) 2004 Vojtech Pavlik
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 version 2 as published
14 * by the Free Software Foundation.
15 */
16
17#include <linux/errno.h>
18#include <linux/kernel.h>
19#include <linux/module.h>
20#include <linux/slab.h>
21#include <linux/input.h>
22#include <linux/input/mt.h>
23#include <linux/serio.h>
24
25#define DRIVER_DESC 'PenMount serial touchscreen driver'
26
27MODULE_AUTHOR('Rick Koch <n1gp@hotmail.com>');
28MODULE_AUTHOR('John Sung <penmount.touch@gmail.com>');
29MODULE_DESCRIPTION(DRIVER_DESC);
30MODULE_LICENSE('GPL');
31
32/*
33 * Definitions & global arrays.
34 */
35
36#define PM_MAX_LENGTH 6
37#define PM_MAX_MTSLOT 16
38#define PM_3000_MTSLOT 2
39#define PM_6250_MTSLOT 12
40
41/*
42 * Multi-touch slot
43 */
44
45structmt_slot {
46unsignedshortx, y;
47boolactive; /* is the touch valid? */
48};
49
50/*
51 * Per-touchscreen data.
52 */
53
54structpm {
55structinput_dev *dev;
56structserio *serio;
57intidx;
58unsignedchardata[PM_MAX_LENGTH];
59charphys[32];
60unsignedcharpacketsize;
61unsignedcharmaxcontacts;
62structmt_slotslots[PM_MAX_MTSLOT];
63void (*parse_packet)(structpm *);
64};
65
66/*
67 * pm_mtevent() sends mt events and also emulates pointer movement
68 */
69
70staticvoidpm_mtevent(structpm *pm, structinput_dev *input)
71{
72inti;
73
74for (i = 0; i < pm->maxcontacts; ++i) {
75input_mt_slot(input, i);
76input_mt_report_slot_state(input, MT_TOOL_FINGER,
77pm->slots[i].active);
78if (pm->slots[i].active) {
79input_event(input, EV_ABS, ABS_MT_POSITION_X, pm->slots[i].x);
80input_event(input, EV_ABS, ABS_MT_POSITION_Y, pm->slots[i].y);
81 }
82 }
83
84input_mt_report_pointer_emulation(input, true);
85input_sync(input);
86}
87
88/*
89 * pm_checkpacket() checks if data packet is valid
90 */
91
92staticboolpm_checkpacket(unsignedchar *packet)
93{
94inttotal = 0;
95inti;
96
97for (i = 0; i < 5; i++)
98total += packet[i];
99
100returnpacket[5] (unsignedchar)~(total & 0xff);
101}
102
103staticvoidpm_parse_9000(structpm *pm)
104{
105structinput_dev *dev = pm->dev;
106
107if ((pm->data[0] & 0x80) && pm->packetsize ++pm->idx) {
108input_report_abs(dev, ABS_X, pm->data[1] * 128 + pm->data[2]);
109input_report_abs(dev, ABS_Y, pm->data[3] * 128 + pm->data[4]);
110input_report_key(dev, BTN_TOUCH, !!(pm->data[0] & 0x40));
111input_sync(dev);
112pm->idx = 0;
113 }
114}
115
116staticvoidpm_parse_6000(structpm *pm)
117{
118structinput_dev *dev = pm->dev;
119
120if ((pm->data[0] & 0xbf) 0x30 && pm->packetsize ++pm->idx) {
121if (pm_checkpacket(pm->data)) {
122input_report_abs(dev, ABS_X,
123pm->data[2] * 256 + pm->data[1]);
124input_report_abs(dev, ABS_Y,
125pm->data[4] * 256 + pm->data[3]);
126input_report_key(dev, BTN_TOUCH, pm->data[0] & 0x40);
127input_sync(dev);
128 }
129pm->idx = 0;
130 }
131}
132
133staticvoidpm_parse_3000(structpm *pm)
134{
135structinput_dev *dev = pm->dev;
136
137if ((pm->data[0] & 0xce) 0x40 && pm->packetsize ++pm->idx) {
138if (pm_checkpacket(pm->data)) {
139intslotnum = pm->data[0] & 0x0f;
140pm->slots[slotnum].active = pm->data[0] & 0x30;
141pm->slots[slotnum].x = pm->data[2] * 256 + pm->data[1];
142pm->slots[slotnum].y = pm->data[4] * 256 + pm->data[3];
143pm_mtevent(pm, dev);
144 }
145pm->idx = 0;
146 }
147}
148
149staticvoidpm_parse_6250(structpm *pm)
150{
151structinput_dev *dev = pm->dev;
152
153if ((pm->data[0] & 0xb0) 0x30 && pm->packetsize ++pm->idx) {
154if (pm_checkpacket(pm->data)) {
155intslotnum = pm->data[0] & 0x0f;
156pm->slots[slotnum].active = pm->data[0] & 0x40;
157pm->slots[slotnum].x = pm->data[2] * 256 + pm->data[1];
158pm->slots[slotnum].y = pm->data[4] * 256 + pm->data[3];
159pm_mtevent(pm, dev);
160 }
161pm->idx = 0;
162 }
163}
164
165staticirqreturn_tpm_interrupt(structserio *serio,
166unsignedchardata, unsignedintflags)
167{
168structpm *pm = serio_get_drvdata(serio);
169
170pm->data[pm->idx] = data;
171
172pm->parse_packet(pm);
173
174returnIRQ_HANDLED;
175}
176
177/*
178 * pm_disconnect() is the opposite of pm_connect()
179 */
180
181staticvoidpm_disconnect(structserio *serio)
182{
183structpm *pm = serio_get_drvdata(serio);
184
185serio_close(serio);
186
187input_unregister_device(pm->dev);
188kfree(pm);
189
190serio_set_drvdata(serio, NULL);
191}
192
193/*
194 * pm_connect() is the routine that is called when someone adds a
195 * new serio device that supports PenMount protocol and registers it as
196 * an input device.
197 */
198
199staticintpm_connect(structserio *serio, structserio_driver *drv)
200{
201structpm *pm;
202structinput_dev *input_dev;
203intmax_x, max_y;
204interr;
205
206pm = kzalloc(sizeof(structpm), GFP_KERNEL);
207input_dev = input_allocate_device();
208if (!pm || !input_dev) {
209err = -ENOMEM;
210gotofail1;
211 }
212
213pm->serio = serio;
214pm->dev = input_dev;
215snprintf(pm->phys, sizeof(pm->phys), '%s/input0', serio->phys);
216pm->maxcontacts = 1;
217
218input_dev->name = 'PenMount Serial TouchScreen';
219input_dev->phys = pm->phys;
220input_dev->id.bustype = BUS_RS232;
221input_dev->id.vendor = SERIO_PENMOUNT;
222input_dev->id.product = 0;
223input_dev->id.version = 0x0100;
224input_dev->dev.parent = &serio->dev;
225
226input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
227input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
228
229switch (serio->id.id) {
230default:
231case0:
232pm->packetsize = 5;
233pm->parse_packet = pm_parse_9000;
234input_dev->id.product = 0x9000;
235max_x = max_y = 0x3ff;
236break;
237
238case1:
239pm->packetsize = 6;
240pm->parse_packet = pm_parse_6000;
241input_dev->id.product = 0x6000;
242max_x = max_y = 0x3ff;
243break;
244
245case2:
246pm->packetsize = 6;
247pm->parse_packet = pm_parse_3000;
248input_dev->id.product = 0x3000;
249max_x = max_y = 0x7ff;
250pm->maxcontacts = PM_3000_MTSLOT;
251break;
252
253case3:
254pm->packetsize = 6;
255pm->parse_packet = pm_parse_6250;
256input_dev->id.product = 0x6250;
257max_x = max_y = 0x3ff;
258pm->maxcontacts = PM_6250_MTSLOT;
259break;
260 }
261
262input_set_abs_params(pm->dev, ABS_X, 0, max_x, 0, 0);
263input_set_abs_params(pm->dev, ABS_Y, 0, max_y, 0, 0);
264
265if (pm->maxcontacts > 1) {
266input_mt_init_slots(pm->dev, pm->maxcontacts, 0);
267input_set_abs_params(pm->dev,
268ABS_MT_POSITION_X, 0, max_x, 0, 0);
269input_set_abs_params(pm->dev,
270ABS_MT_POSITION_Y, 0, max_y, 0, 0);
271 }
272
273serio_set_drvdata(serio, pm);
274
275err = serio_open(serio, drv);
276if (err)
277gotofail2;
278
279err = input_register_device(pm->dev);
280if (err)
281gotofail3;
282
283return0;
284
285fail3: serio_close(serio);
286fail2: serio_set_drvdata(serio, NULL);
287fail1: input_free_device(input_dev);
288kfree(pm);
289returnerr;
290}
291
292/*
293 * The serio driver structure.
294 */
295
296staticconststructserio_device_idpm_serio_ids[] = {
297 {
298 .type = SERIO_RS232,
299 .proto = SERIO_PENMOUNT,
300 .id = SERIO_ANY,
301 .extra = SERIO_ANY,
302 },
303 { 0 }
304};
305
306MODULE_DEVICE_TABLE(serio, pm_serio_ids);
307
308staticstructserio_driverpm_drv = {
309 .driver = {
310 .name = 'serio-penmount',
311 },
312 .description = DRIVER_DESC,
313 .id_table = pm_serio_ids,
314 .interrupt = pm_interrupt,
315 .connect = pm_connect,
316 .disconnect = pm_disconnect,
317};
318
319module_serio_driver(pm_drv);
320