Skip to content

Commit

Permalink
[media] media: ir-sony-decoder: 15bit function decode fix
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
James Hogan authored and Mauro Carvalho Chehab committed Mar 8, 2012
1 parent fd0f685 commit ec9ee8e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/rc/ir-sony-decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ static int ir_sony_decode(struct rc_dev *dev, struct ir_raw_event ev)
case 15:
device = bitrev8((data->bits >> 0) & 0xFF);
subdevice = 0;
function = bitrev8((data->bits >> 7) & 0xFD);
function = bitrev8((data->bits >> 7) & 0xFE);
break;
case 20:
device = bitrev8((data->bits >> 5) & 0xF8);
Expand Down

0 comments on commit ec9ee8e

Please sign in to comment.