Lines Matching refs:mouse

60 	struct usb_mouse *mouse = urb->context;  in usb_mouse_irq()  local
61 signed char *data = mouse->data; in usb_mouse_irq()
62 struct input_dev *dev = &mouse->dev; in usb_mouse_irq()
79 struct usb_mouse *mouse = dev->private; in usb_mouse_open() local
81 if (mouse->open++) in usb_mouse_open()
84 mouse->irq.dev = mouse->usbdev; in usb_mouse_open()
85 if (usb_submit_urb(&mouse->irq)) in usb_mouse_open()
93 struct usb_mouse *mouse = dev->private; in usb_mouse_close() local
95 if (!--mouse->open) in usb_mouse_close()
96 usb_unlink_urb(&mouse->irq); in usb_mouse_close()
105 struct usb_mouse *mouse; in usb_mouse_probe() local
125 if (!(mouse = kmalloc(sizeof(struct usb_mouse), GFP_KERNEL))) return NULL; in usb_mouse_probe()
126 memset(mouse, 0, sizeof(struct usb_mouse)); in usb_mouse_probe()
128 mouse->usbdev = dev; in usb_mouse_probe()
130 mouse->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_REL); in usb_mouse_probe()
131 mouse->dev.keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE); in usb_mouse_probe()
132 mouse->dev.relbit[0] = BIT(REL_X) | BIT(REL_Y); in usb_mouse_probe()
133 mouse->dev.keybit[LONG(BTN_MOUSE)] |= BIT(BTN_SIDE) | BIT(BTN_EXTRA); in usb_mouse_probe()
134 mouse->dev.relbit[0] |= BIT(REL_WHEEL); in usb_mouse_probe()
136 mouse->dev.private = mouse; in usb_mouse_probe()
137 mouse->dev.open = usb_mouse_open; in usb_mouse_probe()
138 mouse->dev.close = usb_mouse_close; in usb_mouse_probe()
140 mouse->dev.name = mouse->name; in usb_mouse_probe()
141 mouse->dev.idbus = BUS_USB; in usb_mouse_probe()
142 mouse->dev.idvendor = dev->descriptor.idVendor; in usb_mouse_probe()
143 mouse->dev.idproduct = dev->descriptor.idProduct; in usb_mouse_probe()
144 mouse->dev.idversion = dev->descriptor.bcdDevice; in usb_mouse_probe()
147 kfree(mouse); in usb_mouse_probe()
153 strcat(mouse->name, buf); in usb_mouse_probe()
156 sprintf(mouse->name, "%s %s", mouse->name, buf); in usb_mouse_probe()
158 if (!strlen(mouse->name)) in usb_mouse_probe()
159 sprintf(mouse->name, "USB HIDBP Mouse %04x:%04x", in usb_mouse_probe()
160 mouse->dev.idvendor, mouse->dev.idproduct); in usb_mouse_probe()
164 FILL_INT_URB(&mouse->irq, dev, pipe, mouse->data, maxp > 8 ? 8 : maxp, in usb_mouse_probe()
165 usb_mouse_irq, mouse, endpoint->bInterval); in usb_mouse_probe()
167 input_register_device(&mouse->dev); in usb_mouse_probe()
170 mouse->dev.number, mouse->name, dev->bus->busnum, dev->devnum, ifnum); in usb_mouse_probe()
172 return mouse; in usb_mouse_probe()
177 struct usb_mouse *mouse = ptr; in usb_mouse_disconnect() local
178 usb_unlink_urb(&mouse->irq); in usb_mouse_disconnect()
179 input_unregister_device(&mouse->dev); in usb_mouse_disconnect()
180 kfree(mouse); in usb_mouse_disconnect()