Lines Matching refs:ir
34 #define ir_dbg(ir, fmt, arg...) do { \
36 printk(KERN_DEBUG pr_fmt("ir %s: " fmt), ir->rc->device_name, \
47 struct saa7134_card_ir *ir = dev->remote;
62 if (ir->polling) {
63 if (ir->last_gpio == gpio)
65 ir->last_gpio = gpio;
68 data = ir_extract_bits(gpio, ir->mask_keycode);
70 gpio, ir->mask_keycode, data);
74 if (data == ir->mask_keycode)
75 rc_keyup(ir->dev);
77 rc_keydown_notimeout(ir->dev, RC_PROTO_UNKNOWN, data,
82 if (ir->polling) {
83 if ((ir->mask_keydown && (0 != (gpio & ir->mask_keydown))) ||
84 (ir->mask_keyup && (0 == (gpio & ir->mask_keyup)))) {
85 rc_keydown_notimeout(ir->dev, RC_PROTO_UNKNOWN, data,
88 rc_keyup(ir->dev);
92 if ((ir->mask_keydown && (0 != (gpio & ir->mask_keydown))) ||
93 (ir->mask_keyup && (0 == (gpio & ir->mask_keyup)))) {
94 rc_keydown_notimeout(ir->dev, RC_PROTO_UNKNOWN, data,
96 rc_keyup(ir->dev);
105 static int get_key_flydvb_trio(struct IR_i2c *ir, enum rc_proto *protocol,
113 struct saa7134_dev *dev = ir->c->adapter->algo_data;
116 ir_dbg(ir, "get_key_flydvb_trio: ir->c->adapter->algo_data is NULL!\n");
133 while (1 != i2c_master_send(ir->c, &b, 1)) {
142 ir_dbg(ir, "send wake up byte to pic16C505 (IR chip)failed %dx\n",
146 rc = i2c_master_recv(ir->c, &b, 1);
148 ir_dbg(ir, "read error\n");
160 static int get_key_msi_tvanywhere_plus(struct IR_i2c *ir,
168 struct saa7134_dev *dev = ir->c->adapter->algo_data;
170 ir_dbg(ir, "get_key_msi_tvanywhere_plus: ir->c->adapter->algo_data is NULL!\n");
189 rc = i2c_master_recv(ir->c, &b, 1);
191 ir_dbg(ir, "read error\n");
212 static int get_key_kworld_pc150u(struct IR_i2c *ir, enum rc_proto *protocol,
220 struct saa7134_dev *dev = ir->c->adapter->algo_data;
222 ir_dbg(ir, "get_key_kworld_pc150u: ir->c->adapter->algo_data is NULL!\n");
241 rc = i2c_master_recv(ir->c, &b, 1);
243 ir_dbg(ir, "read error\n");
263 static int get_key_purpletv(struct IR_i2c *ir, enum rc_proto *protocol,
270 rc = i2c_master_recv(ir->c, &b, 1);
272 ir_dbg(ir, "read error\n");
292 static int get_key_beholdm6xx(struct IR_i2c *ir, enum rc_proto *protocol,
299 struct saa7134_dev *dev = ir->c->adapter->algo_data;
310 ir->c->addr = 0x5a >> 1;
312 rc = i2c_master_recv(ir->c, data, 12);
314 ir_dbg(ir, "read error\n");
332 static int get_key_pinnacle(struct IR_i2c *ir, enum rc_proto *protocol,
341 rc = i2c_master_recv(ir->c, b, 4);
343 ir_dbg(ir, "read error\n");
361 if (ir->old == parity)
364 ir->old = parity;
377 ir_dbg(ir, "Pinnacle PCTV key %02x\n", code);
390 static int get_key_pinnacle_grey(struct IR_i2c *ir, enum rc_proto *protocol,
394 return get_key_pinnacle(ir, protocol, scancode, toggle, 1, 0xfe, 0xff);
402 static int get_key_pinnacle_color(struct IR_i2c *ir, enum rc_proto *protocol,
411 return get_key_pinnacle(ir, protocol, scancode, toggle, 2, 0x80, 0x88);
416 struct saa7134_card_ir *ir;
421 ir = dev->remote;
422 if (!ir->running)
425 if (!ir->polling && !ir->raw_decode) {
427 } else if (ir->raw_decode) {
434 struct saa7134_card_ir *ir = timer_container_of(ir, t, timer);
435 struct saa7134_dev *dev = ir->dev->priv;
438 mod_timer(&ir->timer, jiffies + msecs_to_jiffies(ir->polling));
444 struct saa7134_card_ir *ir = dev->remote;
482 ir->running = true;
484 if (ir->polling) {
485 timer_setup(&ir->timer, saa7134_input_timer, 0);
486 ir->timer.expires = jiffies + HZ;
487 add_timer(&ir->timer);
496 struct saa7134_card_ir *ir = dev->remote;
498 if (ir->polling)
499 timer_delete_sync(&ir->timer);
501 ir->running = false;
506 struct saa7134_card_ir *ir;
771 ir = kzalloc(sizeof(*ir), GFP_KERNEL);
773 if (!ir || !rc) {
778 ir->dev = rc;
779 dev->remote = ir;
782 ir->mask_keycode = mask_keycode;
783 ir->mask_keydown = mask_keydown;
784 ir->mask_keyup = mask_keyup;
785 ir->polling = polling;
786 ir->raw_decode = raw_decode;
789 snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0",
801 rc->input_phys = ir->phys;
827 kfree(ir);
990 struct saa7134_card_ir *ir = dev->remote;
996 space = saa_readl(SAA7134_GPIO_GPSTATUS0 >> 2) & ir->mask_keydown;