From: Vladislav Zhurba <vzhurba@nvidia.com>
To: <linux-kernel@vger.kernel.org>
Cc: <mchehab@kernel.org>, <linux-media@vger.kernel.org>,
Daniel Fu <danifu@nvidia.com>,
Vladislav Zhurba <vzhurba@nvidia.com>
Subject: [PATCH 1/1] media: nec-decoder: remove trailer_space state
Date: Fri, 20 Apr 2018 11:51:39 -0700 [thread overview]
Message-ID: <20180420185139.29238-1-vzhurba@nvidia.com> (raw)
From: Daniel Fu <danifu@nvidia.com>
Remove STATE_TRAILER_SPACE from state machine.
Causing 2 issue:
- can not decode the keycode, if it didn't following with
another keycode/repeat code
- will generate one more code in current logic.
i.e. key_right + repeat code + key_left + repeat code.
expect: key_right, key_left.
Result: key_right, key_right, key_right.
Reason: when receive repeat code of key_right, state machine will
stay in STATE_TRAILER_SPACE state, then wait for a new interrupt,
if an interrupt came after keyup_timer, then will generate another
fake key.
According to the NEC protocol, it don't need a trailer space. Remove it.
Signed-off-by: Daniel Fu <danifu@nvidia.com>
Signed-off-by: Vladislav Zhurba <vzhurba@nvidia.com>
---
drivers/media/rc/ir-nec-decoder.c | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/drivers/media/rc/ir-nec-decoder.c b/drivers/media/rc/ir-nec-decoder.c
index 21647b809e6f..760b66affd1a 100644
--- a/drivers/media/rc/ir-nec-decoder.c
+++ b/drivers/media/rc/ir-nec-decoder.c
@@ -128,16 +128,6 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev)
if (!eq_margin(ev.duration, NEC_TRAILER_PULSE, NEC_UNIT / 2))
break;
- data->state = STATE_TRAILER_SPACE;
- return 0;
-
- case STATE_TRAILER_SPACE:
- if (ev.pulse)
- break;
-
- if (!geq_margin(ev.duration, NEC_TRAILER_SPACE, NEC_UNIT / 2))
- break;
-
if (data->count == NEC_NBITS) {
address = bitrev8((data->bits >> 24) & 0xff);
not_address = bitrev8((data->bits >> 16) & 0xff);
--
2.16.2
next reply other threads:[~2018-04-20 18:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-20 18:51 Vladislav Zhurba [this message]
2018-04-21 10:27 ` Sean Young
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=20180420185139.29238-1-vzhurba@nvidia.com \
--to=vzhurba@nvidia.com \
--cc=danifu@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.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
all inboxes | Powered by JetHome®