Lines Matching refs:spaceball
54 struct spaceball { struct
67 static void spaceball_process_packet(struct spaceball* spaceball) in spaceball_process_packet() argument
69 struct input_dev *dev = spaceball->dev; in spaceball_process_packet()
70 unsigned char *data = spaceball->data; in spaceball_process_packet()
73 if (spaceball->idx < 2) return; in spaceball_process_packet()
75 switch (spaceball->data[0]) { in spaceball_process_packet()
78 if (spaceball->idx != 15) return; in spaceball_process_packet()
91 if (spaceball->idx != 3) return; in spaceball_process_packet()
103 if (spaceball->idx != 3) return; in spaceball_process_packet()
120 spaceball->data[spaceball->idx - 1] = 0; in spaceball_process_packet()
121 printk(KERN_ERR "spaceball: Device error. [%s]\n", spaceball->data + 1); in spaceball_process_packet()
125 spaceball->data[spaceball->idx - 1] = 0; in spaceball_process_packet()
126 printk(KERN_ERR "spaceball: Bad command. [%s]\n", spaceball->data + 1); in spaceball_process_packet()
142 struct spaceball *spaceball = serio_get_drvdata(serio); in spaceball_interrupt() local
146 spaceball_process_packet(spaceball); in spaceball_interrupt()
147 spaceball->idx = 0; in spaceball_interrupt()
148 spaceball->escape = 0; in spaceball_interrupt()
151 if (!spaceball->escape) { in spaceball_interrupt()
152 spaceball->escape = 1; in spaceball_interrupt()
155 spaceball->escape = 0; in spaceball_interrupt()
160 if (spaceball->escape) { in spaceball_interrupt()
161 spaceball->escape = 0; in spaceball_interrupt()
166 if (spaceball->escape) in spaceball_interrupt()
167 spaceball->escape = 0; in spaceball_interrupt()
168 if (spaceball->idx < SPACEBALL_MAX_LENGTH) in spaceball_interrupt()
169 spaceball->data[spaceball->idx++] = data; in spaceball_interrupt()
181 struct spaceball* spaceball = serio_get_drvdata(serio); in spaceball_disconnect() local
185 input_unregister_device(spaceball->dev); in spaceball_disconnect()
186 kfree(spaceball); in spaceball_disconnect()
197 struct spaceball *spaceball; in spaceball_connect() local
205 spaceball = kmalloc(sizeof(struct spaceball), GFP_KERNEL); in spaceball_connect()
207 if (!spaceball || !input_dev) in spaceball_connect()
210 spaceball->dev = input_dev; in spaceball_connect()
211 snprintf(spaceball->phys, sizeof(spaceball->phys), "%s/input0", serio->phys); in spaceball_connect()
214 input_dev->phys = spaceball->phys; in spaceball_connect()
247 serio_set_drvdata(serio, spaceball); in spaceball_connect()
253 err = input_register_device(spaceball->dev); in spaceball_connect()
262 kfree(spaceball); in spaceball_connect()