1. 19 5月, 2010 8 次提交
    • M
      V4L/DVB: ir-core: Remove warining noise if decoders compiled builtin · 5fa2989f
      Mauro Carvalho Chehab 提交于
      drivers/media/IR/ir-raw-event.c:55: warning: ‘wq_load’ defined but not used
      drivers/media/IR/ir-raw-event.c:222: warning: ‘init_decoders’ defined but not used
      drivers/media/IR/rc-map.c: In function ‘get_rc_map’:
      drivers/media/IR/rc-map.c:40: warning: unused variable ‘rc’
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      5fa2989f
    • M
      V4L/DVB: ir-core: move subsystem internal calls to ir-core-priv.h · 3f113e36
      Mauro Carvalho Chehab 提交于
      ir-core.h has the kABI to be used by the bridge drivers, when needing to register
      IR protocols and pass IR events. However, the same file also contains IR subsystem
      internal calls, meant to be used inside ir-core and between ir-core and the raw
      decoders.
      
      Better to move those functions to an internal header, for some reasons:
      
      1) Header will be a little more cleaner;
      
      2) It avoids the need of recompile everything (bridge/hardware drivers, etc),
         just because a new decoder were added, or some other internal change were needed;
      
      3) Better organize the ir-core API, splitting the functions that are internal to
         IR core and the ancillary drivers (decoders, lirc_dev) from the features that
         should be exported to IR subsystem clients.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      3f113e36
    • D
      V4L/DVB: Teach drivers/media/IR/ir-raw-event.c to use durations · 724e2495
      David Härdeman 提交于
      drivers/media/IR/ir-raw-event.c is currently written with the assumption
      that all "raw" hardware will generate events only on state change (i.e.
      when a pulse or space starts).
      
      However, some hardware (like mceusb, probably the most popular IR receiver
      out there) only generates duration data (and that data is buffered so using
      any kind of timing on the data is futile).
      
      Furthermore, using signed int's to represent pulse/space durations is a
      well-known approach when writing ir decoders.
      
      With this patch:
      
      - s64 int's are used to represent pulse/space durations in ns
      
      - a workqueue is used to decode the ir protocols outside of interrupt context
      
      - #defines are added to make decoders clearer
      
      - decoder reset is implemented by passing a zero duration to the kfifo queue
        and decoders are updated accordingly
      Signed-off-by: NDavid Härdeman <david@hardeman.nu>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      724e2495
    • M
      V4L/DVB: ir-core: Distinguish sysfs attributes for in-hardware and raw decoders · 626cf697
      Mauro Carvalho Chehab 提交于
      Some devices have in-hardware Remote Controller decoder, while others
      need a software decoder to get the IR code. As each software decoder
      can be enabled/disabled individually, allowing multiple protocol
      decoding capability.
      
      On the other hand, hardware decoders have a limited protocol
      support, often being able of decoding just one protocol each time.
      So, each type needs a different set of capabilities to control the
      supported protocol(s).
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      626cf697
    • M
      V4L/DVB: ir: Make sure that the spinlocks are properly initialized · 6eb9435b
      Mauro Carvalho Chehab 提交于
      Some spinlocks are not properly initialized on ir core:
      
      [  471.714132] BUG: spinlock bad magic on CPU#0, modprobe/1899
      [  471.719838]  lock: f92a08ac, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0
      [  471.727301] Pid: 1899, comm: modprobe Not tainted 2.6.33 #36
      [  471.733062] Call Trace:
      [  471.735537]  [<c1498793>] ? printk+0x1d/0x22
      [  471.739866]  [<c12694e3>] spin_bug+0xa3/0xf0
      [  471.744224]  [<c126962d>] do_raw_spin_lock+0x7d/0x160
      [  471.749364]  [<f92a01ff>] ? ir_rc5_register+0x6f/0xf0 [ir_rc5_decoder]
      
      So, use static initialization for the static spinlocks, instead of the
      dynamic ones (currently used), as proposed by David Härdeman on one
      of his RFC patches.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      6eb9435b
    • M
      V4L-DVB: ir-core: remove the ancillary buffer · 587835a4
      Mauro Carvalho Chehab 提交于
      Now that the decoders are state machine, there's no need to create
      an ancillary buffer while decoding the protocol. Just call the decoders
      code directly, event by event.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      587835a4
    • M
      V4L-DVB: ir-rc5-decoder: Add a decoder for RC-5 IR protocol · db1423a6
      Mauro Carvalho Chehab 提交于
      This decoder is also based on a state machine, just like the NEC protocol
      decoder. It is pedantic in the sense that accepts only 14 bits. As there
      are some variants that outputs less bits, it needs to be improved to also
      handle those.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      db1423a6
    • D
      V4L/DVB: ir-core: improve keyup/keydown logic · a374fef4
      David Härdeman 提交于
      Rewrites the keyup/keydown logic in drivers/media/IR/ir-keytable.c.
      
      All knowledge of keystates etc is now internal to ir-keytable.c
      and not scattered around ir-raw-event.c and ir-nec-decoder.c (where
      it doesn't belong).
      
      In addition, I've changed the API slightly so that ir_input_dev is
      passed as the first argument rather than input_dev. If we're ever
      going to support multiple keytables we need to move towards making
      ir_input_dev the main interface from a driver POV and obscure away
      the input_dev as an implementational detail in ir-core.
      Signed-off-by: NDavid Härdeman <david@hardeman.nu>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      a374fef4
  2. 18 5月, 2010 5 次提交