diff options
author | David Härdeman <david@hardeman.nu> | 2014-04-04 03:31:30 +0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-07-24 04:50:48 +0400 |
commit | 120703f9eb32033f0e39bdc552c0273c8ab45f33 (patch) | |
tree | 427e55aad9dcfcb91e99b98d508e6fb407e8f600 /drivers/media/rc/ir-rc5-decoder.c | |
parent | af3a4a9bbeb00df3e42e77240b4cdac5479812f9 (diff) | |
download | linux-120703f9eb32033f0e39bdc552c0273c8ab45f33.tar.xz |
[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>
Diffstat (limited to 'drivers/media/rc/ir-rc5-decoder.c')
-rw-r--r-- | drivers/media/rc/ir-rc5-decoder.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/media/rc/ir-rc5-decoder.c b/drivers/media/rc/ir-rc5-decoder.c index 4295d9b250c8..3d38cbce5667 100644 --- a/drivers/media/rc/ir-rc5-decoder.c +++ b/drivers/media/rc/ir-rc5-decoder.c @@ -51,6 +51,7 @@ static int ir_rc5_decode(struct rc_dev *dev, struct ir_raw_event ev) struct rc5_dec *data = &dev->raw->rc5; u8 toggle; u32 scancode; + enum rc_type protocol; if (!rc_protocols_enabled(dev, RC_BIT_RC5 | RC_BIT_RC5X)) return 0; @@ -138,6 +139,7 @@ again: toggle = (data->bits & 0x20000) ? 1 : 0; command += (data->bits & 0x01000) ? 0 : 0x40; scancode = system << 16 | command << 8 | xdata; + protocol = RC_TYPE_RC5X; IR_dprintk(1, "RC5X scancode 0x%06x (toggle: %u)\n", scancode, toggle); @@ -154,12 +156,13 @@ again: toggle = (data->bits & 0x00800) ? 1 : 0; command += (data->bits & 0x01000) ? 0 : 0x40; scancode = system << 8 | command; + protocol = RC_TYPE_RC5; IR_dprintk(1, "RC5 scancode 0x%04x (toggle: %u)\n", scancode, toggle); } - rc_keydown(dev, scancode, toggle); + rc_keydown(dev, protocol, scancode, toggle); data->state = STATE_INACTIVE; return 0; } |