Skip to content

Commit

Permalink
V4L/DVB (12600): dvb-usb-remote: return KEY_RESERVED if there's free …
Browse files Browse the repository at this point in the history
…space for new keys

The input subsystem checks if get_keycode works for a scan code. Due to that,
we need to return a valid value when there's some space at the table that
can be used by a scancode.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Mauro Carvalho Chehab committed Sep 12, 2009
1 parent b77f0a7 commit a4c1cbc
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions drivers/media/dvb/dvb-usb/dvb-usb-remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@ static int dvb_usb_getkeycode(struct input_dev *dev,
*keycode = keymap[i].event;
return 0;
}

/*
* If is there extra space, returns KEY_RESERVED,
* otherwise, input core won't let dvb_usb_setkeycode
* to work
*/
for (i = 0; i < d->props.rc_key_map_size; i++)
if (keymap[i].event == KEY_RESERVED ||
keymap[i].event == KEY_UNKNOWN) {
*keycode = KEY_RESERVED;
return 0;
}

return -EINVAL;
}

Expand Down

0 comments on commit a4c1cbc

Please sign in to comment.