diff options
Diffstat (limited to 'drivers/media/dvb/dm1105/dm1105.c')
-rw-r--r-- | drivers/media/dvb/dm1105/dm1105.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/drivers/media/dvb/dm1105/dm1105.c b/drivers/media/dvb/dm1105/dm1105.c index b6d46961a99e..b762e561a6d5 100644 --- a/drivers/media/dvb/dm1105/dm1105.c +++ b/drivers/media/dvb/dm1105/dm1105.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #include <linux/dma-mapping.h> | 28 | #include <linux/dma-mapping.h> |
29 | #include <linux/input.h> | 29 | #include <linux/input.h> |
30 | #include <linux/slab.h> | 30 | #include <linux/slab.h> |
31 | #include <media/ir-common.h> | 31 | #include <media/ir-core.h> |
32 | 32 | ||
33 | #include "demux.h" | 33 | #include "demux.h" |
34 | #include "dmxdev.h" | 34 | #include "dmxdev.h" |
@@ -46,6 +46,8 @@ | |||
46 | #include "z0194a.h" | 46 | #include "z0194a.h" |
47 | #include "ds3000.h" | 47 | #include "ds3000.h" |
48 | 48 | ||
49 | #define MODULE_NAME "dm1105" | ||
50 | |||
49 | #define UNSET (-1U) | 51 | #define UNSET (-1U) |
50 | 52 | ||
51 | #define DM1105_BOARD_NOAUTO UNSET | 53 | #define DM1105_BOARD_NOAUTO UNSET |
@@ -265,7 +267,6 @@ static void dm1105_card_list(struct pci_dev *pci) | |||
265 | /* infrared remote control */ | 267 | /* infrared remote control */ |
266 | struct infrared { | 268 | struct infrared { |
267 | struct input_dev *input_dev; | 269 | struct input_dev *input_dev; |
268 | struct ir_input_state ir; | ||
269 | char input_phys[32]; | 270 | char input_phys[32]; |
270 | struct work_struct work; | 271 | struct work_struct work; |
271 | u32 ir_command; | 272 | u32 ir_command; |
@@ -531,8 +532,7 @@ static void dm1105_emit_key(struct work_struct *work) | |||
531 | 532 | ||
532 | data = (ircom >> 8) & 0x7f; | 533 | data = (ircom >> 8) & 0x7f; |
533 | 534 | ||
534 | ir_input_keydown(ir->input_dev, &ir->ir, data); | 535 | ir_keydown(ir->input_dev, data, 0); |
535 | ir_input_nokey(ir->input_dev, &ir->ir); | ||
536 | } | 536 | } |
537 | 537 | ||
538 | /* work handler */ | 538 | /* work handler */ |
@@ -594,8 +594,7 @@ static irqreturn_t dm1105_irq(int irq, void *dev_id) | |||
594 | int __devinit dm1105_ir_init(struct dm1105_dev *dm1105) | 594 | int __devinit dm1105_ir_init(struct dm1105_dev *dm1105) |
595 | { | 595 | { |
596 | struct input_dev *input_dev; | 596 | struct input_dev *input_dev; |
597 | struct ir_scancode_table *ir_codes = &ir_codes_dm1105_nec_table; | 597 | char *ir_codes = NULL; |
598 | u64 ir_type = IR_TYPE_OTHER; | ||
599 | int err = -ENOMEM; | 598 | int err = -ENOMEM; |
600 | 599 | ||
601 | input_dev = input_allocate_device(); | 600 | input_dev = input_allocate_device(); |
@@ -606,12 +605,6 @@ int __devinit dm1105_ir_init(struct dm1105_dev *dm1105) | |||
606 | snprintf(dm1105->ir.input_phys, sizeof(dm1105->ir.input_phys), | 605 | snprintf(dm1105->ir.input_phys, sizeof(dm1105->ir.input_phys), |
607 | "pci-%s/ir0", pci_name(dm1105->pdev)); | 606 | "pci-%s/ir0", pci_name(dm1105->pdev)); |
608 | 607 | ||
609 | err = ir_input_init(input_dev, &dm1105->ir.ir, ir_type); | ||
610 | if (err < 0) { | ||
611 | input_free_device(input_dev); | ||
612 | return err; | ||
613 | } | ||
614 | |||
615 | input_dev->name = "DVB on-card IR receiver"; | 608 | input_dev->name = "DVB on-card IR receiver"; |
616 | input_dev->phys = dm1105->ir.input_phys; | 609 | input_dev->phys = dm1105->ir.input_phys; |
617 | input_dev->id.bustype = BUS_PCI; | 610 | input_dev->id.bustype = BUS_PCI; |
@@ -628,9 +621,13 @@ int __devinit dm1105_ir_init(struct dm1105_dev *dm1105) | |||
628 | 621 | ||
629 | INIT_WORK(&dm1105->ir.work, dm1105_emit_key); | 622 | INIT_WORK(&dm1105->ir.work, dm1105_emit_key); |
630 | 623 | ||
631 | err = ir_input_register(input_dev, ir_codes, NULL); | 624 | err = ir_input_register(input_dev, ir_codes, NULL, MODULE_NAME); |
625 | if (err < 0) { | ||
626 | input_free_device(input_dev); | ||
627 | return err; | ||
628 | } | ||
632 | 629 | ||
633 | return err; | 630 | return 0; |
634 | } | 631 | } |
635 | 632 | ||
636 | void __devexit dm1105_ir_exit(struct dm1105_dev *dm1105) | 633 | void __devexit dm1105_ir_exit(struct dm1105_dev *dm1105) |