Lines Matching refs:ir
33 dev_printk(KERN_DEBUG, &ir->dev->intf->dev, \
63 int (*get_key_i2c)(struct i2c_client *ir, enum rc_proto *protocol,
65 int (*get_key)(struct em28xx_IR *ir, struct em28xx_ir_poll_result *r);
194 static int default_polling_getkey(struct em28xx_IR *ir, in default_polling_getkey() argument
197 struct em28xx *dev = ir->dev; in default_polling_getkey()
217 switch (ir->rc_proto) { in default_polling_getkey()
237 static int em2874_polling_getkey(struct em28xx_IR *ir, in em2874_polling_getkey() argument
240 struct em28xx *dev = ir->dev; in em2874_polling_getkey()
263 switch (ir->rc_proto) { in em2874_polling_getkey()
293 static int em28xx_i2c_ir_handle_key(struct em28xx_IR *ir) in em28xx_i2c_ir_handle_key() argument
299 rc = ir->get_key_i2c(ir->i2c_client, &protocol, &scancode); in em28xx_i2c_ir_handle_key()
308 rc_keydown(ir->rc, protocol, scancode, 0); in em28xx_i2c_ir_handle_key()
313 static void em28xx_ir_handle_key(struct em28xx_IR *ir) in em28xx_ir_handle_key() argument
319 result = ir->get_key(ir, &poll_result); in em28xx_ir_handle_key()
325 if (unlikely(poll_result.read_count != ir->last_readcount)) { in em28xx_ir_handle_key()
329 if (ir->full_code) in em28xx_ir_handle_key()
330 rc_keydown(ir->rc, in em28xx_ir_handle_key()
335 rc_keydown(ir->rc, in em28xx_ir_handle_key()
340 if (ir->dev->chip_id == CHIP_ID_EM2874 || in em28xx_ir_handle_key()
341 ir->dev->chip_id == CHIP_ID_EM2884) in em28xx_ir_handle_key()
350 ir->last_readcount = 0; in em28xx_ir_handle_key()
352 ir->last_readcount = poll_result.read_count; in em28xx_ir_handle_key()
358 struct em28xx_IR *ir = container_of(work, struct em28xx_IR, work.work); in em28xx_ir_work() local
360 if (ir->i2c_client) /* external i2c device */ in em28xx_ir_work()
361 em28xx_i2c_ir_handle_key(ir); in em28xx_ir_work()
363 em28xx_ir_handle_key(ir); in em28xx_ir_work()
364 schedule_delayed_work(&ir->work, msecs_to_jiffies(ir->polling)); in em28xx_ir_work()
369 struct em28xx_IR *ir = rc->priv; in em28xx_ir_start() local
371 INIT_DELAYED_WORK(&ir->work, em28xx_ir_work); in em28xx_ir_start()
372 schedule_delayed_work(&ir->work, 0); in em28xx_ir_start()
379 struct em28xx_IR *ir = rc->priv; in em28xx_ir_stop() local
381 cancel_delayed_work_sync(&ir->work); in em28xx_ir_stop()
386 struct em28xx_IR *ir = rc_dev->priv; in em2860_ir_change_protocol() local
387 struct em28xx *dev = ir->dev; in em2860_ir_change_protocol()
392 ir->full_code = 1; in em2860_ir_change_protocol()
396 ir->full_code = 1; in em2860_ir_change_protocol()
401 *rc_proto = ir->rc_proto; in em2860_ir_change_protocol()
407 ir->rc_proto = *rc_proto; in em2860_ir_change_protocol()
414 struct em28xx_IR *ir = rc_dev->priv; in em2874_ir_change_protocol() local
415 struct em28xx *dev = ir->dev; in em2874_ir_change_protocol()
421 ir->full_code = 1; in em2874_ir_change_protocol()
426 ir->full_code = 1; in em2874_ir_change_protocol()
431 ir->full_code = 1; in em2874_ir_change_protocol()
436 *rc_proto = ir->rc_proto; in em2874_ir_change_protocol()
443 ir->rc_proto = *rc_proto; in em2874_ir_change_protocol()
450 struct em28xx_IR *ir = rc_dev->priv; in em28xx_ir_change_protocol() local
451 struct em28xx *dev = ir->dev; in em28xx_ir_change_protocol()
464 dev_err(&ir->dev->intf->dev, in em28xx_ir_change_protocol()
690 struct em28xx_IR *ir; in em28xx_ir_init() local
727 ir = kzalloc(sizeof(*ir), GFP_KERNEL); in em28xx_ir_init()
728 if (!ir) in em28xx_ir_init()
735 ir->dev = dev; in em28xx_ir_init()
736 dev->ir = ir; in em28xx_ir_init()
737 ir->rc = rc; in em28xx_ir_init()
739 rc->priv = ir; in em28xx_ir_init()
748 ir->get_key_i2c = em28xx_get_key_terratec; in em28xx_ir_init()
752 ir->get_key_i2c = em28xx_get_key_pinnacle_usb_grey; in em28xx_ir_init()
756 ir->get_key_i2c = em28xx_get_key_em_haup; in em28xx_ir_init()
761 ir->get_key_i2c = em28xx_get_key_winfast_usbii_deluxe; in em28xx_ir_init()
768 ir->i2c_client = kzalloc(sizeof(*ir->i2c_client), GFP_KERNEL); in em28xx_ir_init()
769 if (!ir->i2c_client) in em28xx_ir_init()
771 ir->i2c_client->adapter = &ir->dev->i2c_adap[dev->def_i2c_bus]; in em28xx_ir_init()
772 ir->i2c_client->addr = i2c_rc_dev_addr; in em28xx_ir_init()
773 ir->i2c_client->flags = 0; in em28xx_ir_init()
781 ir->get_key = default_polling_getkey; in em28xx_ir_init()
787 ir->get_key = em2874_polling_getkey; in em28xx_ir_init()
808 ir->polling = 100; /* ms */ in em28xx_ir_init()
810 usb_make_path(udev, ir->phys, sizeof(ir->phys)); in em28xx_ir_init()
811 strlcat(ir->phys, "/input0", sizeof(ir->phys)); in em28xx_ir_init()
814 rc->input_phys = ir->phys; in em28xx_ir_init()
829 kfree(ir->i2c_client); in em28xx_ir_init()
830 dev->ir = NULL; in em28xx_ir_init()
832 kfree(ir); in em28xx_ir_init()
840 struct em28xx_IR *ir = dev->ir; in em28xx_ir_fini() local
852 if (!ir) in em28xx_ir_fini()
855 rc_unregister_device(ir->rc); in em28xx_ir_fini()
857 kfree(ir->i2c_client); in em28xx_ir_fini()
860 kfree(ir); in em28xx_ir_fini()
861 dev->ir = NULL; in em28xx_ir_fini()
871 struct em28xx_IR *ir = dev->ir; in em28xx_ir_suspend() local
877 if (ir) in em28xx_ir_suspend()
878 cancel_delayed_work_sync(&ir->work); in em28xx_ir_suspend()
890 struct em28xx_IR *ir = dev->ir; in em28xx_ir_resume() local
900 if (ir) in em28xx_ir_resume()
901 schedule_delayed_work(&ir->work, msecs_to_jiffies(ir->polling)); in em28xx_ir_resume()