1. 07 2月, 2014 1 次提交
  2. 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
  3. 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
  4. 23 3月, 2013 1 次提交
  5. 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
  6. 04 9月, 2011 1 次提交
  7. 28 7月, 2011 1 次提交
  8. 21 5月, 2011 1 次提交
    • 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
  9. 19 1月, 2011 1 次提交
  10. 29 12月, 2010 9 次提交
  11. 21 10月, 2010 2 次提交
  12. 09 8月, 2010 3 次提交
  13. 03 8月, 2010 2 次提交
  14. 19 5月, 2010 15 次提交