1. 24 9月, 2011 1 次提交
    • P
      [media] media, rc: Use static inline functions to kill warnings · 600836cc
      Pekka Enberg 提交于
      This patch converts some ifdef'd wrapper functions from macros to static inline
      functions to kill the following warnings issued by GCC:
      
          CC [M]  drivers/media/rc/ir-raw.o
        drivers/media/rc/ir-raw.c: In function ‘init_decoders’:
        drivers/media/rc/ir-raw.c:353:2: warning: statement with no effect [-Wunused-value]
        drivers/media/rc/ir-raw.c:354:2: warning: statement with no effect [-Wunused-value]
        drivers/media/rc/ir-raw.c:355:2: warning: statement with no effect [-Wunused-value]
        drivers/media/rc/ir-raw.c:356:2: warning: statement with no effect [-Wunused-value]
        drivers/media/rc/ir-raw.c:357:2: warning: statement with no effect [-Wunused-value]
        drivers/media/rc/ir-raw.c:359:2: warning: statement with no effect [-Wunused-value]
      
      Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
      Cc: "David Härdeman" <david@hardeman.nu>
      Cc: Jarod Wilson <jarod@redhat.com>
      Cc: <linux-media@vger.kernel.org>
      Signed-off-by: NPekka Enberg <penberg@kernel.org>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      600836cc
  2. 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
  3. 29 12月, 2010 6 次提交
  4. 21 10月, 2010 4 次提交
    • M
      [media] IR: extend ir_raw_event and do refactoring · 4651918a
      Maxim Levitsky 提交于
      Add new event types for timeout & carrier report
      Move timeout handling from ir_raw_event_store_with_filter to
      ir-lirc-codec, where it is really needed.
      Now lirc bridge ensures proper gap handling.
      Extend lirc bridge for carrier & timeout reports
      
      Note: all new ir_raw_event variables now should be initialized
      like that: DEFINE_IR_RAW_EVENT(ev);
      
      To clean an existing event, use init_ir_raw_event(&ev);
      Signed-off-by: NMaxim Levitsky <maximlevitsky@gmail.com>
      Acked-by: NJarod Wilson <jarod@redhat.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      4651918a
    • M
      [media] IR: make sure we register the input device when it is safe to do so · 58b3dd44
      Maxim Levitsky 提交于
      As soon as input device is registered, it might be accessed (and it is)
      This can trigger a hardware interrupt that can access
      not yet initialized ir->raw, (by sending a sample)
      
      This can be reproduced by holding down a remote button and reloading the module.
      And this always crashes the systems where hardware decides to send an interrupt
      right at the moment it is enabled.
      Signed-off-by: NMaxim Levitsky <maximlevitsky@gmail.com>
      Acked-by: NJarod Wilson <jarod@redhat.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      58b3dd44
    • M
      [media] IR: plug races in IR raw thread · c6ef1e7f
      Maxim Levitsky 提交于
      Unfortunelly (my fault) the kernel thread that now handles IR processing
      has classical races in regard to wakeup and stop.
      This patch hopefully closes them all.
      Tested with module reload running in a loop, while receiver is blasted
      with IR data for 10 minutes.
      Signed-off-by: NMaxim Levitsky <maximlevitsky@gmail.com>
      Acked-by: NJarod Wilson <jarod@redhat.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      c6ef1e7f
    • J
      V4L/DVB: IR/streamzap: functional in-kernel decoding · 7a569f52
      Jarod Wilson 提交于
      This patch makes in-kernel decoding with the stock Streamzap PC Remote
      work out of the box. There are quite a few things going on in this
      patch, all related to getting this working:
      
      1) I had to enable reporting of a long space at the end of each signal,
         or I had weird buffering and keybounce issues.
      
      2) The keymap has been reworked slightly to match actual decoded values,
         the first edition was missing the pre-data bits present in the lirc
         config file for this remote.
      
      3) There's a whole new decoder included, specifically for the
         not-quite-RC5 15-bit protocol variant used by the Streamzap PC
         Remote. The decoder, while usable with other recievers (tested with
         an mceusb receiver), will only be loaded by the streamzap driver, as
         its likely not of use in almost all other situations. This can be
         revisited if/when all keytable loading (and disabling of unneeded
         protocol decoder engines) is moved to userspace, but for now, I think
         this makes the most sense.
      
      Note that I did try to enable handling the streamzap RC5-ish protocol in
      the current RC5 decoder, but there's no particularly easy way to tell if
      its 14-bit RC5 or 15-bit Streamzap until we see bit 14, and even then,
      in testing an attempted decoder merge, only 2/3 of the keys were
      properly recognized as being the 15-bit variant and decoded correctly,
      the rest were close enough to compliant with 14-bit that they were
      decoded as such (but they have overlap with one another, and thus we
      can't just shrug and use the 14-bit decoded values).
      
      Also of note in this patch is the removal of the streamzap driver's
      internal delay buffer. Per discussion w/Christoph, it shouldn't be
      needed by lirc any longer anyway, and it doesn't seem to make any
      difference to the in-kernel decoder engine. That being the case, I'm
      yanking it all out, as it greatly simplifies the driver code.
      Signed-off-by: NJarod Wilson <jarod@redhat.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      7a569f52
  5. 09 8月, 2010 6 次提交
  6. 03 8月, 2010 3 次提交
    • 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
  7. 19 5月, 2010 8 次提交