linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ravi Kumar V <kumarrav@codeaurora.org>
To: mchehab@infradead.org
Cc: paul.gortmaker@windriver.com, linux-media@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	davidb@codequrora.org, bryanh@codeaurora.org,
	tsoni@codeaurora.org, Ravi Kumar V <kumarrav@codeaurora.org>
Subject: [PATCH] media: rc: Add support to decode Remotes using NECx IR protocol
Date: Thu, 26 Jul 2012 11:44:24 +0530	[thread overview]
Message-ID: <1343283264-25367-1-git-send-email-kumarrav@codeaurora.org> (raw)

Some remotes use NECx IR protocol to send remote control key
events. Present nec decoder in rc framework is assuming to have 2
stop bits (pulse width of 560us & space width 5600us) in NECx, but in
reality NECx sends only pulse of 560us and space untill next frame.So
here we can ignore the space width in stop bit as it is variable.

Signed-off-by: Ravi Kumar V <kumarrav@codeaurora.org>
---
 drivers/media/rc/ir-nec-decoder.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/media/rc/ir-nec-decoder.c b/drivers/media/rc/ir-nec-decoder.c
index 3c9431a..a3fe1c8 100644
--- a/drivers/media/rc/ir-nec-decoder.c
+++ b/drivers/media/rc/ir-nec-decoder.c
@@ -149,6 +149,10 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev)
 			break;
 
 		data->state = STATE_TRAILER_SPACE;
+
+		if (data->is_nec_x)
+			goto rc_data;
+
 		return 0;
 
 	case STATE_TRAILER_SPACE:
@@ -157,7 +161,7 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev)
 
 		if (!geq_margin(ev.duration, NEC_TRAILER_SPACE, NEC_UNIT / 2))
 			break;
-
+rc_data:
 		address     = bitrev8((data->bits >> 24) & 0xff);
 		not_address = bitrev8((data->bits >> 16) & 0xff);
 		command	    = bitrev8((data->bits >>  8) & 0xff);
-- 
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

                 reply	other threads:[~2012-07-26  6:14 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=1343283264-25367-1-git-send-email-kumarrav@codeaurora.org \
    --to=kumarrav@codeaurora.org \
    --cc=bryanh@codeaurora.org \
    --cc=davidb@codequrora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=paul.gortmaker@windriver.com \
    --cc=tsoni@codeaurora.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).