Lines Matching refs:btv

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