Lines Matching defs:twidjoy
91 struct twidjoy {
103 static void twidjoy_process_packet(struct twidjoy *twidjoy)
105 struct input_dev *dev = twidjoy->dev;
106 unsigned char *data = twidjoy->data;
140 struct twidjoy *twidjoy = serio_get_drvdata(serio);
147 twidjoy->idx = 0; /* this byte starts a new packet */
148 else if (twidjoy->idx == 0)
151 if (twidjoy->idx < TWIDJOY_MAX_LENGTH)
152 twidjoy->data[twidjoy->idx++] = data;
154 if (twidjoy->idx == TWIDJOY_MAX_LENGTH) {
155 twidjoy_process_packet(twidjoy);
156 twidjoy->idx = 0;
168 struct twidjoy *twidjoy = serio_get_drvdata(serio);
172 input_unregister_device(twidjoy->dev);
173 kfree(twidjoy);
185 struct twidjoy *twidjoy;
190 twidjoy = kzalloc(sizeof(struct twidjoy), GFP_KERNEL);
192 if (!twidjoy || !input_dev)
195 twidjoy->dev = input_dev;
196 snprintf(twidjoy->phys, sizeof(twidjoy->phys), "%s/input0", serio->phys);
199 input_dev->phys = twidjoy->phys;
214 serio_set_drvdata(serio, twidjoy);
220 err = input_register_device(twidjoy->dev);
229 kfree(twidjoy);
251 .name = "twidjoy",