1. 28 7月, 2011 1 次提交
    • J
      [media] rc-core support for Microsoft IR keyboard/mouse · f5f2cc64
      Jarod Wilson 提交于
      This is a custom IR protocol decoder, for the RC-6-ish protocol used by
      the Microsoft Remote Keyboard, apparently developed internally at
      Microsoft, and officially dubbed MCIR-2, per their March 2011 remote and
      transceiver requirements and specifications document, which also touches
      on this IR keyboard/mouse device.
      
      Its a standard keyboard with embedded thumb stick mouse pointer and
      mouse buttons, along with a number of media keys. The media keys are
      standard RC-6, identical to the signals from the stock MCE remotes, and
      will be handled as such. The keyboard and mouse signals will be decoded
      and delivered to the system by an input device registered specifically
      by this driver.
      
      Successfully tested with multiple mceusb-driven transceivers, as well as
      with fintek-cir and redrat3 hardware. Essentially, any raw IR hardware
      with enough sampling resolution should be able to use this decoder,
      nothing about it is at all receiver-hardware-specific.
      
      This work is inspired by lirc_mod_mce:
      
      The documentation there and code aided in understanding and decoding the
      protocol, but the bulk of the code is actually borrowed more from the
      existing in-kernel decoders than anything. I did recycle the keyboard
      keycode table, a few defines, and some of the keyboard and mouse data
      parsing bits from lirc_mod_mce though.
      
      Special thanks to James Meyer for providing the hardware, and being
      patient with me as I took forever to get around to writing this.
      
      callback routine to ensure we don't get any stuck keys, and used
      symbolic names for the keytable. Also cc'ing Florian this time, who I
      believe is the original mod-mce author...
      
      CC: Florian Demski <fdemski@users.sourceforge.net>
      Signed-off-by: NJarod Wilson <jarod@redhat.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      f5f2cc64
  2. 02 7月, 2011 1 次提交
    • J
      [media] rc: fix ghost keypresses with certain hw · 3f5c4c73
      Jarod Wilson 提交于
      With hardware that has to use ir_raw_event_store_edge to collect IR
      sample durations, we were not doing an event reset unless
      IR_MAX_DURATION had passed. That's around 4 seconds. So if someone
      presses up, then down, with less than 4 seconds in between, they'd get
      the initial up, then up and down upon pressing down.
      
      To fix this, I've lowered the "send a reset event" logic's threshold to
      the input device's REP_DELAY (defaults to 500ms), and with an
      saa7134-based GPIO-driven IR receiver in a Hauppauge HVR-1150, I get
      *much* better behavior out of the remote now. Special thanks to Devin
      for providing the hardware to investigate this issue.
      
      CC: stable@kernel.org
      CC: Devin Heitmueller <dheitmueller@kernellabs.com>
      Signed-off-by: NJarod Wilson <jarod@redhat.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      3f5c4c73
  3. 31 3月, 2011 1 次提交
  4. 02 2月, 2011 1 次提交
  5. 19 1月, 2011 1 次提交
  6. 29 12月, 2010 6 次提交
  7. 21 10月, 2010 3 次提交
  8. 28 9月, 2010 1 次提交
  9. 09 8月, 2010 4 次提交
  10. 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
  11. 19 5月, 2010 12 次提交
  12. 18 5月, 2010 5 次提交