Lines Matching defs:btv
40 static void ir_handle_key(struct bttv *btv)
42 struct bttv_ir *ir = btv->remote;
46 gpio = bttv_gpio_read(&btv->c);
67 if (btv->c.type == BTTV_BOARD_WINFAST2000)
75 static void ir_enltv_handle_key(struct bttv *btv)
77 struct bttv_ir *ir = btv->remote;
81 gpio = bttv_gpio_read(&btv->c);
115 static int bttv_rc5_irq(struct bttv *btv);
117 void bttv_input_irq(struct bttv *btv)
119 struct bttv_ir *ir = btv->remote;
122 bttv_rc5_irq(btv);
124 ir_handle_key(btv);
130 struct bttv *btv = ir->btv;
132 if (btv->c.type == BTTV_BOARD_ENLTV_FM_2)
133 ir_enltv_handle_key(btv);
135 ir_handle_key(btv);
235 static int bttv_rc5_irq(struct bttv *btv)
237 struct bttv_ir *ir = btv->remote;
244 gpio = bttv_gpio_read(&btv->c);
283 bttv_gpio_write(&btv->c, gpio & ~(1 << 4));
284 bttv_gpio_write(&btv->c, gpio | (1 << 4));
304 static void bttv_ir_stop(struct bttv *btv)
306 if (btv->remote->polling)
307 del_timer_sync(&btv->remote->timer);
309 if (btv->remote->rc5_gpio) {
312 del_timer_sync(&btv->remote->timer);
314 gpio = bttv_gpio_read(&btv->c);
315 bttv_gpio_write(&btv->c, gpio & ~(1 << 4));
362 void init_bttv_i2c_ir(struct bttv *btv)
371 if (0 != btv->i2c_rc)
375 memset(&btv->init_data, 0, sizeof(btv->init_data));
378 switch (btv->c.type) {
380 btv->init_data.name = "PV951";
381 btv->init_data.get_key = get_key_pv951;
382 btv->init_data.ir_codes = RC_MAP_PV951;
387 if (btv->init_data.name) {
388 info.platform_data = &btv->init_data;
389 i2c_dev = i2c_new_client_device(&btv->c.i2c_adap, &info);
399 i2c_dev = i2c_new_scanned_device(&btv->c.i2c_adap, &info, addr_list, NULL);
409 int bttv_input_init(struct bttv *btv)
416 if (!btv->has_remote)
425 switch (btv->c.type) {
504 ir->last_gpio = ir_extract_bits(bttv_gpio_read(&btv->c),
510 dprintk("Ooops: IR config error [card=%d]\n", btv->c.type);
518 bttv_gpio_inout(&btv->c, (1 << 4), 1 << 4);
519 gpio = bttv_gpio_read(&btv->c);
520 bttv_gpio_write(&btv->c, gpio & ~(1 << 4));
521 bttv_gpio_write(&btv->c, gpio | (1 << 4));
524 bttv_gpio_inout(&btv->c, ir->mask_keycode | ir->mask_keydown, 0);
529 ir->btv = btv;
532 btv->c.type);
534 pci_name(btv->c.pci));
540 if (btv->c.pci->subsystem_vendor) {
541 rc->input_id.vendor = btv->c.pci->subsystem_vendor;
542 rc->input_id.product = btv->c.pci->subsystem_device;
544 rc->input_id.vendor = btv->c.pci->vendor;
545 rc->input_id.product = btv->c.pci->device;
547 rc->dev.parent = &btv->c.pci->dev;
551 btv->remote = ir;
562 bttv_ir_stop(btv);
563 btv->remote = NULL;
570 void bttv_input_fini(struct bttv *btv)
572 if (btv->remote == NULL)
575 bttv_ir_stop(btv);
576 rc_unregister_device(btv->remote->dev);
577 kfree(btv->remote);
578 btv->remote = NULL;