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