From: James Hogan <james.hogan@imgtec.com>
To: Mauro Carvalho Chehab <mchehab@infradead.org>,
Paul Gortmaker <paul.gortmaker@windriver.com>,
<linux-media@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] media: ir-sony-decoder: 15bit function decode fix
Date: Mon, 20 Feb 2012 10:13:54 +0000 [thread overview]
Message-ID: <4F421CE2.4010004@imgtec.com> (raw)
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>
---
(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(-)
diff --git a/drivers/media/rc/ir-sony-decoder.c b/drivers/media/rc/ir-sony-decoder.c
index d5e2b50..dab98b3 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)
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);
--
1.7.2.3
reply other threads:[~2012-02-20 10:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F421CE2.4010004@imgtec.com \
--to=james.hogan@imgtec.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@infradead.org \
--cc=paul.gortmaker@windriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.