1. 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
  2. 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
  3. 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
  4. 29 4月, 2011 2 次提交
  5. 31 3月, 2011 1 次提交
  6. 03 3月, 2011 1 次提交
  7. 01 2月, 2011 1 次提交
  8. 31 1月, 2011 1 次提交
  9. 29 12月, 2010 15 次提交
  10. 01 11月, 2010 1 次提交
  11. 31 10月, 2010 1 次提交
  12. 21 10月, 2010 3 次提交
  13. 28 9月, 2010 2 次提交
    • M
      V4L/DVB: IR: fix keys beeing stuck down forever · e0172fd3
      Maxim Levitsky 提交于
      The logic in ir_timer_keyup was inverted.
      
      In case that values aren't equal,
      the meaning of the time_is_after_eq_jiffies(ir->keyup_jiffies) is that
      ir->keyup_jiffies is after the the jiffies or equally that
      that jiffies are before the the ir->keyup_jiffies which is
      exactly the situation we want to avoid (that the timeout is in the future)
      Confusing Eh?
      Signed-off-by: NMaxim Levitsky <maximlevitsky@gmail.com>
      Acked-by: NJarod Wilson <jarod@redhat.com>
      Cc: stable@kernel.org
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      e0172fd3
    • M
      V4L/DVB: rc-core: increase repeat time · 04cab131
      Mauro Carvalho Chehab 提交于
      As reported by Anton Blanchard <anton@samba.org>, double IR events on
      2.6.36-rc2 and a DViCO FusionHDTV DVB-T Dual Express are happening:
      
      [ 1351.032084] ir_keydown: i2c IR (FusionHDTV): key down event, key 0x0067, scancode 0x0051
      [ 1351.281284] ir_keyup: keyup key 0x0067
      
      ie one key down event and one key up event 250ms later.
      
      So, we need to increase the repeat timeout, to avoid this bug to hit.
      
      As we're doing it at core, this fix is not needed anymore at dib0700 driver.
      
      Thanks-to: Anton Blanchard <anton@samba.org>
      Cc: stable@kernel.org
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      04cab131
  14. 10 9月, 2010 1 次提交
  15. 09 8月, 2010 3 次提交
  16. 03 8月, 2010 1 次提交
    • M
      V4L/DVB: sms: Convert IR support to use the Remote Controller core · 844a9e93
      Mauro Carvalho Chehab 提交于
      Rewrites the siano IR implementation. The previous implementation were
      non-standard. As such, it has issues if more than one device registers IR,
      as there used to have some static constants used during protocol decoding
      phase. Also, it used to implement its on RAW decoder, and only for RC5.
      
      The new code uses RC core subsystem for handling IR. This brings several
      new features to the driver, including:
      	- Allow to dynamically replace the IR keycodes;
      	- Supports all existing raw decoders (JVC, NEC, RC-5, RC-6, SONY);
      	- Supports lirc dev;
      	- Doesn't have race conditions when more than one sms IR is
      	  registered;
      	- The code size for the IR implementation is very small;
      	- it exports the IR features via /sys/class/rc.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      844a9e93
  17. 01 6月, 2010 1 次提交
  18. 19 5月, 2010 1 次提交