Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 223379
Collapse All | Expand All

(-)src/2.6.22/wacom_wac.h (+1 lines)
Lines 27-32 Link Here
27
	CINTIQ,
27
	CINTIQ,
28
	WACOM_BEE,
28
	WACOM_BEE,
29
	WACOM_MO,
29
	WACOM_MO,
30
	TABLETPC,
30
	MAX_TYPE
31
	MAX_TYPE
31
};
32
};
32
33
(-)src/2.6.24/wacom_sys.c (-6 / +17 lines)
Lines 219-224 Link Here
219
	input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_RUBBER);
219
	input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_RUBBER);
220
}
220
}
221
221
222
void
223
input_dev_tpc (struct input_dev *input_dev, struct wacom_wac *wacom_wac)
224
{
225
	input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_RUBBER);
226
}
227
222
static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *id)
228
static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *id)
223
{
229
{
224
	struct usb_device *dev = interface_to_usbdev(intf);
230
	struct usb_device *dev = interface_to_usbdev(intf);
Lines 286-297 Link Here
286
		goto fail3;
292
		goto fail3;
287
293
288
	/* Ask the tablet to report tablet data. Repeat until it succeeds */
294
	/* Ask the tablet to report tablet data. Repeat until it succeeds */
289
	do {
295
	if (wacom_wac->features->type == TABLETPC) { /* USB ISDv4 (TabletPC) doesn't support SetReport */
290
		rep_data[0] = rep_data[1] = 2;
296
		usb_get_report(intf, 3, 2, rep_data, 2);
291
		if(usb_set_report(intf, 3, 2, rep_data, 2) >= 0)
297
		if (rep_data[0] != 2 || rep_data[1] != 0)
292
			error = usb_get_report(intf, 3, 2, rep_data, 2);
298
			info("Got bad report from TabletPC, may not work properly");
293
	} while ((error <= 0 || rep_data[1] != 2) && limit++ < 5);
299
	} else {
294
300
		do {
301
			rep_data[0] = rep_data[1] = 2;
302
			if(usb_set_report(intf, 3, 2, rep_data, 2) >= 0)
303
				error = usb_get_report(intf, 3, 2, rep_data, 2);
304
		} while ((error <= 0 || rep_data[1] != 2) && limit++ < 5);
305
	}
295
	usb_set_intfdata(intf, wacom);
306
	usb_set_intfdata(intf, wacom);
296
	return 0;
307
	return 0;
297
308
(-)src/2.6.19/wacom.h (+1 lines)
Lines 125-130 Link Here
125
extern void input_dev_i(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
125
extern void input_dev_i(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
126
extern void input_dev_pl(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
126
extern void input_dev_pl(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
127
extern void input_dev_pt(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
127
extern void input_dev_pt(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
128
extern void input_dev_tpc(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
128
extern __u16 wacom_le16_to_cpu(unsigned char *data);
129
extern __u16 wacom_le16_to_cpu(unsigned char *data);
129
extern __u16 wacom_be16_to_cpu(unsigned char *data);
130
extern __u16 wacom_be16_to_cpu(unsigned char *data);
130
extern struct wacom_features * get_wacom_feature(const struct usb_device_id *id);
131
extern struct wacom_features * get_wacom_feature(const struct usb_device_id *id);
(-)src/2.6.19/wacom_wac.c (+96 lines)
Lines 535-540 Link Here
535
	return 1;
535
	return 1;
536
}
536
}
537
537
538
int wacom_tpc_irq (struct wacom_wac *wacom_wac, void *wcombo)
539
{
540
	static int stylus_inrange;
541
	char *data = wacom_wac->data;
542
	struct wacom_combo *combo = wcombo;
543
	struct urb *urb = combo->urb;
544
	if (urb->actual_length == 5) { /* Finger */
545
		int absx = ((data[2] << 8) & 0xff00) + (data[1] & 0xff);
546
		int absy = ((data[4] << 8) & 0xff00) + (data[3] & 0xff);
547
		
548
		if (stylus_inrange) {
549
			if (wacom_wac->tool[1]) {
550
				return 0;
551
			} else {
552
				wacom_report_key (wcombo, BTN_TOOL_PEN, 0);
553
				wacom_report_key (wcombo, BTN_TOUCH, 0);
554
				wacom_report_abs (wcombo, ABS_PRESSURE, 0);
555
				wacom_wac->tool[1] = 1;	
556
				goto end;
557
			}
558
		}
559
		wacom_wac->tool[1] = 0;
560
561
		absx = (absx * wacom_wac->features->x_max) / 4096;
562
		absy = (absy * wacom_wac->features->y_max) / 4096;
563
		wacom_report_key (wcombo, ABS_MISC, STYLUS_DEVICE_ID);
564
		wacom_report_key (wcombo, BTN_TOOL_PEN, data[0] & 0x1);
565
		wacom_report_key (wcombo, BTN_TOUCH, data[0] & 0x1);
566
		wacom_report_abs (wcombo, ABS_X, absx);
567
		wacom_report_abs (wcombo, ABS_Y, absy);
568
		if (data[0] & 0x1)
569
			wacom_report_abs (wcombo, ABS_PRESSURE, 255);
570
		else
571
			wacom_report_abs (wcombo, ABS_PRESSURE, 0);
572
	} else { /* Stylus */
573
		int absx = ((data[3] << 8) & 0xff00) + (data[2] & 0xff);
574
		int absy = ((data[5] << 8) & 0xff00) + (data[4] & 0xff);
575
		int absp = ((data[7] << 8) & 0x0100) + (data[6] & 0xff);
576
		int oldtool = wacom_wac->tool[0];
577
		stylus_inrange = data[1] & 0x20;
578
579
		if (data[1] == 0) { /* Out of range */
580
			wacom_wac->tool[0] = 0;
581
			wacom_report_key (wcombo, BTN_TOOL_RUBBER, 0);
582
			wacom_report_key (wcombo, BTN_TOOL_PEN, 0);
583
			wacom_report_key (wcombo, BTN_TOUCH, 0);
584
			wacom_report_key (wcombo, BTN_STYLUS, 0);
585
			wacom_report_key (wcombo, BTN_STYLUS2, 0);
586
			goto end;
587
		} else if (data[1] & 0x8) { /* Eraser */
588
			wacom_wac->tool[0] = BTN_TOOL_RUBBER;
589
590
			if (oldtool == BTN_TOOL_PEN) {
591
				wacom_report_key (wcombo, BTN_TOOL_PEN, 0);
592
				wacom_report_key (wcombo, BTN_TOUCH, 0);
593
				wacom_report_key (wcombo, BTN_STYLUS, 0);
594
				wacom_report_key (wcombo, BTN_STYLUS2, 0);
595
				goto end;
596
			}
597
			wacom_report_key (wcombo, BTN_TOOL_RUBBER, data[1] & 0x20);
598
			wacom_report_key (wcombo, BTN_TOUCH, (data[1] & 0x4));
599
			wacom_report_abs (wcombo, ABS_MISC, STYLUS_DEVICE_ID);
600
		} else { /* Pen */
601
			wacom_wac->tool[0] = BTN_TOOL_PEN;
602
603
			if (oldtool == BTN_TOOL_RUBBER) {
604
				wacom_report_key (wcombo, BTN_TOOL_RUBBER, 0);
605
				wacom_report_key (wcombo, BTN_TOUCH, 0);
606
				goto end;
607
			}
608
			wacom_report_key (wcombo, BTN_TOOL_PEN, data[1] & 0x20);
609
			wacom_report_key (wcombo, BTN_TOUCH, (data[1] & 0x1));
610
			wacom_report_abs (wcombo, ABS_MISC, STYLUS_DEVICE_ID);
611
		}
612
		
613
		wacom_report_key (wcombo, BTN_STYLUS, data[1] & 0x2);
614
		wacom_report_key (wcombo, BTN_STYLUS2, data[1] & 0x10);
615
		wacom_report_abs (wcombo, ABS_X, absx);
616
		wacom_report_abs (wcombo, ABS_Y, absy);
617
		wacom_report_abs (wcombo, ABS_PRESSURE, absp);
618
	}
619
end:
620
	wacom_input_sync(wcombo);
621
	return 0;
622
}
623
538
int wacom_wac_irq(struct wacom_wac *wacom_wac, void *wcombo)
624
int wacom_wac_irq(struct wacom_wac *wacom_wac, void *wcombo)
539
{
625
{
540
	switch (wacom_wac->features->type) {
626
	switch (wacom_wac->features->type) {
Lines 560-565 Link Here
560
		case WACOM_BEE:
646
		case WACOM_BEE:
561
			return (wacom_intuos_irq(wacom_wac, wcombo));
647
			return (wacom_intuos_irq(wacom_wac, wcombo));
562
			break;
648
			break;
649
		case TABLETPC:
650
			return (wacom_tpc_irq(wacom_wac, wcombo));
651
			break;
563
		default:
652
		default:
564
			return 0;
653
			return 0;
565
	}
654
	}
Lines 596-601 Link Here
596
		case PENPARTNER:
685
		case PENPARTNER:
597
			input_dev_pt(input_dev, wacom_wac);
686
			input_dev_pt(input_dev, wacom_wac);
598
			break;
687
			break;
688
		case TABLETPC:
689
			input_dev_tpc(input_dev, wacom_wac);
690
			break;
599
	}
691
	}
600
	return;
692
	return;
601
}
693
}
Lines 651-656 Link Here
651
	{ "Wacom Cintiq 20WSX",  10, 86680, 54180, 1023, 63, WACOM_BEE },
743
	{ "Wacom Cintiq 20WSX",  10, 86680, 54180, 1023, 63, WACOM_BEE },
652
	{ "Wacom Cintiq 12WX",   10, 53020, 33440, 1023, 63, WACOM_BEE },
744
	{ "Wacom Cintiq 12WX",   10, 53020, 33440, 1023, 63, WACOM_BEE },
653
	{ "Wacom Intuos2 6x8",   10, 20320, 16240, 1023, 31, INTUOS },
745
	{ "Wacom Intuos2 6x8",   10, 20320, 16240, 1023, 31, INTUOS },
746
	{ "Wacom ISDv4 USB",      8, 26202, 16325,  255,  0, TABLETPC },
747
	{ "Wacom ISDv4 USB",      8, 26202, 16325,  255,  0, TABLETPC },
654
	{ }
748
	{ }
655
};
749
};
656
750
Lines 705-710 Link Here
705
	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC5) },
799
	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC5) },
706
	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC6) },
800
	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC6) },
707
	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x47) },
801
	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x47) },
802
	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x90) },
803
	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x93) },
708
	{ }
804
	{ }
709
};
805
};
710
806

Return to bug 223379