Lines Matching refs:spaceball
65 struct spaceball { struct
78 static void spaceball_process_packet(struct spaceball* spaceball) in spaceball_process_packet() argument
80 struct input_dev *dev = spaceball->dev; in spaceball_process_packet()
81 unsigned char *data = spaceball->data; in spaceball_process_packet()
84 if (spaceball->idx < 2) return; in spaceball_process_packet()
86 switch (spaceball->data[0]) { in spaceball_process_packet()
89 if (spaceball->idx != 15) return; in spaceball_process_packet()
96 if (spaceball->idx != 3) return; in spaceball_process_packet()
108 if (spaceball->idx != 3) return; in spaceball_process_packet()
125 spaceball->data[spaceball->idx - 1] = 0; in spaceball_process_packet()
126 printk(KERN_ERR "spaceball: Device error. [%s]\n", spaceball->data + 1); in spaceball_process_packet()
130 spaceball->data[spaceball->idx - 1] = 0; in spaceball_process_packet()
131 printk(KERN_ERR "spaceball: Bad command. [%s]\n", spaceball->data + 1); in spaceball_process_packet()
147 struct spaceball *spaceball = serio_get_drvdata(serio); in spaceball_interrupt() local
151 spaceball_process_packet(spaceball); in spaceball_interrupt()
152 spaceball->idx = 0; in spaceball_interrupt()
153 spaceball->escape = 0; in spaceball_interrupt()
156 if (!spaceball->escape) { in spaceball_interrupt()
157 spaceball->escape = 1; in spaceball_interrupt()
160 spaceball->escape = 0; in spaceball_interrupt()
165 if (spaceball->escape) { in spaceball_interrupt()
166 spaceball->escape = 0; in spaceball_interrupt()
171 if (spaceball->escape) in spaceball_interrupt()
172 spaceball->escape = 0; in spaceball_interrupt()
173 if (spaceball->idx < SPACEBALL_MAX_LENGTH) in spaceball_interrupt()
174 spaceball->data[spaceball->idx++] = data; in spaceball_interrupt()
186 struct spaceball* spaceball = serio_get_drvdata(serio); in spaceball_disconnect() local
190 input_unregister_device(spaceball->dev); in spaceball_disconnect()
191 kfree(spaceball); in spaceball_disconnect()
202 struct spaceball *spaceball; in spaceball_connect() local
210 spaceball = kmalloc(sizeof(struct spaceball), GFP_KERNEL); in spaceball_connect()
212 if (!spaceball || !input_dev) in spaceball_connect()
215 spaceball->dev = input_dev; in spaceball_connect()
216 snprintf(spaceball->phys, sizeof(spaceball->phys), "%s/input0", serio->phys); in spaceball_connect()
219 input_dev->phys = spaceball->phys; in spaceball_connect()
252 serio_set_drvdata(serio, spaceball); in spaceball_connect()
258 err = input_register_device(spaceball->dev); in spaceball_connect()
267 kfree(spaceball); in spaceball_connect()