View | Details | Raw Unified | Return to bug 548463
Collapse All | Expand All

(-)a/drivers/hid/hid-ntrig.c (-6 / +29 lines)
Lines 27-32 Link Here
27
struct ntrig_data {
27
struct ntrig_data {
28
	__s32 x, y, id, w, h;
28
	__s32 x, y, id, w, h;
29
	char reading_a_point, found_contact_id;
29
	char reading_a_point, found_contact_id;
30
	char pen_active;
31
	char finger_active;
32
	char inverted;
30
};
33
};
31
34
32
/*
35
/*
Lines 63-72 static int ntrig_input_mapping(struct hid_device *hdev, struct hid_input *hi, Link Here
63
	case HID_UP_DIGITIZER:
66
	case HID_UP_DIGITIZER:
64
		switch (usage->hid) {
67
		switch (usage->hid) {
65
		/* we do not want to map these for now */
68
		/* we do not want to map these for now */
66
		case HID_DG_INVERT: /* value is always 0 */
67
		case HID_DG_ERASER: /* value is always 0 */
68
		case HID_DG_CONTACTID: /* value is useless */
69
		case HID_DG_CONTACTID: /* value is useless */
69
		case HID_DG_BARRELSWITCH:  /* doubtful */
70
		case HID_DG_INPUTMODE:
70
		case HID_DG_INPUTMODE:
71
		case HID_DG_DEVICEINDEX:
71
		case HID_DG_DEVICEINDEX:
72
		case HID_DG_CONTACTCOUNT:
72
		case HID_DG_CONTACTCOUNT:
Lines 125-130 static int ntrig_event (struct hid_device *hid, struct hid_field *field, Link Here
125
125
126
        if (hid->claimed & HID_CLAIMED_INPUT) {
126
        if (hid->claimed & HID_CLAIMED_INPUT) {
127
		switch (usage->hid) {
127
		switch (usage->hid) {
128
129
		case HID_DG_INRANGE:
130
			if (field->application & 0x3)
131
				nd->pen_active = (value != 0);
132
			else
133
				nd->finger_active = (value != 0);
134
			return 0;
135
136
		case HID_DG_INVERT:
137
			nd->inverted = value;
138
			return 0;
139
128
		case HID_GD_X:
140
		case HID_GD_X:
129
			nd->x = value;
141
			nd->x = value;
130
			nd->reading_a_point = 1;
142
			nd->reading_a_point = 1;
Lines 147-153 static int ntrig_event (struct hid_device *hid, struct hid_field *field, Link Here
147
			 * report received in a finger event. We want
159
			 * report received in a finger event. We want
148
			 * to emit a normal (X, Y) position
160
			 * to emit a normal (X, Y) position
149
			 */
161
			 */
150
			if (! nd->found_contact_id) {
162
			if (!nd->found_contact_id) {
163
				if (nd->pen_active && nd->finger_active) {
164
					input_report_key(input, BTN_TOOL_DOUBLETAP, 0);
165
					input_report_key(input, BTN_TOOL_DOUBLETAP, 1);
166
				}
151
				input_event(input, EV_ABS, ABS_X, nd->x);
167
				input_event(input, EV_ABS, ABS_X, nd->x);
152
				input_event(input, EV_ABS, ABS_Y, nd->y);
168
				input_event(input, EV_ABS, ABS_Y, nd->y);
153
			}
169
			}
Lines 159-164 static int ntrig_event (struct hid_device *hid, struct hid_field *field, Link Here
159
			 * to emit a normal (X, Y) position
175
			 * to emit a normal (X, Y) position
160
			 */
176
			 */
161
			if (! nd->found_contact_id) {
177
			if (! nd->found_contact_id) {
178
				if (nd->pen_active && nd->finger_active) {
179
					input_report_key(input,
180
							nd->inverted ? BTN_TOOL_RUBBER : BTN_TOOL_PEN
181
							, 0);
182
					input_report_key(input,
183
							nd->inverted ? BTN_TOOL_RUBBER : BTN_TOOL_PEN
184
							, 1);
185
				}
162
				input_event(input, EV_ABS, ABS_X, nd->x);
186
				input_event(input, EV_ABS, ABS_X, nd->x);
163
				input_event(input, EV_ABS, ABS_Y, nd->y);
187
				input_event(input, EV_ABS, ABS_Y, nd->y);
164
				input_event(input, EV_ABS, ABS_PRESSURE, value);
188
				input_event(input, EV_ABS, ABS_PRESSURE, value);
Lines 233-238 static int ntrig_probe(struct hid_device *hdev, const struct hid_device_id *id) Link Here
233
257
234
	if (ret)
258
	if (ret)
235
		kfree (nd);
259
		kfree (nd);
260
236
	return ret;
261
	return ret;
237
}
262
}
238
263
239
- 
240
--
241
drivers/hid/hid-ntrig.c |    4 ++--
264
drivers/hid/hid-ntrig.c |    4 ++--
242
1 files changed, 2 insertions(+), 2 deletions(-)
265
1 files changed, 2 insertions(+), 2 deletions(-)
(-)a/drivers/hid/hid-ntrig.c (-3 / +2 lines)
Lines 290-301 static struct hid_driver ntrig_driver = { Link Here
290
	.event = ntrig_event,
290
	.event = ntrig_event,
291
};
291
};
292
292
293
static int ntrig_init(void)
293
static int __init ntrig_init(void)
294
{
294
{
295
	return hid_register_driver(&ntrig_driver);
295
	return hid_register_driver(&ntrig_driver);
296
}
296
}
297
297
298
static void ntrig_exit(void)
298
static void __exit ntrig_exit(void)
299
{
299
{
300
	hid_unregister_driver(&ntrig_driver);
300
	hid_unregister_driver(&ntrig_driver);
301
}
301
}
302
- 

Return to bug 548463