Skip to contentSkip to conversation

media: ir-sony-decoder: 15bit function decode fix

PATCH RESEND In review James Hogan 3 participants 5 messages Feb 27, 2012 – Mar 5, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 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.

---

(note, i don't have a 15bit sony remote to test this with, but i'm pretty confident of it's correctness based on this:
http://picprojects.org.uk/projects/sirc/sonysirc.pdf )

 drivers/media/rc/ir-sony-decoder.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/media/rc/ir-sony-decoder.c +1 -1
index d5e2b50..dab98b3 100644
@@ -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);
Signature · 1 line
1.7.2.3
#1 lore raw

Ping

Another week's gone by with no response. It's a trivial patch, so can somebody please take a look at it? (or if I'm missing somebody relevant from CC, please add them)

Thanks
James

Quoted 32 lines · James Hogan

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.

---

(note, i don't have a 15bit sony remote to test this with, but i'm pretty confident of it's correctness based on this:
http://picprojects.org.uk/projects/sirc/sonysirc.pdf )

 drivers/media/rc/ir-sony-decoder.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/media/rc/ir-sony-decoder.c +1 -1
index d5e2b50..dab98b3 100644
@@ -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);
#2 lore raw

Hi James,

Quoted 6 lines · James Hogan

Ping

Another week's gone by with no response. It's a trivial patch, so can somebody please take a look at it? (or if I'm missing somebody relevant from CC, please add them)

You are not alone, GPIO IR patch is also in waiting mode...

---Trilok Soni

--
Sent by a consultant of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

#3 lore raw

Em 05-03-2012 11:32, Trilok Soni escreveu:

Quoted 11 lines

Hi James,

Quoted 6 lines · James Hogan

Ping

Another week's gone by with no response. It's a trivial patch, so can somebody please take a look at it? (or if I'm missing somebody relevant from CC, please add them)

You are not alone, GPIO IR patch is also in waiting mode...

Unfortunately, I'm very busy those days, testing a big patch series that it is re-writing one subsystem on several machines. Due to that, I had to reduce the timeslot for patch review.

If your patches are at patchwork.linuxtv.org, you shouldn't worry... the patches are on my queue ;)

I'll review them in time for 3.4.

Regards,
Mauro

#4 lore raw
Quoted 19 lines · Mauro Carvalho Chehab

Em 05-03-2012 11:32, Trilok Soni escreveu:

Quoted 11 lines

Hi James,

Quoted 6 lines · James Hogan

Ping

Another week's gone by with no response. It's a trivial patch, so can somebody please take a look at it? (or if I'm missing somebody relevant from CC, please add them)

You are not alone, GPIO IR patch is also in waiting mode...

Unfortunately, I'm very busy those days, testing a big patch series that it is
re-writing one subsystem on several machines. Due to that, I had to reduce the timeslot for patch review.

Quoted 5 lines

If your patches are at patchwork.linuxtv.org, you shouldn't worry... the patches
are on my queue ;)

I'll review them in time for 3.4.

Okay no problem, sorry for nagging :)

Thanks
James