Lines Matching refs:spaceball

69 struct spaceball {  struct
82 static void spaceball_process_packet(struct spaceball* spaceball) in spaceball_process_packet() argument
84 struct input_dev *dev = spaceball->dev; in spaceball_process_packet()
85 unsigned char *data = spaceball->data; in spaceball_process_packet()
88 if (spaceball->idx < 2) return; in spaceball_process_packet()
90 switch (spaceball->data[0]) { in spaceball_process_packet()
93 if (spaceball->idx != 15) return; in spaceball_process_packet()
100 if (spaceball->idx != 3) return; in spaceball_process_packet()
112 if (spaceball->idx != 3) return; in spaceball_process_packet()
129 spaceball->data[spaceball->idx - 1] = 0; in spaceball_process_packet()
130 printk(KERN_ERR "spaceball: Device error. [%s]\n", spaceball->data + 1); in spaceball_process_packet()
134 spaceball->data[spaceball->idx - 1] = 0; in spaceball_process_packet()
135 printk(KERN_ERR "spaceball: Bad command. [%s]\n", spaceball->data + 1); in spaceball_process_packet()
151 struct spaceball *spaceball = serio_get_drvdata(serio); in spaceball_interrupt() local
155 spaceball_process_packet(spaceball); in spaceball_interrupt()
156 spaceball->idx = 0; in spaceball_interrupt()
157 spaceball->escape = 0; in spaceball_interrupt()
160 if (!spaceball->escape) { in spaceball_interrupt()
161 spaceball->escape = 1; in spaceball_interrupt()
164 spaceball->escape = 0; in spaceball_interrupt()
168 if (spaceball->escape) { in spaceball_interrupt()
169 spaceball->escape = 0; in spaceball_interrupt()
173 if (spaceball->escape) in spaceball_interrupt()
174 spaceball->escape = 0; in spaceball_interrupt()
175 if (spaceball->idx < SPACEBALL_MAX_LENGTH) in spaceball_interrupt()
176 spaceball->data[spaceball->idx++] = data; in spaceball_interrupt()
188 struct spaceball* spaceball = serio_get_drvdata(serio); in spaceball_disconnect() local
192 input_unregister_device(spaceball->dev); in spaceball_disconnect()
193 kfree(spaceball); in spaceball_disconnect()
204 struct spaceball *spaceball; in spaceball_connect() local
212 spaceball = kmalloc(sizeof(struct spaceball), GFP_KERNEL); in spaceball_connect()
214 if (!spaceball || !input_dev) in spaceball_connect()
217 spaceball->dev = input_dev; in spaceball_connect()
218 snprintf(spaceball->phys, sizeof(spaceball->phys), "%s/input0", serio->phys); in spaceball_connect()
221 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()