Skip to content

Commit

Permalink
V4L/DVB: Bug fix: make IR work again for dm1105
Browse files Browse the repository at this point in the history
It makes IR to work again for dm1105 and, possibly, others.

Signed-off-by: Igor M. Liplianin <liplianin@me.by>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Igor M. Liplianin authored and Mauro Carvalho Chehab committed Jun 1, 2010
1 parent 033608c commit 84b14f1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
17 changes: 10 additions & 7 deletions drivers/media/IR/ir-keytable.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,11 +490,12 @@ int __ir_input_register(struct input_dev *input_dev,
if (rc < 0)
goto out_table;

if (ir_dev->props->driver_type == RC_DRIVER_IR_RAW) {
rc = ir_raw_event_register(input_dev);
if (rc < 0)
goto out_event;
}
if (ir_dev->props)
if (ir_dev->props->driver_type == RC_DRIVER_IR_RAW) {
rc = ir_raw_event_register(input_dev);
if (rc < 0)
goto out_event;
}

IR_dprintk(1, "Registered input device on %s for %s remote.\n",
driver_name, rc_tab->name);
Expand Down Expand Up @@ -530,8 +531,10 @@ void ir_input_unregister(struct input_dev *input_dev)
IR_dprintk(1, "Freed keycode table\n");

del_timer_sync(&ir_dev->timer_keyup);
if (ir_dev->props->driver_type == RC_DRIVER_IR_RAW)
ir_raw_event_unregister(input_dev);
if (ir_dev->props)
if (ir_dev->props->driver_type == RC_DRIVER_IR_RAW)
ir_raw_event_unregister(input_dev);

rc_tab = &ir_dev->rc_tab;
rc_tab->size = 0;
kfree(rc_tab->scan);
Expand Down
7 changes: 4 additions & 3 deletions drivers/media/IR/ir-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,10 @@ int ir_register_class(struct input_dev *input_dev)
if (unlikely(devno < 0))
return devno;

if (ir_dev->props->driver_type == RC_DRIVER_SCANCODE)
ir_dev->dev.type = &rc_dev_type;
else
if (ir_dev->props) {
if (ir_dev->props->driver_type == RC_DRIVER_SCANCODE)
ir_dev->dev.type = &rc_dev_type;
} else
ir_dev->dev.type = &ir_raw_dev_type;

ir_dev->dev.class = &ir_input_class;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/dvb/dm1105/dm1105.c
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ static irqreturn_t dm1105_irq(int irq, void *dev_id)
int __devinit dm1105_ir_init(struct dm1105_dev *dm1105)
{
struct input_dev *input_dev;
char *ir_codes = NULL;
char *ir_codes = RC_MAP_DM1105_NEC;
int err = -ENOMEM;

input_dev = input_allocate_device();
Expand Down

0 comments on commit 84b14f1

Please sign in to comment.