1. 03 8月, 2010 20 次提交
    • J
      V4L/DVB: IR/imon: auto-configure another 0xffdc device variant · 49da8be5
      Jarod Wilson 提交于
      Per Pieter Hoekstra:
      
      I have a Antec Fusion with a iMON Lcd and I get the following error:
      imon 6-1:1.0: Unknown 0xffdc device, defaulting to VFD and iMON IR (id
      0x9e)
      
      The driver is functional if I load it like this: (I do not use a remote for it)
      modprobe imon display_type=1 (On Mythbuntu 10.04/2.6.32)
      
      This device is a lcd-type with support for a MCE remote. Looking at
      the source code, this device (0x9e) is the same as id 0x9f.
      Signed-off-by: NJarod Wilson <jarod@redhat.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      49da8be5
    • J
      15f135d0
    • 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
    • J
      V4L/DVB: IR: add lirc device interface · 4a62a5ab
      Jarod Wilson 提交于
      v2: currently unused ioctls are included, but #if 0'd out
      Signed-off-by: NJarod Wilson <jarod@redhat.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      4a62a5ab
    • J
      V4L/DVB: IR/mceusb: add tx callback functions and wire up · e23fb964
      Jarod Wilson 提交于
      mchehab: merged with IR/mceusb: userspace buffer copy moved out of driver
      
          Userspace buffer copy moved out of driver and into lirc bridge driver
      
      [mchehab@redhat.com: merged the patch to avoid compilation errors with allyesconfig ]
      Signed-off-by: NJarod Wilson <jarod@redhat.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      e23fb964
    • J
      V4L/DVB: IR/mceusb: kill pinnacle-device-specific nonsense · d732a72d
      Jarod Wilson 提交于
      I have pinnacle hardware now. None of this pinnacle-specific crap is at
      all necessary (in fact, some of it needed to be removed to actually make
      it work). The only thing unique about this device is that it often
      transfers inbound data w/a header of 0x90, meaning 16 bytes of IR data
      following it, so I had to make adjustments for that, and now its working
      perfectly fine.
      Signed-off-by: NJarod Wilson <jarod@redhat.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      d732a72d
    • J
      V4L/DVB: IR/mceusb: misc cleanups and init fixes · 657290b6
      Jarod Wilson 提交于
      The first-gen mceusb device init code, while mostly functional, had a few
      issues in it. This patch does the following:
      
      1) removes use of magic numbers
      2) eliminates mapping of memory from stack
      3) makes debug spew translator functional
      
      Additionally, this clean-up revealed that we cannot read the proper default
      tx blaster bitmask from the device, we do actually have to initialize it
      ourselves, which requires use of a somewhat gross list-based mask inversion
      check.
      
      This patch also removes the entirely unnecessary use of struct ir_input_state.
      
      Also supersedes two earlier patches that also touched on first-gen
      cleanup, but were partially botched. This one actually compiles, works,
      etc., I swear. ;)
      Signed-off-by: NJarod Wilson <jarod@redhat.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      657290b6
    • J
      V4L/DVB: IR/mceusb: use the proper ir-core device unregister function · bd3881b1
      Jarod Wilson 提交于
      Was using input_unregister_device directly, instead of using
      ir_input_unregister, which tears down a bunch of other things in
      addition to eventually calling input_unregister_device.
      Signed-off-by: NJarod Wilson <jarod@redhat.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      bd3881b1
    • J
      V4L/DVB: IR/imon: use the proper ir-core device unregister function · 8a3fa812
      Jarod Wilson 提交于
      Was using input_unregister_device directly, instead of using
      ir_input_unregister, which tears down a bunch of other things in
      addition to eventually calling input_unregister_device.
      Signed-off-by: NJarod Wilson <jarod@redhat.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      8a3fa812
    • R
      V4L/DVB: media/IR: nec-decoder needs to select BITREV · 2135436a
      Randy Dunlap 提交于
      Fix ir-nec-decoder build: it uses bitrev library code, so
      select BITREVERSE in its Kconfig.
      
      ir-nec-decoder.c:(.text+0x1a2517): undefined reference to `byte_rev_table'
      ir-nec-decoder.c:(.text+0x1a2526): undefined reference to `byte_rev_table'
      ir-nec-decoder.c:(.text+0x1a2530): undefined reference to `byte_rev_table'
      ir-nec-decoder.c:(.text+0x1a2539): undefined reference to `byte_rev_table'
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      2135436a
    • 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
    • M
      V4L/DVB: ir-core: allow specifying multiple protocols at one open/write · de8592bd
      Mauro Carvalho Chehab 提交于
      With this change, it is now possible to do something like:
              su -c 'echo "none +rc-5 +nec" > /sys/class/rc/rc1/protocols'
      
      This prevents the need of multiple opens, one for each protocol change,
      and makes userspace application easier.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      de8592bd
    • M
      V4L/DVB: ir-core: Add support for disabling all protocols · 5f124797
      Mauro Carvalho Chehab 提交于
      Writing "none" to /dev/class/rc/rc*/protocols will disable all protocols.
      This allows an easier setup, from userspace, as userspace applications don't
      need to disable protocol per protocol, before enabling a different set of
      protocols.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      5f124797
    • M
      V4L/DVB: ir-core: Rename sysfs protocols nomenclature to rc-5 and rc-6 · a9e55ea9
      Mauro Carvalho Chehab 提交于
      While rc-5 and rc-6 protocols are generally abreviated as "rc5" and "rc6",
      previous sysfs nodes uses rc-5 and rc-6 for the Philips protocols. This is
      consistent with the protocol nomenclature given by the original Philips
      spec: "Remote control system RC-5" (doc. Nr. 9398 706 23011).
      Also, rc5 is the name of a widely known cryptography protocol.
      
      So, the better is to keep referring to those protocols as "rc-5" and "rc-6".
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      a9e55ea9
    • M
      V4L/DVB: ir-core: Remove magic numbers at the sysfs logic · 4403b7b4
      Mauro Carvalho Chehab 提交于
      Instead of using "magic" sizes for protocol names, replace them by an
      array, and use strlen().
      
      No functional changes.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      4403b7b4
    • 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: add mceusb IR receiver driver · 66e89522
      Jarod Wilson 提交于
      This is a new driver for the Windows Media Center Edition/eHome
      Infrared Remote transceiver devices. Its a port of the current
      lirc_mceusb driver to ir-core, and currently lacks transmit support,
      but will grow it back soon enough... This driver also differs from
      lirc_mceusb in that it borrows heavily from a simplified IR buffer
      decode routine found in Jon Smirl's earlier ir-mceusb port.
      
      This driver has been tested on the original first-generation MCE IR
      device with the MS vendor ID, as well as a current-generation device
      with a Topseed vendor ID. Every receiver supported by lirc_mceusb
      should work equally well. Testing was done primarily with RC6 MCE
      remotes, but also briefly with a Hauppauge RC5 remote, and all works
      as expected.
      
      v2: fix call to ir_raw_event_handle so repeats work as they should.
      Signed-off-by: NJarod Wilson <jarod@redhat.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      66e89522
    • J
      V4L/DVB: IR: add RC6 keymap for Windows Media Center Ed. remotes · 0204fe2a
      Jarod Wilson 提交于
      This is the RC6 keymap for the Windows Media Center Edition remotes
      that come bundled with MCE/eHome Infrared Remote transceivers. Tested
      with 3 different variants of the remote, but its possible there are
      still some additional keys missing, but its simple enough to add them
      in later...
      
      This patch also adds an IR_TYPE_ALL convenience macro to make life
      easier for receivers that support all IR protocols.
      
      v2: fix an erroneous comment that referred to imon devices
      Signed-off-by: NJarod Wilson <jarod@redhat.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      0204fe2a
    • J
      V4L/DVB: IR: only initially registers protocol that matches loaded keymap · 7366646e
      Jarod Wilson 提交于
      Rather than registering all IR protocol decoders as enabled when bringing
      up a new device, only enable the IR protocol decoder that matches the
      keymap being loaded. Additional decoders can be enabled on the fly by
      those that need to, either by twiddling sysfs bits or by using the
      ir-keytable util from v4l-utils.
      
      Functional testing done with the mceusb driver, and it behaves as expected,
      only the rc6 decoder is enabled, keys are all handled properly, etc.
      Signed-off-by: NJarod Wilson <jarod@redhat.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      7366646e
    • 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
  2. 01 6月, 2010 7 次提交
  3. 19 5月, 2010 13 次提交