Lines Matching refs:spaceball
53 struct spaceball { struct
66 static void spaceball_process_packet(struct spaceball* spaceball) in spaceball_process_packet() argument
68 struct input_dev *dev = spaceball->dev; in spaceball_process_packet()
69 unsigned char *data = spaceball->data; in spaceball_process_packet()
72 if (spaceball->idx < 2) return; in spaceball_process_packet()
74 switch (spaceball->data[0]) { in spaceball_process_packet()
77 if (spaceball->idx != 15) return; in spaceball_process_packet()
84 if (spaceball->idx != 3) return; in spaceball_process_packet()
96 if (spaceball->idx != 3) return; in spaceball_process_packet()
113 spaceball->data[spaceball->idx - 1] = 0; in spaceball_process_packet()
114 printk(KERN_ERR "spaceball: Device error. [%s]\n", spaceball->data + 1); in spaceball_process_packet()
118 spaceball->data[spaceball->idx - 1] = 0; in spaceball_process_packet()
119 printk(KERN_ERR "spaceball: Bad command. [%s]\n", spaceball->data + 1); in spaceball_process_packet()
135 struct spaceball *spaceball = serio_get_drvdata(serio); in spaceball_interrupt() local
139 spaceball_process_packet(spaceball); in spaceball_interrupt()
140 spaceball->idx = 0; in spaceball_interrupt()
141 spaceball->escape = 0; in spaceball_interrupt()
144 if (!spaceball->escape) { in spaceball_interrupt()
145 spaceball->escape = 1; in spaceball_interrupt()
148 spaceball->escape = 0; in spaceball_interrupt()
153 if (spaceball->escape) { in spaceball_interrupt()
154 spaceball->escape = 0; in spaceball_interrupt()
159 if (spaceball->escape) in spaceball_interrupt()
160 spaceball->escape = 0; in spaceball_interrupt()
161 if (spaceball->idx < SPACEBALL_MAX_LENGTH) in spaceball_interrupt()
162 spaceball->data[spaceball->idx++] = data; in spaceball_interrupt()
174 struct spaceball* spaceball = serio_get_drvdata(serio); in spaceball_disconnect() local
178 input_unregister_device(spaceball->dev); in spaceball_disconnect()
179 kfree(spaceball); in spaceball_disconnect()
190 struct spaceball *spaceball; in spaceball_connect() local
198 spaceball = kmalloc(sizeof(struct spaceball), GFP_KERNEL); in spaceball_connect()
200 if (!spaceball || !input_dev) in spaceball_connect()
203 spaceball->dev = input_dev; in spaceball_connect()
204 snprintf(spaceball->phys, sizeof(spaceball->phys), "%s/input0", serio->phys); in spaceball_connect()
207 input_dev->phys = spaceball->phys; in spaceball_connect()
240 serio_set_drvdata(serio, spaceball); in spaceball_connect()
246 err = input_register_device(spaceball->dev); in spaceball_connect()
255 kfree(spaceball); in spaceball_connect()