1. 06 4月, 2014 1 次提交
  2. 13 3月, 2014 1 次提交
  3. 12 3月, 2014 5 次提交
  4. 11 3月, 2014 1 次提交
  5. 07 2月, 2014 1 次提交
  6. 06 2月, 2014 1 次提交
    • J
      [media] media: rc: add sysfs scancode filtering interface · 00942d1a
      James Hogan 提交于
      Add and document a generic sysfs based scancode filtering interface for
      making use of IR data matching hardware to filter out uninteresting
      scancodes. Two filters exist, one for normal operation and one for
      filtering scancodes which are permitted to wake the system from suspend.
      
      The following files are added to /sys/class/rc/rc?/:
       - filter: normal scancode filter value
       - filter_mask: normal scancode filter mask
       - wakeup_filter: wakeup scancode filter value
       - wakeup_filter_mask: wakeup scancode filter mask
      
      A new s_filter() driver callback is added which must arrange for the
      specified filter to be applied at the right time. Drivers can convert
      the scancode filter into a raw IR data filter, which can be applied
      immediately or later (for wake up filters).
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Mauro Carvalho Chehab <m.chehab@samsung.com>
      Cc: linux-media@vger.kernel.org
      Cc: Rob Landley <rob@landley.net>
      Cc: linux-doc@vger.kernel.org
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      00942d1a
  7. 04 2月, 2014 3 次提交
  8. 15 1月, 2014 1 次提交
  9. 23 8月, 2013 1 次提交
  10. 22 8月, 2013 1 次提交
  11. 01 8月, 2013 1 次提交
    • S
      [media] media: rc: Add rc_open/close and use count to rc_dev · 8b2ff320
      Srinivas Kandagatla 提交于
      This patch adds user count to rc_dev structure, the reason to add this
      new member is to allow other code like lirc to open rc device directly.
      In the existing code, rc device is only opened by input subsystem which
      works ok if we have any input drivers to match. But in case like lirc
      where there will be no input driver, rc device will be never opened.
      Having this user count variable will be usefull to allow rc device to be
      opened from code other than rc-main.
      This patch also adds rc_open and rc_close functions for other drivers
      like lirc to open and close rc devices. This functions safely increment
      and decrement the user count. Other driver wanting to open rc device
      should call rc_open and rc_close, rather than directly modifying the
      rc_dev structure.
      Signed-off-by: NSrinivas Kandagatla <srinivas.kandagatla@st.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      8b2ff320
  12. 23 3月, 2013 1 次提交
  13. 20 3月, 2013 2 次提交
  14. 27 12月, 2012 1 次提交
  15. 26 12月, 2012 1 次提交
  16. 27 10月, 2012 1 次提交
    • D
      [media] rc-core: add separate defines for protocol bitmaps and numbers · c003ab1b
      David Härdeman 提交于
      The RC_TYPE_* defines are currently used both where a single protocol is
      expected and where a bitmap of protocols is expected.
      
      Functions like rc_keydown() and functions which add/remove entries to the
      keytable want a single protocol. Future userspace APIs would also
      benefit from numeric protocols (rather than bitmap ones). Keytables are
      smaller if they can use a small(ish) integer rather than a bitmap.
      
      Other functions or struct members (e.g. allowed_protos,
      enabled_protocols, etc) accept multiple protocols and need a bitmap.
      
      Using different types reduces the risk of programmer error. Using a
      protocol enum whereever possible also makes for a more future-proof
      user-space API as we don't need to worry about a sufficient number of
      bits being available (e.g. in structs used for ioctl() calls).
      
      The use of both a number and a corresponding bit is dalso one in e.g.
      the input subsystem as well (see all the references to set/clear bit when
      changing keytables for example).
      
      This patch separate the different usages in preparation for
      upcoming patches.
      
      Where a single protocol is expected, enum rc_type is used; where one or more
      protocol(s) are expected, something like u64 is used.
      
      The patch has been rewritten so that the format of the sysfs "protocols"
      file is no longer altered (at the loss of some detail). The file itself
      should probably be deprecated in the future though.
      Signed-off-by: NDavid Härdeman <david@hardeman.nu>
      Cc: Andy Walls <awalls@md.metrocast.net>
      Cc: Maxim Levitsky <maximlevitsky@gmail.com>
      Cc: Antti Palosaari <crope@iki.fi>
      Cc: Mike Isely <isely@pobox.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      c003ab1b
  17. 31 7月, 2012 1 次提交
    • D
      [media] Avoid sysfs oops when an rc_dev's raw device is absent · 720bb643
      Douglas Bagnall 提交于
      For some reason, when the lirc daemon learns that a usb remote control
      has been unplugged, it wants to read the sysfs attributes of the
      disappearing device. This is useful for uncovering transient
      inconsistencies, but less so for keeping the system running when such
      inconsistencies exist.
      
      Under some circumstances (like every time I unplug my dvb stick from
      my laptop), lirc catches an rc_dev whose raw event handler has been
      removed (presumably by ir_raw_event_unregister), and proceeds to
      interrogate the raw protocols supported by the NULL pointer.
      
      This patch avoids the NULL dereference, and ignores the issue of how
      this state of affairs came about in the first place.
      
      Version 2 incorporates changes recommended by Mauro Carvalho Chehab
      (-ENODEV instead of -EINVAL, and a signed-off-by).
      Signed-off-by: NDouglas Bagnall <douglas@paradise.net.nz>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      720bb643
  18. 20 3月, 2012 1 次提交
  19. 04 1月, 2012 1 次提交
  20. 24 11月, 2011 1 次提交
  21. 01 11月, 2011 1 次提交
  22. 31 7月, 2011 1 次提交
  23. 28 7月, 2011 2 次提交
    • 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
    • D
      [media] rc: double unlock in rc_register_device() · 0528f354
      Dan Carpenter 提交于
      If change_protocol() fails and we goto out_raw, then it calls unlock
      twice.  I noticed that the other time we called change_protocol() we
      held the &dev->lock, so I changed it to hold it here too.
      Reviewed-by: NJarod Wilson <jarod@redhat.com>
      Acked-by: NJarod Wilson <jarod@redhat.com>
      Signed-off-by: NDan Carpenter <error27@gmail.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      0528f354
  24. 02 7月, 2011 1 次提交
    • J
      [media] rc: call input_sync after scancode reports · 98c32bcd
      Jarod Wilson 提交于
      Due to commit cdda911c, evdev only
      becomes readable when the buffer contains an EV_SYN/SYN_REPORT event. If
      we get a repeat or a scancode we don't have a mapping for, we never call
      input_sync, and thus those events don't get reported in a timely
      fashion.
      
      For example, take an mceusb transceiver with a default rc6 keymap. Press
      buttons on an rc5 remote while monitoring with ir-keytable, and you'll
      see nothing. Now press a button on the rc6 remote matching the keymap.
      You'll suddenly get the rc5 key scancodes, the rc6 scancode and the rc6
      key spit out all at the same time.
      
      Pressing and holding a button on a remote we do have a keymap for also
      works rather unreliably right now, due to repeat events also happening
      without a call to input_sync (we bail from ir_do_keydown before getting
      to the point where it calls input_sync).
      
      Easy fix though, just add two strategically placed input_sync calls
      right after our input_event calls for EV_MSC, and all is well again.
      Technically, we probably should have been doing this all along, its just
      that it never caused any functional difference until the referenced
      change went into the input layer.
      
      input_sync once per IR signal. There was another hidden bug in the code
      where we were calling input_report_key using last_keycode instead of our
      just discovered keycode, which manifested with the reordering of calling
      input_report_key and setting last_keycode.
      Reported-by: NStephan Raue <sraue@openelec.tv>
      CC: Stephan Raue <sraue@openelec.tv>
      CC: Mauro Carvalho Chehab <mchehab@redhat.com>
      CC: Jeff Brown <jeffbrown@android.com>
      Acked-by: NDmitry Torokhov <dtor@mail.ru>
      Signed-off-by: NJarod Wilson <jarod@redhat.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      98c32bcd
  25. 21 5月, 2011 2 次提交
    • M
      [media] Use a more consistent value for RC repeat period · ca540c8b
      Mauro Carvalho Chehab 提交于
      The default REP_PERIOD is 33 ms. This doesn't make sense for IR's,
      as, in general, an IR repeat scancode is provided at every 110/115ms,
      depending on the RC protocol. So, increase its default, to do a
      better job avoiding ghost repeat events.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      Acked-by: NJarod Wilson <jarod@redhat.com>
      ca540c8b
    • J
      [media] rc: add locking to fix register/show race · 08aeb7c9
      Jarod Wilson 提交于
      When device_add is called in rc_register_device, the rc sysfs nodes show
      up, and there's a window in which ir-keytable can be launched via udev
      and trigger a show_protocols call, which runs without various rc_dev
      fields filled in yet. Add some locking around registration and
      store/show_protocols to prevent that from happening.
      
      The problem manifests thusly:
      
      [64692.957872] BUG: unable to handle kernel NULL pointer dereference at 0000000000000090
      [64692.957878] IP: [<ffffffffa036a4c1>] show_protocols+0x47/0xf1 [rc_core]
      [64692.957890] PGD 19cfc7067 PUD 19cfc6067 PMD 0
      [64692.957894] Oops: 0000 [#1] SMP
      [64692.957897] last sysfs file: /sys/devices/pci0000:00/0000:00:03.1/usb3/3-1/3-1:1.0/rc/rc2/protocols
      [64692.957902] CPU 3
      [64692.957903] Modules linked in: redrat3(+) ir_lirc_codec lirc_dev ir_sony_decoder ir_jvc_decoder ir_rc6_decoder ir_rc5_decoder rc_hauppauge ir_nec
      _decoder rc_core ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_filter ip6_tables snd_emu10k1_synth snd_emux_synth snd_seq_virmidi snd_seq_mi
      di_event snd_seq_midi_emul snd_emu10k1 snd_rawmidi snd_ac97_codec ac97_bus snd_seq snd_pcm snd_seq_device snd_timer snd_page_alloc snd_util_mem pcsp
      kr tg3 snd_hwdep emu10k1_gp snd amd64_edac_mod gameport edac_core soundcore edac_mce_amd k8temp shpchp i2c_piix4 lm63 e100 mii uinput ipv6 raid0 rai
      d1 ata_generic firewire_ohci pata_acpi firewire_core crc_itu_t sata_svw pata_serverworks floppy radeon ttm drm_kms_helper drm i2c_algo_bit i2c_core
      [last unloaded: redrat3]
      [64692.957949] [64692.957952] Pid: 12265, comm: ir-keytable Tainted: G   M    W   2.6.39-rc6+ #2 empty empty/TYAN Thunder K8HM S3892
      [64692.957957] RIP: 0010:[<ffffffffa036a4c1>]  [<ffffffffa036a4c1>] show_protocols+0x47/0xf1 [rc_core]
      [64692.957962] RSP: 0018:ffff880194509e38  EFLAGS: 00010202
      [64692.957964] RAX: 0000000000000000 RBX: ffffffffa036d1e0 RCX: ffffffffa036a47a
      [64692.957966] RDX: ffff88019a84d000 RSI: ffffffffa036d1e0 RDI: ffff88019cf2f3f0
      [64692.957969] RBP: ffff880194509e68 R08: 0000000000000002 R09: 0000000000000000
      [64692.957971] R10: 0000000000000002 R11: 0000000000001617 R12: ffff88019a84d000
      [64692.957973] R13: 0000000000001000 R14: ffff8801944d2e38 R15: ffff88019ce5f190
      [64692.957976] FS:  00007f0a30c9a720(0000) GS:ffff88019fc00000(0000) knlGS:0000000000000000
      [64692.957979] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [64692.957981] CR2: 0000000000000090 CR3: 000000019a8e0000 CR4: 00000000000006e0
      [64692.957983] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [64692.957986] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      [64692.957989] Process ir-keytable (pid: 12265, threadinfo ffff880194508000, task ffff88019a9fc720)
      [64692.957991] Stack:
      [64692.957992]  0000000000000002 ffffffffa036d1e0 ffff880194509f58 0000000000001000
      [64692.957997]  ffff8801944d2e38 ffff88019ce5f190 ffff880194509e98 ffffffff8131484b
      [64692.958001]  ffffffff8118e923 ffffffff810e9b2f ffff880194509e98 ffff8801944d2e18
      [64692.958005] Call Trace:
      [64692.958014]  [<ffffffff8131484b>] dev_attr_show+0x27/0x4e
      [64692.958014]  [<ffffffff8118e923>] ? sysfs_read_file+0x94/0x172
      [64692.958014]  [<ffffffff810e9b2f>] ? __get_free_pages+0x16/0x52
      [64692.958014]  [<ffffffff8118e94c>] sysfs_read_file+0xbd/0x172
      [64692.958014]  [<ffffffff8113205e>] vfs_read+0xac/0xf3
      [64692.958014]  [<ffffffff8113347b>] ? fget_light+0x3a/0xa1
      [64692.958014]  [<ffffffff811320f2>] sys_read+0x4d/0x74
      [64692.958014]  [<ffffffff814c19c2>] system_call_fastpath+0x16/0x1b
      
      Its a bit difficult to reproduce, but I'm fairly confident this has
      fixed the problem.
      Signed-off-by: NJarod Wilson <jarod@redhat.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      08aeb7c9
  26. 29 4月, 2011 2 次提交
  27. 31 3月, 2011 1 次提交
  28. 03 3月, 2011 1 次提交
  29. 01 2月, 2011 1 次提交
  30. 31 1月, 2011 1 次提交