aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJarod Wilson <jarod@redhat.com>2011-03-22 16:23:15 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-03-22 18:24:23 -0400
commit4be22b6a7f2f2b7eb6f7aab8902068a367cda8ba (patch)
tree57d31d0608de4a5eae9e4433911a2d56518abc68 /drivers
parent7d9a46f9d5e0bea8e862143be73df2bbc9acb2a3 (diff)
[media] rc: interim support for 32-bit NEC-ish scancodes
The Apple and TiVo remotes I've got use an NEC-ish protocol, but rather than a command/not_command pair, they have what appear to be vendor ID bytes. This change makes the NEC decoder warn if the command/not_command checksum fails, but then passes along a full 32-bit scancode for keymap lookup. This change should make no difference for existing keymaps, since they simply won't have 32-bit scancodes, but allows for a 32-bit keymap. At the moment, that'll have to be uploaded by the user, but I've got Apple and TiVo remote keymaps forthcoming. In the long run (2.6.40, hopefully), we should probably just always use all 32 bits for all NEC keymaps, but this should get us by for 2.6.39. (Note that a few of the TiVo keys actuallly *do* pass the command checksum, so for now, the keymap for this remote will have to be a mix of 24-bit and 32-bit scancodes, but so be it). Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/rc/ir-nec-decoder.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/media/rc/ir-nec-decoder.c b/drivers/media/rc/ir-nec-decoder.c
index 7b58b4a1729b..63ee722dbd02 100644
--- a/drivers/media/rc/ir-nec-decoder.c
+++ b/drivers/media/rc/ir-nec-decoder.c
@@ -49,6 +49,7 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev)
49 struct nec_dec *data = &dev->raw->nec; 49 struct nec_dec *data = &dev->raw->nec;
50 u32 scancode; 50 u32 scancode;
51 u8 address, not_address, command, not_command; 51 u8 address, not_address, command, not_command;
52 bool send_32bits = false;
52 53
53 if (!(dev->raw->enabled_protocols & RC_TYPE_NEC)) 54 if (!(dev->raw->enabled_protocols & RC_TYPE_NEC))
54 return 0; 55 return 0;
@@ -164,10 +165,15 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev)
164 if ((command ^ not_command) != 0xff) { 165 if ((command ^ not_command) != 0xff) {
165 IR_dprintk(1, "NEC checksum error: received 0x%08x\n", 166 IR_dprintk(1, "NEC checksum error: received 0x%08x\n",
166 data->bits); 167 data->bits);
167 break; 168 send_32bits = true;
168 } 169 }
169 170
170 if ((address ^ not_address) != 0xff) { 171 if (send_32bits) {
172 /* NEC transport, but modified protocol, used by at
173 * least Apple and TiVo remotes */
174 scancode = data->bits;
175 IR_dprintk(1, "NEC (modified) scancode 0x%08x\n", scancode);
176 } else if ((address ^ not_address) != 0xff) {
171 /* Extended NEC */ 177 /* Extended NEC */
172 scancode = address << 16 | 178 scancode = address << 16 |
173 not_address << 8 | 179 not_address << 8 |