diff options
Diffstat (limited to 'drivers/media/video/bt8xx')
-rw-r--r-- | drivers/media/video/bt8xx/bttv-input.c | 41 |
1 files changed, 18 insertions, 23 deletions
diff --git a/drivers/media/video/bt8xx/bttv-input.c b/drivers/media/video/bt8xx/bttv-input.c index eb71c3ae36d..4b4f6137c6c 100644 --- a/drivers/media/video/bt8xx/bttv-input.c +++ b/drivers/media/video/bt8xx/bttv-input.c | |||
@@ -31,10 +31,6 @@ | |||
31 | 31 | ||
32 | static int ir_debug; | 32 | static int ir_debug; |
33 | module_param(ir_debug, int, 0644); | 33 | module_param(ir_debug, int, 0644); |
34 | static int repeat_delay = 500; | ||
35 | module_param(repeat_delay, int, 0644); | ||
36 | static int repeat_period = 33; | ||
37 | module_param(repeat_period, int, 0644); | ||
38 | 34 | ||
39 | static int ir_rc5_remote_gap = 885; | 35 | static int ir_rc5_remote_gap = 885; |
40 | module_param(ir_rc5_remote_gap, int, 0644); | 36 | module_param(ir_rc5_remote_gap, int, 0644); |
@@ -317,15 +313,15 @@ int bttv_input_init(struct bttv *btv) | |||
317 | { | 313 | { |
318 | struct card_ir *ir; | 314 | struct card_ir *ir; |
319 | char *ir_codes = NULL; | 315 | char *ir_codes = NULL; |
320 | struct input_dev *input_dev; | 316 | struct rc_dev *rc; |
321 | int err = -ENOMEM; | 317 | int err = -ENOMEM; |
322 | 318 | ||
323 | if (!btv->has_remote) | 319 | if (!btv->has_remote) |
324 | return -ENODEV; | 320 | return -ENODEV; |
325 | 321 | ||
326 | ir = kzalloc(sizeof(*ir),GFP_KERNEL); | 322 | ir = kzalloc(sizeof(*ir),GFP_KERNEL); |
327 | input_dev = input_allocate_device(); | 323 | rc = rc_allocate_device(); |
328 | if (!ir || !input_dev) | 324 | if (!ir || !rc) |
329 | goto err_out_free; | 325 | goto err_out_free; |
330 | 326 | ||
331 | /* detect & configure */ | 327 | /* detect & configure */ |
@@ -431,44 +427,43 @@ int bttv_input_init(struct bttv *btv) | |||
431 | } | 427 | } |
432 | 428 | ||
433 | /* init input device */ | 429 | /* init input device */ |
434 | ir->dev = input_dev; | 430 | ir->dev = rc; |
435 | 431 | ||
436 | snprintf(ir->name, sizeof(ir->name), "bttv IR (card=%d)", | 432 | snprintf(ir->name, sizeof(ir->name), "bttv IR (card=%d)", |
437 | btv->c.type); | 433 | btv->c.type); |
438 | snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0", | 434 | snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0", |
439 | pci_name(btv->c.pci)); | 435 | pci_name(btv->c.pci)); |
440 | 436 | ||
441 | input_dev->name = ir->name; | 437 | rc->input_name = ir->name; |
442 | input_dev->phys = ir->phys; | 438 | rc->input_phys = ir->phys; |
443 | input_dev->id.bustype = BUS_PCI; | 439 | rc->input_id.bustype = BUS_PCI; |
444 | input_dev->id.version = 1; | 440 | rc->input_id.version = 1; |
445 | if (btv->c.pci->subsystem_vendor) { | 441 | if (btv->c.pci->subsystem_vendor) { |
446 | input_dev->id.vendor = btv->c.pci->subsystem_vendor; | 442 | rc->input_id.vendor = btv->c.pci->subsystem_vendor; |
447 | input_dev->id.product = btv->c.pci->subsystem_device; | 443 | rc->input_id.product = btv->c.pci->subsystem_device; |
448 | } else { | 444 | } else { |
449 | input_dev->id.vendor = btv->c.pci->vendor; | 445 | rc->input_id.vendor = btv->c.pci->vendor; |
450 | input_dev->id.product = btv->c.pci->device; | 446 | rc->input_id.product = btv->c.pci->device; |
451 | } | 447 | } |
452 | input_dev->dev.parent = &btv->c.pci->dev; | 448 | rc->dev.parent = &btv->c.pci->dev; |
449 | rc->map_name = ir_codes; | ||
450 | rc->driver_name = MODULE_NAME; | ||
453 | 451 | ||
454 | btv->remote = ir; | 452 | btv->remote = ir; |
455 | bttv_ir_start(btv, ir); | 453 | bttv_ir_start(btv, ir); |
456 | 454 | ||
457 | /* all done */ | 455 | /* all done */ |
458 | err = ir_input_register(btv->remote->dev, ir_codes, NULL, MODULE_NAME); | 456 | err = rc_register_device(rc); |
459 | if (err) | 457 | if (err) |
460 | goto err_out_stop; | 458 | goto err_out_stop; |
461 | 459 | ||
462 | /* the remote isn't as bouncy as a keyboard */ | ||
463 | ir->dev->rep[REP_DELAY] = repeat_delay; | ||
464 | ir->dev->rep[REP_PERIOD] = repeat_period; | ||
465 | |||
466 | return 0; | 460 | return 0; |
467 | 461 | ||
468 | err_out_stop: | 462 | err_out_stop: |
469 | bttv_ir_stop(btv); | 463 | bttv_ir_stop(btv); |
470 | btv->remote = NULL; | 464 | btv->remote = NULL; |
471 | err_out_free: | 465 | err_out_free: |
466 | rc_free_device(rc); | ||
472 | kfree(ir); | 467 | kfree(ir); |
473 | return err; | 468 | return err; |
474 | } | 469 | } |
@@ -479,7 +474,7 @@ void bttv_input_fini(struct bttv *btv) | |||
479 | return; | 474 | return; |
480 | 475 | ||
481 | bttv_ir_stop(btv); | 476 | bttv_ir_stop(btv); |
482 | ir_input_unregister(btv->remote->dev); | 477 | rc_unregister_device(btv->remote->dev); |
483 | kfree(btv->remote); | 478 | kfree(btv->remote); |
484 | btv->remote = NULL; | 479 | btv->remote = NULL; |
485 | } | 480 | } |