usbmouse.c (48a7afe314bfc4d7f50e1608632f503dbba7e013) usbmouse.c (e071298589418076ef0a9813677f2d7032b65baa)
1/*
2 * $Id: usbmouse.c,v 1.15 2001/12/27 10:37:41 vojtech Exp $
3 *
4 * Copyright (c) 1999-2001 Vojtech Pavlik
5 *
6 * USB HIDBP Mouse support
7 */
8

--- 82 unchanged lines hidden (view full) ---

91 if (status)
92 err ("can't resubmit intr, %s-%s/input0, status %d",
93 mouse->usbdev->bus->bus_name,
94 mouse->usbdev->devpath, status);
95}
96
97static int usb_mouse_open(struct input_dev *dev)
98{
1/*
2 * $Id: usbmouse.c,v 1.15 2001/12/27 10:37:41 vojtech Exp $
3 *
4 * Copyright (c) 1999-2001 Vojtech Pavlik
5 *
6 * USB HIDBP Mouse support
7 */
8

--- 82 unchanged lines hidden (view full) ---

91 if (status)
92 err ("can't resubmit intr, %s-%s/input0, status %d",
93 mouse->usbdev->bus->bus_name,
94 mouse->usbdev->devpath, status);
95}
96
97static int usb_mouse_open(struct input_dev *dev)
98{
99 struct usb_mouse *mouse = dev->private;
99 struct usb_mouse *mouse = input_get_drvdata(dev);
100
101 mouse->irq->dev = mouse->usbdev;
102 if (usb_submit_urb(mouse->irq, GFP_KERNEL))
103 return -EIO;
104
105 return 0;
106}
107
108static void usb_mouse_close(struct input_dev *dev)
109{
100
101 mouse->irq->dev = mouse->usbdev;
102 if (usb_submit_urb(mouse->irq, GFP_KERNEL))
103 return -EIO;
104
105 return 0;
106}
107
108static void usb_mouse_close(struct input_dev *dev)
109{
110 struct usb_mouse *mouse = dev->private;
110 struct usb_mouse *mouse = input_get_drvdata(dev);
111
112 usb_kill_urb(mouse->irq);
113}
114
115static int usb_mouse_probe(struct usb_interface *intf, const struct usb_device_id *id)
116{
117 struct usb_device *dev = interface_to_usbdev(intf);
118 struct usb_host_interface *interface;

--- 47 unchanged lines hidden (view full) ---

166 le16_to_cpu(dev->descriptor.idProduct));
167
168 usb_make_path(dev, mouse->phys, sizeof(mouse->phys));
169 strlcat(mouse->phys, "/input0", sizeof(mouse->phys));
170
171 input_dev->name = mouse->name;
172 input_dev->phys = mouse->phys;
173 usb_to_input_id(dev, &input_dev->id);
111
112 usb_kill_urb(mouse->irq);
113}
114
115static int usb_mouse_probe(struct usb_interface *intf, const struct usb_device_id *id)
116{
117 struct usb_device *dev = interface_to_usbdev(intf);
118 struct usb_host_interface *interface;

--- 47 unchanged lines hidden (view full) ---

166 le16_to_cpu(dev->descriptor.idProduct));
167
168 usb_make_path(dev, mouse->phys, sizeof(mouse->phys));
169 strlcat(mouse->phys, "/input0", sizeof(mouse->phys));
170
171 input_dev->name = mouse->name;
172 input_dev->phys = mouse->phys;
173 usb_to_input_id(dev, &input_dev->id);
174 input_dev->cdev.dev = &intf->dev;
174 input_dev->dev.parent = &intf->dev;
175
176 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL);
177 input_dev->keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE);
178 input_dev->relbit[0] = BIT(REL_X) | BIT(REL_Y);
179 input_dev->keybit[LONG(BTN_MOUSE)] |= BIT(BTN_SIDE) | BIT(BTN_EXTRA);
180 input_dev->relbit[0] |= BIT(REL_WHEEL);
181
175
176 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL);
177 input_dev->keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE);
178 input_dev->relbit[0] = BIT(REL_X) | BIT(REL_Y);
179 input_dev->keybit[LONG(BTN_MOUSE)] |= BIT(BTN_SIDE) | BIT(BTN_EXTRA);
180 input_dev->relbit[0] |= BIT(REL_WHEEL);
181
182 input_dev->private = mouse;
182 input_set_drvdata(input_dev, mouse);
183
183 input_dev->open = usb_mouse_open;
184 input_dev->close = usb_mouse_close;
185
186 usb_fill_int_urb(mouse->irq, dev, pipe, mouse->data,
187 (maxp > 8 ? 8 : maxp),
188 usb_mouse_irq, mouse, endpoint->bInterval);
189 mouse->irq->transfer_dma = mouse->data_dma;
190 mouse->irq->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;

--- 62 unchanged lines hidden ---
184 input_dev->open = usb_mouse_open;
185 input_dev->close = usb_mouse_close;
186
187 usb_fill_int_urb(mouse->irq, dev, pipe, mouse->data,
188 (maxp > 8 ? 8 : maxp),
189 usb_mouse_irq, mouse, endpoint->bInterval);
190 mouse->irq->transfer_dma = mouse->data_dma;
191 mouse->irq->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;

--- 62 unchanged lines hidden ---