19 #include <linux/kernel.h>
20 #include <linux/errno.h>
23 #include <linux/slab.h>
24 #include <linux/module.h>
27 #include <asm/uaccess.h>
33 #define HEADER "P5 225 289 255 "
34 #define IMGSIZE ((WIDTH * HEIGHT) + sizeof(HEADER)-1)
37 #define DRIVER_VERSION "0.6"
38 #define DRIVER_SHORT "idmouse"
40 #define DRIVER_DESC "Siemens ID Mouse FingerTIP Sensor Driver"
43 #define USB_IDMOUSE_MINOR_BASE 132
46 #define ID_SIEMENS 0x0681
47 #define ID_IDMOUSE 0x0005
48 #define ID_CHERRY 0x0010
58 #define FTIP_RESET 0x20
59 #define FTIP_ACQUIRE 0x21
60 #define FTIP_RELEASE 0x22
61 #define FTIP_BLINK 0x23
62 #define FTIP_SCROLL 0x24
64 #define ftip_command(dev, command, value, index) \
65 usb_control_msg (dev->udev, usb_sndctrlpipe (dev->udev, 0), command, \
66 USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT, value, index, NULL, 0, 1000)
90 size_t count, loff_t * ppos);
105 .read = idmouse_read,
106 .open = idmouse_open,
107 .release = idmouse_release,
112 static struct usb_class_driver idmouse_class = {
114 .fops = &idmouse_fops,
119 static struct usb_driver idmouse_driver = {
121 .probe = idmouse_probe,
122 .disconnect = idmouse_disconnect,
123 .suspend = idmouse_suspend,
124 .resume = idmouse_resume,
125 .reset_resume = idmouse_resume,
126 .id_table = idmouse_table,
127 .supports_autosuspend = 1,
137 bytes_read =
sizeof(
HEADER)-1;
184 bytes_read += bulk_read;
198 for (bytes_read = IMGSIZE-
WIDTH; bytes_read < IMGSIZE-1; bytes_read++)
219 static inline void idmouse_delete(
struct usb_idmouse *dev)
238 dev = usb_get_intfdata(interface);
257 result = usb_autopm_get_interface(interface);
260 result = idmouse_create_image (dev);
263 usb_autopm_put_interface(interface);
280 static int idmouse_release(
struct inode *inode,
struct file *file)
294 if (dev->
open <= 0) {
339 struct usb_device *
udev = interface_to_usbdev(interface);
341 struct usb_host_interface *iface_desc;
346 iface_desc = &interface->altsetting[0];
347 if (iface_desc->desc.bInterfaceClass != 0x0A)
360 endpoint = &iface_desc->endpoint[0].desc;
370 dev_err(&interface->dev,
"Unable to allocate input buffer.\n");
377 dev_err(&interface->dev,
"Unable to find bulk-in endpoint.\n");
385 usb_set_intfdata(interface, dev);
389 dev_err(&interface->dev,
"Unble to allocate minor number.\n");
390 usb_set_intfdata(interface,
NULL);
401 static void idmouse_disconnect(
struct usb_interface *interface)
406 dev = usb_get_intfdata(interface);
412 usb_set_intfdata(interface,
NULL);
429 dev_info(&interface->dev,
"disconnected\n");