Re: [PATCH 2/2] media: rtl28xxu: improve IR receiver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jul 03, 2022 at 08:02:14PM +0300, Marko Mäkelä wrote:
> Sat, Jul 02, 2022 at 09:14:59AM +0100, Sean Young wrote:
> > Hi,
> > 
> > On Tue, Jun 28, 2022 at 09:27:26AM +0300, Marko Mäkelä wrote:
> > > Mon, Jun 27, 2022 at 11:53:52AM +0100, Sean Young wrote:
> > > > Hi Marko,
> > > >
> > > > On Sun, Jun 26, 2022 at 03:33:47PM +0300, Marko Mäkelä wrote:
> > > > > I finally took the time to get a deeper understanding of the infrared remote
> > > > > control subsystem. I think that I now understand the translation into
> > > > > key-down, key-up, and key-repeat events. For the RC5 protocol, rc_repeat()
> > > > > will not be called by ir-rc5-decoder.c but instead, ir_do_keydown() will
> > > > > handle the repeat. For lirc_scancode_event() it will never set the
> > > > > LIRC_SCANCODE_FLAG_REPEAT bit, even if !new_event and the protocol does
> > > > > support the toggle bit. That might qualify as a bug.
> > > >
> > > > You are right, this was missed. Patches welcome.
> > > 
> > > Attached (for 5.19.0-rc3, on top of the two commits of this patch series).
> > > 
> > > I thought that it would be the least amount of trouble to slightly change
> > > the interpretation of the "toggle" parameter of
> > > rc_keydown(). My intention was to use the values 1 and 2 when the toggle
> > > flag is present. Any nonzero values would work.
> > 
> > I don't understand why this is needed.
> 
> For protocols that do not use a toggle bit, the last parameter of
> rc_keydown() will usually be toggle=0, and explicit calls to rc_repeat()
> will be issued when needed. For those protocols, I thought that we would not
> want rc_keydown() to set any LIRC_SCANCODE_FLAG_REPEAT flag under any
> circumstances.

Toggle and repeat are distinct concepts.

rc_repeat() is for protocols which have a special repeat message, which
carry no information other that "repeat the last message". However,
all protocols repeat. Whether they use a special repeat message or not.

It's right that if a protocol repeats a message, LIRC_SCANCODE_FLAG_REPEAT
is set.


Sean



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux