[media] rc-core: document the protocol type

Right now the protocol information is not preserved, rc-core gets handed a
scancode but has no idea which protocol it corresponds to.

This patch (which required reading through the source/keymap for all drivers,
not fun) makes the protocol information explicit which is important
documentation and makes it easier to e.g. support multiple protocols with one
decoder (think rc5 and rc-streamzap). The information isn't used yet so there
should be no functional changes.

[m.chehab@samsung.com: rebased, added cxusb and removed bad whitespacing]
Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Цей коміт міститься в:
David Härdeman
2014-04-03 20:31:30 -03:00
зафіксовано Mauro Carvalho Chehab
джерело af3a4a9bbe
коміт 120703f9eb
40 змінених файлів з 309 додано та 188 видалено

Переглянути файл

@@ -12,7 +12,8 @@
#include "img-ir-hw.h"
/* Convert Sharp data to a scancode */
static int img_ir_sharp_scancode(int len, u64 raw, int *scancode, u64 protocols)
static int img_ir_sharp_scancode(int len, u64 raw, enum rc_type *protocol,
u32 *scancode, u64 enabled_protocols)
{
unsigned int addr, cmd, exp, chk;
@@ -31,6 +32,7 @@ static int img_ir_sharp_scancode(int len, u64 raw, int *scancode, u64 protocols)
/* probably the second half of the message */
return -EINVAL;
*protocol = RC_TYPE_SHARP;
*scancode = addr << 8 | cmd;
return IMG_IR_SCANCODE;
}