All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Young <sean@mess.org>
To: "David Härdeman" <david@hardeman.nu>
Cc: linux-media@vger.kernel.org, mchehab@s-opensource.com
Subject: Re: [PATCH 3/7] rc-core: img-nec-decoder - leave the internals of rc_dev alone
Date: Sun, 11 Jun 2017 17:02:24 +0100	[thread overview]
Message-ID: <20170611160223.GA16107@gofer.mess.org> (raw)
In-Reply-To: <20170528082844.mba244bxuepuaqh7@hardeman.nu>

On Sun, May 28, 2017 at 10:28:44AM +0200, David Härdeman wrote:
> On Mon, May 22, 2017 at 09:40:30PM +0100, Sean Young wrote:
> >On Mon, May 01, 2017 at 06:10:06PM +0200, David Härdeman wrote:
> >> Obvious fix, leave repeat handling to rc-core
> >> 
> >> Signed-off-by: David Härdeman <david@hardeman.nu>
> >> ---
> >>  drivers/media/rc/ir-nec-decoder.c |   10 +++-------
> >>  1 file changed, 3 insertions(+), 7 deletions(-)
> >> 
> >> diff --git a/drivers/media/rc/ir-nec-decoder.c b/drivers/media/rc/ir-nec-decoder.c
> >> index 3ce850314dca..75b9137f6faf 100644
> >> --- a/drivers/media/rc/ir-nec-decoder.c
> >> +++ b/drivers/media/rc/ir-nec-decoder.c
> >> @@ -88,13 +88,9 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev)
> >>  			data->state = STATE_BIT_PULSE;
> >>  			return 0;
> >>  		} else if (eq_margin(ev.duration, NEC_REPEAT_SPACE, NEC_UNIT / 2)) {
> >> -			if (!dev->keypressed) {
> >> -				IR_dprintk(1, "Discarding last key repeat: event after key up\n");
> >> -			} else {
> >> -				rc_repeat(dev);
> >> -				IR_dprintk(1, "Repeat last key\n");
> >> -				data->state = STATE_TRAILER_PULSE;
> >> -			}
> >> +			rc_repeat(dev);
> >> +			IR_dprintk(1, "Repeat last key\n");
> >> +			data->state = STATE_TRAILER_PULSE;
> >
> >This is not correct. This means that whenever a nec repeat is received,
> >the last scancode is sent to the input device, irrespective of whether
> >there has been no IR for hours. The original code is stricter.
> 
> I think that'd be an argument for moving the check to rc_repeat().

It is.

> But, on the other hand, sending an input scancode for each repeat event
> seems kind of pointless, doesn't it? If so, it might make more sense to
> just remove the input event generation from rc_repeat() altogether...

At least there is something visible in user-space saying that a repeat
has been received.


Sean

  reply	other threads:[~2017-06-11 16:02 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-01 16:09 [PATCH 0/7] rc: don't poke around in rc_dev internals David Härdeman
2017-05-01 16:09 ` [PATCH 1/7] rc-core: ati_remote - leave the internals of rc_dev alone David Härdeman
2017-05-01 16:10 ` [PATCH 2/7] rc-core: img-ir " David Härdeman
2017-05-01 16:10 ` [PATCH 3/7] rc-core: img-nec-decoder " David Härdeman
2017-05-22 20:40   ` Sean Young
2017-05-28  8:28     ` David Härdeman
2017-06-11 16:02       ` Sean Young [this message]
2017-06-17 11:14         ` David Härdeman
2017-05-01 16:10 ` [PATCH 4/7] rc-core: sanyo " David Härdeman
2017-05-22 20:46   ` Sean Young
2017-05-01 16:10 ` [PATCH 5/7] rc-core: ir-raw " David Härdeman
2017-05-23  9:20   ` Sean Young
2017-05-28  8:31     ` David Härdeman
2017-05-28 16:49       ` [PATCH] [media] rc-core: simplify ir_raw_event_store_edge() Sean Young
2017-06-06 21:27         ` Sean Young
2017-05-01 16:10 ` [PATCH 6/7] rc-core: cx231xx - leave the internals of rc_dev alone David Härdeman
2017-05-01 16:10 ` [PATCH 7/7] rc-core: tm6000 " David Härdeman

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=20170611160223.GA16107@gofer.mess.org \
    --to=sean@mess.org \
    --cc=david@hardeman.nu \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@s-opensource.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.