1. 29 12月, 2010 3 次提交
  2. 21 10月, 2010 3 次提交
  3. 28 9月, 2010 1 次提交
  4. 09 8月, 2010 4 次提交
  5. 03 8月, 2010 4 次提交
    • J
      V4L/DVB: IR: add ir-core to lirc userspace decoder bridge driver · ca414698
      Jarod Wilson 提交于
      v2: copy of buffer data from userspace done inside this plugin/driver,
      keeping the actual drivers minimal, and more flexible in what we can
      deliver to them later on (they may be fed from within kernelspace later
      on, by an in-kernel IR encoder).
      Signed-off-by: NJarod Wilson <jarod@redhat.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      ca414698
    • D
      V4L/DVB: ir-core: move decoding state to ir_raw_event_ctrl · c216369e
      David Härdeman 提交于
      This patch moves the state from each raw decoder into the
      ir_raw_event_ctrl struct.
      
      This allows the removal of code like this:
      
              spin_lock(&decoder_lock);
              list_for_each_entry(data, &decoder_list, list) {
                      if (data->ir_dev == ir_dev)
                              break;
              }
              spin_unlock(&decoder_lock);
              return data;
      
      which is currently run for each decoder on each event in order
      to get the client-specific decoding state data.
      
      In addition, ir decoding modules and ir driver module load
      order is now independent. Centralizing the data also allows
      for a nice code reduction of about 30% per raw decoder as
      client lists and client registration callbacks are no longer
      necessary (but still kept around for the benefit of the lirc
      decoder).
      
      Out-of-tree modules can still use a similar trick to what
      the raw decoders did before this patch until they are merged.
      Signed-off-by: NDavid Härdeman <david@hardeman.nu>
      Acked-by: NJarod Wilson <jarod@redhat.com>
      Tested-by: NJarod Wilson <jarod@redhat.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      c216369e
    • D
      V4L/DVB: ir-core: centralize sysfs raw decoder enabling/disabling · 667c9ebe
      David Härdeman 提交于
      With the current logic, each raw decoder needs to add a copy of the exact
      same sysfs code. This is both unnecessary and also means that (re)loading
      an IR driver after raw decoder modules have been loaded won't work as
      expected.
      
      This patch moves that logic into ir-raw-event and adds a single sysfs
      file per device.
      
      Reading that file returns something like:
      
      	"rc5 [rc6] nec jvc [sony]"
      
      (with enabled protocols in [] brackets)
      
      Writing either "+protocol" or "-protocol" to that file will
      enable or disable the according protocol decoder.
      
      An additional benefit is that the disabling of a decoder will be
      remembered across module removal/insertion so a previously
      disabled decoder won't suddenly be activated again. The default
      setting is to enable all decoders.
      
      This is also necessary for the next patch which moves even more decoder
      state into the central raw decoding structs.
      Signed-off-by: NDavid Härdeman <david@hardeman.nu>
      Acked-by: NJarod Wilson <jarod@redhat.com>
      Tested-by: NJarod Wilson <jarod@redhat.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      667c9ebe
    • J
      V4L/DVB: IR: let all protocol decoders have a go at raw data · c2284261
      Jarod Wilson 提交于
      On Fri, May 28, 2010 at 3:59 PM, Jarod Wilson <jarod@redhat.com> wrote:
      > The mceusb driver I'm about to submit handles just about any raw IR you
      > can throw at it. The ir-core loads up all protocol decoders, starting
      > with NEC, then RC5, then RC6. RUN_DECODER() was trying them in the same
      > order, and exiting if any of the decoders didn't like the data. The
      > default mceusb remote talks RC6(6A). Well, the RC6 decoder never gets a
      > chance to run unless you move the RC6 decoder to the front of the list.
      >
      > What I believe to be correct is to have RUN_DECODER keep trying all of
      > the decoders, even when one triggers an error. I don't think the errors
      > matter so much as it matters that at least one was successful -- i.e.,
      > that _sumrc is > 0. The following works for me w/my mceusb driver and
      > the default decoder ordering -- NEC and RC5 still fail, but RC6 still
      > gets a crack at it, and successfully does its job.
      >
      > Signed-off-by: Jarod Wilson <jarod@redhat.com>
      >
      > ---
      >  drivers/media/IR/ir-raw-event.c |    7 ++++---
      >
      > diff --git a/drivers/media/IR/ir-raw-event.c b/drivers/media/IR/ir-raw-event.c
      > index ea68a3f..44162db 100644
      > --- a/drivers/media/IR/ir-raw-event.c
      > +++ b/drivers/media/IR/ir-raw-event.c
      > @@ -36,14 +36,15 @@ static DEFINE_SPINLOCK(ir_raw_handler_lock);
      >  */
      >  #define RUN_DECODER(ops, ...) ({                                           \
      >        struct ir_raw_handler           *_ir_raw_handler;                   \
      > -       int _sumrc = 0, _rc;                                                \
      > +       int _sumrc = 0, _rc, _fail;                                         \
      >        spin_lock(&ir_raw_handler_lock);                                    \
      >        list_for_each_entry(_ir_raw_handler, &ir_raw_handler_list, list) {  \
      >                if (_ir_raw_handler->ops) {                                 \
      >                        _rc = _ir_raw_handler->ops(__VA_ARGS__);            \
      >                        if (_rc < 0)                                        \
      > -                               break;                                      \
      > -                       _sumrc += _rc;                                      \
      > +                               _fail++;                                    \
      > +                       else                                                \
      > +                               _sumrc += _rc;                              \
      
      Self-NAK. The only place we actually *care* about the retval from a
      RUN_DECODER() call is in __ir_input_register(), and currently, its
      looking for retval < 0, which is currently never possible. When we're
      running the decoders, either they fail and return -EINVAL or they
      succeed and return 0, and in the register case, we get either a
      negative error (ex: -ENOMEM from rc6) or 0, so with the above, _sumrc
      will *always* be 0 in the two cases I'm looking at. The third place
      where RUN_DECODER gets called (decoder unregister) doesn't care about
      the retval either. New patch below, including updated comments about
      the macro.
      Signed-off-by: NJarod Wilson <jarod@redhat.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      c2284261
  6. 19 5月, 2010 12 次提交
  7. 18 5月, 2010 5 次提交