linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "David Härdeman" <david@hardeman.nu>
To: Jarod Wilson <jarod@wilsonet.com>
Cc: Jarod Wilson <jarod@redhat.com>,
	Mauro Carvalho Chehab <mchehab@redhat.com>,
	linux-media@vger.kernel.org, linux-input@vger.kernel.org
Subject: Re: [PATCH 3/4] ir-core: move decoding state to ir_raw_event_ctrl
Date: Sun, 13 Jun 2010 22:29:45 +0200	[thread overview]
Message-ID: <20100613202945.GA5883@hardeman.nu> (raw)
In-Reply-To: <AANLkTims0dmYCOoI_K4S6Q8hwLV_MqUdGQjVwFu43sCL@mail.gmail.com>

On Wed, Jun 09, 2010 at 09:25:44PM -0400, Jarod Wilson wrote:
> On Wed, Jun 9, 2010 at 2:15 PM, Jarod Wilson <jarod@redhat.com> wrote:
> > On Wed, Jun 09, 2010 at 07:56:21PM +0200, David Härdeman wrote:
> >> On Wed, Jun 09, 2010 at 09:29:08AM -0400, Jarod Wilson wrote:
> ...
> >> > So this definitely negatively impacts my ir-core-to-lirc_dev
> >> > (ir-lirc-codec.c) bridge driver, as it was doing the lirc_dev device
> >> > registration work in its register function. However, if (after your
> >> > patchset) we add a new pair of callbacks replacing raw_register and
> >> > raw_unregister, which are optional, that work could be done there instead,
> >> > so I don't think this is an insurmountable obstacle for the lirc bits.
> >>
> >> While I'm not sure exactly what callbacks you're suggesting,
> >
> > Essentially:
> >
> > .setup_other_crap
> > .tear_down_other_crap
> >
> > ...which in the ir-lirc-codec case, register ir-lirc-codec for a specific
> > hardware receiver as an lirc_dev client, and conversely, tear it down.
> >
> >> it still
> >> sounds like the callbacks would have the exact same problems that the
> >> current code has (i.e. the decoder will be blissfully unaware of
> >> hardware which exists before the decoder is loaded). Right?
> >
> > In my head, this was going to work out, but you're correct, I still have
> > the exact same problem -- its not in ir_raw_handler_list yet when
> > ir_raw_event_register runs, and thus the callback never fires, so lirc_dev
> > never actually gets wired up to ir-lirc-codec. It now knows about the lirc
> > decoder, but its completely useless. Narf.
> 
> And now I have it working atop your patches. Its a bit of a nasty-ish
> hack, at least for the lirc case, but its working, even in the case
> where the decoder drivers aren't actually loaded until after the
> device driver. I've added one extra param to each protocol-specific
> struct in ir-core-priv.h (bool initialized) and hooked into the
> protocol-specific decode functions to both determine whether a
> protocol should be enabled or disabled by default, and to run any
> additionally required initialization (such as in the ir-lirc-codec
> case).
> 
> So initially, mceusb comes up with all decoders enabled. Then when ir
> comes in, every protocol-specific decoder fires. Each of them check
> for whether or not they've been fully initialized, and if not, we
> check the loaded keymap, and if it doesn't match, we disable that
> decoder (bringing back the "disable protocol handlers we don't need"
> functionality that disappeared w/this patchset). In the lirc case, we
> actually do all the work needed to wire up the connection over to
> lirc_dev.
> 
> This works perfectly fine for all the in-kernel decoders, but has one
> minor shortcoming for ir-lirc-codec, in that /dev/lirc0 won't actually
> exist until the first incoming ir signal is seen. lircd can handle
> this case just fine, it'll wait for /dev/lirc0 to show up, but it
> doesn't come up fast enough to catch and decode the very first
> incoming ir signal. Subsequent ones work perfectly fine though. This
> need to initialize the link via incoming ir is a bit problematic if
> you're using a device for transmit-only (e.g., and mceusb device
> hooked to a mythtv backend in the closet or something), as there would
> be a strong possibility of /dev/lirc0 never getting hooked up. I can
> think of a few workarounds, but none are particularly clean and/or
> automagic.
> 
> Not sure how palatable it is, but here it is:

I think it sounds pretty awful :)

I have another suggestion, let's keep the client register/unregister 
callbacks for decoders (but add a comment that they're only used for 
lirc). Then teach drivers/media/IR/ir-raw-event.c to keep track of the 
raw clients so that it can pass all pre-existing clients to newly added 
decoders.

I'll post two patches (compile tested only) in a few seconds to show 
what I mean.

-- 
David Härdeman
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2010-06-13 20:29 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-24 21:13 [PATCH 0/4] ir-core sysfs protocol selection simplification David Härdeman
2010-04-24 21:14 ` [PATCH 1/4] ir-core: remove IR_TYPE_PD David Härdeman
2010-04-24 21:14 ` [PATCH 2/4] ir-core: centralize sysfs raw decoder enabling/disabling David Härdeman
2010-05-03 19:49   ` Mauro Carvalho Chehab
2010-06-07 18:48     ` David Härdeman
2010-04-24 21:14 ` [PATCH 3/4] ir-core: move decoding state to ir_raw_event_ctrl David Härdeman
2010-05-03 20:00   ` Mauro Carvalho Chehab
2010-06-07 19:00     ` David Härdeman
2010-06-07 20:15       ` Jarod Wilson
2010-06-08 17:50         ` David Härdeman
2010-06-09  3:46           ` Jarod Wilson
2010-06-09 13:29             ` Jarod Wilson
2010-06-09 17:56               ` David Härdeman
2010-06-09 18:15                 ` Jarod Wilson
2010-06-10  1:25                   ` Jarod Wilson
2010-06-13 20:29                     ` David Härdeman [this message]
2010-06-16 20:04                       ` Jarod Wilson
2010-06-16 20:41                         ` Jarod Wilson
2010-06-17 12:14                           ` Andy Walls
2010-06-17 15:11                             ` Jarod Wilson
2010-06-21  0:47                               ` Andy Walls
2010-06-21  3:51                                 ` Jarod Wilson
2010-06-21 11:04                                   ` Andy Walls
2010-07-06 17:12                                     ` Jarod Wilson
2010-04-24 21:14 ` [PATCH 4/4] ir-core: remove ir-functions usage from cx231xx 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=20100613202945.GA5883@hardeman.nu \
    --to=david@hardeman.nu \
    --cc=jarod@redhat.com \
    --cc=jarod@wilsonet.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@redhat.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 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).