From: Vojtech Pavlik <vojtech@suse.cz>
To: Vojtech Pavlik <vojtech@suse.cz>
Cc: torvalds@transmeta.com, linux-kernel@vger.kernel.org
Subject: [patch] input: Resurrect usb_set_report for Aiptek and Wacom tablets [12/14]
Date: Wed, 12 Feb 2003 12:06:38 +0100 [thread overview]
Message-ID: <20030212120638.K1563@ucw.cz> (raw)
In-Reply-To: <20030212120605.J1563@ucw.cz>; from vojtech@suse.cz on Wed, Feb 12, 2003 at 12:06:05PM +0100
You can pull this changeset from:
bk://kernel.bkbits.net/vojtech/input
===================================================================
ChangeSet@1.1015, 2003-02-12 11:07:29+01:00, vojtech@suse.cz
input: Resurrect usb_set_report for Aiptek and Wacom tablets.
aiptek.c | 29 +++++++++++++++++------------
wacom.c | 14 ++++++++++++--
2 files changed, 29 insertions(+), 14 deletions(-)
===================================================================
diff -Nru a/drivers/usb/input/aiptek.c b/drivers/usb/input/aiptek.c
--- a/drivers/usb/input/aiptek.c Wed Feb 12 11:56:32 2003
+++ b/drivers/usb/input/aiptek.c Wed Feb 12 11:56:32 2003
@@ -224,13 +224,18 @@
usb_unlink_urb(aiptek->irq);
}
-/*
- * FIXME, either remove this call, or talk the maintainer into
- * adding usb_set_report back into the core.
- */
-#if 0
+#define USB_REQ_SET_REPORT 0x09
+static int
+usb_set_report(struct usb_device *dev, struct usb_host_interface *inter, unsigned char type,
+ unsigned char id, void *buf, int size)
+{
+ return usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
+ USB_REQ_SET_REPORT, USB_TYPE_CLASS | USB_RECIP_INTERFACE,
+ (type << 8) + id, inter->desc.bInterfaceNumber, buf, size, HZ);
+}
+
static void
-aiptek_command(struct usb_device *dev, unsigned int ifnum,
+aiptek_command(struct usb_device *dev, struct usb_host_interface *inter,
unsigned char command, unsigned char data)
{
__u8 buf[3];
@@ -239,17 +244,17 @@
buf[1] = command;
buf[2] = data;
- if (usb_set_report(dev, ifnum, 3, 2, buf, 3) != 3) {
+ if (usb_set_report(dev, inter, 3, 2, buf, 3) != 3) {
dbg("aiptek_command: 0x%x 0x%x\n", command, data);
}
}
-#endif
static int
aiptek_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
struct usb_device *dev = interface_to_usbdev (intf);
+ struct usb_host_interface *interface = intf->altsetting + 0;
struct usb_endpoint_descriptor *endpoint;
struct aiptek *aiptek;
@@ -271,11 +276,11 @@
return -ENOMEM;
}
- // Resolution500LPI
-// aiptek_command(dev, ifnum, 0x18, 0x04);
+ /* Resolution500LPI */
+ aiptek_command(dev, interface, 0x18, 0x04);
- // SwitchToTablet
-// aiptek_command(dev, ifnum, 0x10, 0x01);
+ /* SwitchToTablet */
+ aiptek_command(dev, interface, 0x10, 0x01);
aiptek->features = aiptek_features + id->driver_info;
diff -Nru a/drivers/usb/input/wacom.c b/drivers/usb/input/wacom.c
--- a/drivers/usb/input/wacom.c Wed Feb 12 11:56:32 2003
+++ b/drivers/usb/input/wacom.c Wed Feb 12 11:56:32 2003
@@ -102,6 +102,17 @@
char phys[32];
};
+#define USB_REQ_SET_REPORT 0x09
+static int usb_set_report(struct usb_interface *intf, unsigned char type,
+ unsigned char id, void *buf, int size)
+{
+ return usb_control_msg(interface_to_usbdev(intf),
+ usb_sndctrlpipe(interface_to_usbdev(intf), 0),
+ USB_REQ_SET_REPORT, USB_TYPE_CLASS | USB_RECIP_INTERFACE,
+ (type << 8) + id, intf->altsetting[0].desc.bInterfaceNumber,
+ buf, size, HZ);
+}
+
static void wacom_pl_irq(struct urb *urb, struct pt_regs *regs)
{
struct wacom *wacom = urb->context;
@@ -488,6 +499,7 @@
{
struct usb_device *dev = interface_to_usbdev(intf);
struct usb_endpoint_descriptor *endpoint;
+ char rep_data[2] = {0x02, 0x02};
struct wacom *wacom;
char path[64];
@@ -582,11 +594,9 @@
input_register_device(&wacom->dev);
-#if 0 /* Missing usb_set_report() */
usb_set_report(intf, 3, 2, rep_data, 2);
usb_set_report(intf, 3, 5, rep_data, 0);
usb_set_report(intf, 3, 6, rep_data, 0);
-#endif
printk(KERN_INFO "input: %s on %s\n", wacom->features->name, path);
next prev parent reply other threads:[~2003-02-12 10:57 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-12 10:59 [patch] input: Update AT+PS/2 mouse and keyboard drivers [1/14] Vojtech Pavlik
2003-02-12 11:00 ` [patch] input: Remove include/linux/pc_keyb.h and old PS/2 code [2/14] Vojtech Pavlik
2003-02-12 11:01 ` [patch] input: Only generate rawmode warnings for keys [3/14] Vojtech Pavlik
2003-02-12 11:01 ` [patch] input: Let newly connected keyboards pickup the LED state. [4/14] Vojtech Pavlik
2003-02-12 11:02 ` [patch] input: Get rid of kbd_pt_regs [5/14] Vojtech Pavlik
2003-02-12 11:03 ` [patch] input: Support for NEC PC-9800 beeper and support for Kana Lock [6/14] Vojtech Pavlik
2003-02-12 11:03 ` [patch] input: HID update [7/14] Vojtech Pavlik
2003-02-12 11:04 ` [patch] input: joydev/mousedev update [8/14] Vojtech Pavlik
2003-02-12 11:04 ` [patch] input: Give preferential treatment to gameport at 0x201 [9/14] Vojtech Pavlik
2003-02-12 11:05 ` [patch] input: Add support for ThrustMaster ForceFeedback [10/14] Vojtech Pavlik
2003-02-12 11:06 ` [patch] input: PowerMate driver update [11/14] Vojtech Pavlik
2003-02-12 11:06 ` Vojtech Pavlik [this message]
2003-02-12 11:07 ` [patch] input: Add two new serio type #defines [13/14] Vojtech Pavlik
2003-02-12 11:07 ` [patch] input: sunkbd.c - fix reading beyond end of keycode array [14/14] Vojtech Pavlik
2003-02-12 16:38 ` Randy.Dunlap
2003-02-13 1:06 ` Vojtech Pavlik
2003-02-12 16:13 ` [patch] input: Get rid of kbd_pt_regs [5/14] James Simmons
2003-02-13 1:13 ` Vojtech Pavlik
2003-02-13 16:39 ` James Simmons
2003-02-13 16:40 ` Linus Torvalds
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030212120638.K1563@ucw.cz \
--to=vojtech@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox