aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/rc/ir-sony-decoder.c
diff options
context:
space:
mode:
authorJames Hogan <james.hogan@imgtec.com>2012-02-20 04:13:54 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-03-08 09:16:21 -0500
commitec9ee8e2ddb11deaf2b8c8fc703a86a8f815e64f (patch)
treed1b42e7b4b55bbb03907a9946a5915a5d9beec5a /drivers/media/rc/ir-sony-decoder.c
parentfd0f6851eb46512a6df2961923a0c24edc0a55b9 (diff)
[media] media: ir-sony-decoder: 15bit function decode fix
The raw Sony IR decoder decodes 15bit messages slightly incorrectly. To decode the function number, it shifts the bits right by 7 so that the function is in bits 7:1, masks with 0xFD (0b11111101), and does an 8 bit reverse so it ends up in bits 6:0. The mask should be 0xFE to correspond with bits 7:1 (0b11111110). The old mask had the effect of dropping the MSB of the function number from bit 6, and leaving the LSB of the device number in bit 7. Signed-off-by: James Hogan <james.hogan@imgtec.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/rc/ir-sony-decoder.c')
-rw-r--r--drivers/media/rc/ir-sony-decoder.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/rc/ir-sony-decoder.c b/drivers/media/rc/ir-sony-decoder.c
index d5e2b50aff1f..dab98b37621a 100644
--- a/drivers/media/rc/ir-sony-decoder.c
+++ b/drivers/media/rc/ir-sony-decoder.c
@@ -130,7 +130,7 @@ static int ir_sony_decode(struct rc_dev *dev, struct ir_raw_event ev)
130 case 15: 130 case 15:
131 device = bitrev8((data->bits >> 0) & 0xFF); 131 device = bitrev8((data->bits >> 0) & 0xFF);
132 subdevice = 0; 132 subdevice = 0;
133 function = bitrev8((data->bits >> 7) & 0xFD); 133 function = bitrev8((data->bits >> 7) & 0xFE);
134 break; 134 break;
135 case 20: 135 case 20:
136 device = bitrev8((data->bits >> 5) & 0xF8); 136 device = bitrev8((data->bits >> 5) & 0xF8);