Lines Matching refs:spaceorb
38 struct spaceorb { struct
55 static void spaceorb_process_packet(struct spaceorb *spaceorb) in spaceorb_process_packet() argument
57 struct input_dev *dev = spaceorb->dev; in spaceorb_process_packet()
58 unsigned char *data = spaceorb->data; in spaceorb_process_packet()
63 if (spaceorb->idx < 2) return; in spaceorb_process_packet()
64 for (i = 0; i < spaceorb->idx; i++) c ^= data[i]; in spaceorb_process_packet()
70 spaceorb->data[spaceorb->idx - 1] = 0; in spaceorb_process_packet()
71 for (i = 1; i < spaceorb->idx && spaceorb->data[i] == ' '; i++); in spaceorb_process_packet()
73 dev->name, spaceorb->data + i, spaceorb->phys); in spaceorb_process_packet()
77 if (spaceorb->idx != 12) return; in spaceorb_process_packet()
78 for (i = 0; i < 9; i++) spaceorb->data[i+2] ^= spaceorb_xor[i]; in spaceorb_process_packet()
92 if (spaceorb->idx != 5) return; in spaceorb_process_packet()
99 if (spaceorb->idx != 4) return; in spaceorb_process_packet()
112 struct spaceorb* spaceorb = serio_get_drvdata(serio); in spaceorb_interrupt() local
115 if (spaceorb->idx) spaceorb_process_packet(spaceorb); in spaceorb_interrupt()
116 spaceorb->idx = 0; in spaceorb_interrupt()
118 if (spaceorb->idx < SPACEORB_MAX_LENGTH) in spaceorb_interrupt()
119 spaceorb->data[spaceorb->idx++] = data & 0x7f; in spaceorb_interrupt()
129 struct spaceorb* spaceorb = serio_get_drvdata(serio); in spaceorb_disconnect() local
133 input_unregister_device(spaceorb->dev); in spaceorb_disconnect()
134 kfree(spaceorb); in spaceorb_disconnect()
145 struct spaceorb *spaceorb; in spaceorb_connect() local
150 spaceorb = kzalloc(sizeof(struct spaceorb), GFP_KERNEL); in spaceorb_connect()
152 if (!spaceorb || !input_dev) in spaceorb_connect()
155 spaceorb->dev = input_dev; in spaceorb_connect()
156 snprintf(spaceorb->phys, sizeof(spaceorb->phys), "%s/input0", serio->phys); in spaceorb_connect()
159 input_dev->phys = spaceorb->phys; in spaceorb_connect()
174 serio_set_drvdata(serio, spaceorb); in spaceorb_connect()
180 err = input_register_device(spaceorb->dev); in spaceorb_connect()
189 kfree(spaceorb); in spaceorb_connect()