Lines Matching refs:spaceball
51 struct spaceball { struct
64 static void spaceball_process_packet(struct spaceball* spaceball) in spaceball_process_packet() argument
66 struct input_dev *dev = spaceball->dev; in spaceball_process_packet()
67 unsigned char *data = spaceball->data; in spaceball_process_packet()
70 if (spaceball->idx < 2) return; in spaceball_process_packet()
72 switch (spaceball->data[0]) { in spaceball_process_packet()
75 if (spaceball->idx != 15) return; in spaceball_process_packet()
88 if (spaceball->idx != 3) return; in spaceball_process_packet()
100 if (spaceball->idx != 3) return; in spaceball_process_packet()
117 spaceball->data[spaceball->idx - 1] = 0; in spaceball_process_packet()
118 printk(KERN_ERR "spaceball: Device error. [%s]\n", spaceball->data + 1); in spaceball_process_packet()
122 spaceball->data[spaceball->idx - 1] = 0; in spaceball_process_packet()
123 printk(KERN_ERR "spaceball: Bad command. [%s]\n", spaceball->data + 1); in spaceball_process_packet()
139 struct spaceball *spaceball = serio_get_drvdata(serio); in spaceball_interrupt() local
143 spaceball_process_packet(spaceball); in spaceball_interrupt()
144 spaceball->idx = 0; in spaceball_interrupt()
145 spaceball->escape = 0; in spaceball_interrupt()
148 if (!spaceball->escape) { in spaceball_interrupt()
149 spaceball->escape = 1; in spaceball_interrupt()
152 spaceball->escape = 0; in spaceball_interrupt()
157 if (spaceball->escape) { in spaceball_interrupt()
158 spaceball->escape = 0; in spaceball_interrupt()
163 if (spaceball->escape) in spaceball_interrupt()
164 spaceball->escape = 0; in spaceball_interrupt()
165 if (spaceball->idx < SPACEBALL_MAX_LENGTH) in spaceball_interrupt()
166 spaceball->data[spaceball->idx++] = data; in spaceball_interrupt()
178 struct spaceball* spaceball = serio_get_drvdata(serio); in spaceball_disconnect() local
182 input_unregister_device(spaceball->dev); in spaceball_disconnect()
183 kfree(spaceball); in spaceball_disconnect()
194 struct spaceball *spaceball; in spaceball_connect() local
202 spaceball = kmalloc(sizeof(struct spaceball), GFP_KERNEL); in spaceball_connect()
204 if (!spaceball || !input_dev) in spaceball_connect()
207 spaceball->dev = input_dev; in spaceball_connect()
208 snprintf(spaceball->phys, sizeof(spaceball->phys), "%s/input0", serio->phys); in spaceball_connect()
211 input_dev->phys = spaceball->phys; in spaceball_connect()
244 serio_set_drvdata(serio, spaceball); in spaceball_connect()
250 err = input_register_device(spaceball->dev); in spaceball_connect()
259 kfree(spaceball); in spaceball_connect()