Lines Matching defs:twidjoy
78 struct twidjoy {
90 static void twidjoy_process_packet(struct twidjoy *twidjoy)
92 struct input_dev *dev = twidjoy->dev;
93 unsigned char *data = twidjoy->data;
127 struct twidjoy *twidjoy = serio_get_drvdata(serio);
134 twidjoy->idx = 0; /* this byte starts a new packet */
135 else if (twidjoy->idx == 0)
138 if (twidjoy->idx < TWIDJOY_MAX_LENGTH)
139 twidjoy->data[twidjoy->idx++] = data;
141 if (twidjoy->idx == TWIDJOY_MAX_LENGTH) {
142 twidjoy_process_packet(twidjoy);
143 twidjoy->idx = 0;
155 struct twidjoy *twidjoy = serio_get_drvdata(serio);
159 input_unregister_device(twidjoy->dev);
160 kfree(twidjoy);
172 struct twidjoy *twidjoy;
177 twidjoy = kzalloc(sizeof(struct twidjoy), GFP_KERNEL);
179 if (!twidjoy || !input_dev)
182 twidjoy->dev = input_dev;
183 snprintf(twidjoy->phys, sizeof(twidjoy->phys), "%s/input0", serio->phys);
186 input_dev->phys = twidjoy->phys;
201 serio_set_drvdata(serio, twidjoy);
207 err = input_register_device(twidjoy->dev);
216 kfree(twidjoy);
238 .name = "twidjoy",