Lines Matching refs:spaceball

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