Lines Matching full:ir

4  * handle saa7134 IR remotes via linux kernel input layer.
24 MODULE_PARM_DESC(ir_debug,"enable debug messages [IR]");
34 #define ir_dbg(ir, fmt, arg...) do { \ argument
36 printk(KERN_DEBUG pr_fmt("ir %s: " fmt), ir->rc->device_name, \
47 struct saa7134_card_ir *ir = dev->remote; in build_key() local
62 if (ir->polling) { in build_key()
63 if (ir->last_gpio == gpio) in build_key()
65 ir->last_gpio = gpio; in build_key()
68 data = ir_extract_bits(gpio, ir->mask_keycode); in build_key()
70 gpio, ir->mask_keycode, data); in build_key()
74 if (data == ir->mask_keycode) in build_key()
75 rc_keyup(ir->dev); in build_key()
77 rc_keydown_notimeout(ir->dev, RC_PROTO_UNKNOWN, data, in build_key()
82 if (ir->polling) { in build_key()
83 if ((ir->mask_keydown && (0 != (gpio & ir->mask_keydown))) || in build_key()
84 (ir->mask_keyup && (0 == (gpio & ir->mask_keyup)))) { in build_key()
85 rc_keydown_notimeout(ir->dev, RC_PROTO_UNKNOWN, data, in build_key()
88 rc_keyup(ir->dev); in build_key()
92 if ((ir->mask_keydown && (0 != (gpio & ir->mask_keydown))) || in build_key()
93 (ir->mask_keyup && (0 == (gpio & ir->mask_keyup)))) { in build_key()
94 rc_keydown_notimeout(ir->dev, RC_PROTO_UNKNOWN, data, in build_key()
96 rc_keyup(ir->dev); in build_key()
105 static int get_key_flydvb_trio(struct IR_i2c *ir, enum rc_proto *protocol, in get_key_flydvb_trio() argument
113 struct saa7134_dev *dev = ir->c->adapter->algo_data; in get_key_flydvb_trio()
116 ir_dbg(ir, "get_key_flydvb_trio: ir->c->adapter->algo_data is NULL!\n"); in get_key_flydvb_trio()
129 /* poll IR chip */ in get_key_flydvb_trio()
130 /* weak up the IR chip */ in get_key_flydvb_trio()
133 while (1 != i2c_master_send(ir->c, &b, 1)) { in get_key_flydvb_trio()
142 ir_dbg(ir, "send wake up byte to pic16C505 (IR chip)failed %dx\n", in get_key_flydvb_trio()
146 rc = i2c_master_recv(ir->c, &b, 1); in get_key_flydvb_trio()
148 ir_dbg(ir, "read error\n"); in get_key_flydvb_trio()
160 static int get_key_msi_tvanywhere_plus(struct IR_i2c *ir, in get_key_msi_tvanywhere_plus() argument
168 struct saa7134_dev *dev = ir->c->adapter->algo_data; in get_key_msi_tvanywhere_plus()
170 ir_dbg(ir, "get_key_msi_tvanywhere_plus: ir->c->adapter->algo_data is NULL!\n"); in get_key_msi_tvanywhere_plus()
189 rc = i2c_master_recv(ir->c, &b, 1); in get_key_msi_tvanywhere_plus()
191 ir_dbg(ir, "read error\n"); in get_key_msi_tvanywhere_plus()
212 static int get_key_kworld_pc150u(struct IR_i2c *ir, enum rc_proto *protocol, in get_key_kworld_pc150u() argument
220 struct saa7134_dev *dev = ir->c->adapter->algo_data; in get_key_kworld_pc150u()
222 ir_dbg(ir, "get_key_kworld_pc150u: ir->c->adapter->algo_data is NULL!\n"); in get_key_kworld_pc150u()
241 rc = i2c_master_recv(ir->c, &b, 1); in get_key_kworld_pc150u()
243 ir_dbg(ir, "read error\n"); in get_key_kworld_pc150u()
263 static int get_key_purpletv(struct IR_i2c *ir, enum rc_proto *protocol, in get_key_purpletv() argument
269 /* poll IR chip */ in get_key_purpletv()
270 rc = i2c_master_recv(ir->c, &b, 1); in get_key_purpletv()
272 ir_dbg(ir, "read error\n"); in get_key_purpletv()
292 static int get_key_beholdm6xx(struct IR_i2c *ir, enum rc_proto *protocol, in get_key_beholdm6xx() argument
299 struct saa7134_dev *dev = ir->c->adapter->algo_data; in get_key_beholdm6xx()
310 ir->c->addr = 0x5a >> 1; in get_key_beholdm6xx()
312 rc = i2c_master_recv(ir->c, data, 12); in get_key_beholdm6xx()
314 ir_dbg(ir, "read error\n"); in get_key_beholdm6xx()
332 static int get_key_pinnacle(struct IR_i2c *ir, enum rc_proto *protocol, in get_key_pinnacle() argument
340 /* poll IR chip */ in get_key_pinnacle()
341 rc = i2c_master_recv(ir->c, b, 4); in get_key_pinnacle()
343 ir_dbg(ir, "read error\n"); in get_key_pinnacle()
361 if (ir->old == parity) in get_key_pinnacle()
364 ir->old = parity; in get_key_pinnacle()
377 ir_dbg(ir, "Pinnacle PCTV key %02x\n", code); in get_key_pinnacle()
390 static int get_key_pinnacle_grey(struct IR_i2c *ir, enum rc_proto *protocol, in get_key_pinnacle_grey() argument
394 return get_key_pinnacle(ir, protocol, scancode, toggle, 1, 0xfe, 0xff); in get_key_pinnacle_grey()
402 static int get_key_pinnacle_color(struct IR_i2c *ir, enum rc_proto *protocol, in get_key_pinnacle_color() argument
411 return get_key_pinnacle(ir, protocol, scancode, toggle, 2, 0x80, 0x88); in get_key_pinnacle_color()
416 struct saa7134_card_ir *ir; in saa7134_input_irq() local
421 ir = dev->remote; in saa7134_input_irq()
422 if (!ir->running) in saa7134_input_irq()
425 if (!ir->polling && !ir->raw_decode) { in saa7134_input_irq()
427 } else if (ir->raw_decode) { in saa7134_input_irq()
434 struct saa7134_card_ir *ir = from_timer(ir, t, timer); in saa7134_input_timer() local
435 struct saa7134_dev *dev = ir->dev->priv; in saa7134_input_timer()
438 mod_timer(&ir->timer, jiffies + msecs_to_jiffies(ir->polling)); in saa7134_input_timer()
444 struct saa7134_card_ir *ir = dev->remote; in saa7134_ir_open() local
482 ir->running = true; in saa7134_ir_open()
484 if (ir->polling) { in saa7134_ir_open()
485 timer_setup(&ir->timer, saa7134_input_timer, 0); in saa7134_ir_open()
486 ir->timer.expires = jiffies + HZ; in saa7134_ir_open()
487 add_timer(&ir->timer); in saa7134_ir_open()
496 struct saa7134_card_ir *ir = dev->remote; in saa7134_ir_close() local
498 if (ir->polling) in saa7134_ir_close()
499 del_timer_sync(&ir->timer); in saa7134_ir_close()
501 ir->running = false; in saa7134_ir_close()
506 struct saa7134_card_ir *ir; in saa7134_input_init1() local
767 pr_err("Oops: IR config error [card=%d]\n", dev->board); in saa7134_input_init1()
771 ir = kzalloc(sizeof(*ir), GFP_KERNEL); in saa7134_input_init1()
773 if (!ir || !rc) { in saa7134_input_init1()
778 ir->dev = rc; in saa7134_input_init1()
779 dev->remote = ir; in saa7134_input_init1()
782 ir->mask_keycode = mask_keycode; in saa7134_input_init1()
783 ir->mask_keydown = mask_keydown; in saa7134_input_init1()
784 ir->mask_keyup = mask_keyup; in saa7134_input_init1()
785 ir->polling = polling; in saa7134_input_init1()
786 ir->raw_decode = raw_decode; in saa7134_input_init1()
789 snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0", in saa7134_input_init1()
801 rc->input_phys = ir->phys; in saa7134_input_init1()
827 kfree(ir); in saa7134_input_init1()
853 input_dbg("IR has been disabled, not probing for i2c remote\n"); in saa7134_probe_i2c_ir()
979 input_dbg("No I2C IR support for board %x\n", dev->board); in saa7134_probe_i2c_ir()
990 struct saa7134_card_ir *ir = dev->remote; in saa7134_raw_decode_irq() local
996 space = saa_readl(SAA7134_GPIO_GPSTATUS0 >> 2) & ir->mask_keydown; in saa7134_raw_decode_irq()