Lines Matching refs:i

96 	int data1, data2, i;  in tgfx_timer()  local
98 for (i = 0; i < 7; i++) in tgfx_timer()
99 if (tgfx->sticks & (1 << i)) { in tgfx_timer()
101 dev = tgfx->dev[i]; in tgfx_timer()
103 parport_write_data(tgfx->pd->port, ~(1 << i)); in tgfx_timer()
165 int i, j, port_idx; in tgfx_attach() local
207 for (i = 0; i < n_devs; i++) { in tgfx_attach()
208 if (n_buttons[i] < 1) in tgfx_attach()
211 if (n_buttons[i] > ARRAY_SIZE(tgfx_buttons)) { in tgfx_attach()
212 printk(KERN_ERR "turbografx.c: Invalid number of buttons %d\n", n_buttons[i]); in tgfx_attach()
216 tgfx->dev[i] = input_dev = input_allocate_device(); in tgfx_attach()
222 tgfx->sticks |= (1 << i); in tgfx_attach()
223 snprintf(tgfx->name[i], sizeof(tgfx->name[i]), in tgfx_attach()
224 "TurboGraFX %d-button Multisystem joystick", n_buttons[i]); in tgfx_attach()
225 snprintf(tgfx->phys[i], sizeof(tgfx->phys[i]), in tgfx_attach()
226 "%s/input%d", tgfx->pd->port->name, i); in tgfx_attach()
228 input_dev->name = tgfx->name[i]; in tgfx_attach()
229 input_dev->phys = tgfx->phys[i]; in tgfx_attach()
232 input_dev->id.product = n_buttons[i]; in tgfx_attach()
244 for (j = 0; j < n_buttons[i]; j++) in tgfx_attach()
247 if (input_register_device(tgfx->dev[i])) in tgfx_attach()
260 input_free_device(tgfx->dev[i]); in tgfx_attach()
262 while (--i >= 0) in tgfx_attach()
263 if (tgfx->dev[i]) in tgfx_attach()
264 input_unregister_device(tgfx->dev[i]); in tgfx_attach()
273 int i; in tgfx_detach() local
276 for (i = 0; i < TGFX_MAX_PORTS; i++) { in tgfx_detach()
277 if (tgfx_base[i] && tgfx_base[i]->parportno == port->number) in tgfx_detach()
281 if (i == TGFX_MAX_PORTS) in tgfx_detach()
284 tgfx = tgfx_base[i]; in tgfx_detach()
285 tgfx_base[i] = NULL; in tgfx_detach()
287 for (i = 0; i < TGFX_MAX_DEVICES; i++) in tgfx_detach()
288 if (tgfx->dev[i]) in tgfx_detach()
289 input_unregister_device(tgfx->dev[i]); in tgfx_detach()
303 int i; in tgfx_init() local
306 for (i = 0; i < TGFX_MAX_PORTS; i++) { in tgfx_init()
307 if (tgfx_cfg[i].nargs == 0 || tgfx_cfg[i].args[0] < 0) in tgfx_init()
310 if (tgfx_cfg[i].nargs < 2) { in tgfx_init()