1. 08 1月, 2012 1 次提交
    • D
      hid-input: add support for HID devices reporting Battery Strength · c5a92aa3
      Daniel Nicoletti 提交于
      I've sent an email earlier asking for help with a GetFeature code, and now I
      have a second patch on top of Jeremy's to provide the battery functionality
      for devices that support reporting it.
      
      If I understood correctly when talking to Jeremy he said his device
      never actually reported the status as an input event (sorry if I didn't
      understand it correctly), and after reading HID specs I believe it's
      really because it was meant to be probed, I have an Apple Keyboard and
      Magic Trackpad both bluetooth batteries operated, so using PacketLogger
      I saw that Mac OSX always ask the battery status using the so called
      GetFeature.
      
      What my patch does is basically:
      - store the report id that matches the battery_strength
      - setup the battery if 0x6.0x20 is found, even if that is reported as a feature
        (as it was meant to be but only the MagicTrackpad does)
      - when upower or someone access /sys/class/power_supply/hid-*/capacity it
        will probe the device and return it's status.
      
      It works great for both devices, but I have two concerns:
      - the report_features function has a duplicated code
      - it would be nice if it was possible for specific drivers to provide their own
        probe as there might be some strange devices... (but maybe it's
      already possible)
      
      I've talked to the upower dev and he fixed it to be able to show the
      right percentage.
      
      Here how the uevent file (in /sys/class/power_supply/hid-*/) looks like:
      POWER_SUPPLY_NAME=hid-00:22:41:D9:18:E7-battery
      POWER_SUPPLY_PRESENT=1
      POWER_SUPPLY_ONLINE=1
      POWER_SUPPLY_CAPACITY=66
      POWER_SUPPLY_MODEL_NAME=MacAdmin’s keyboard
      POWER_SUPPLY_STATUS=Discharging
      
      POWER_SUPPLY_NAME=hid-70:CD:60:F5:FF:3F-battery
      POWER_SUPPLY_PRESENT=1
      POWER_SUPPLY_ONLINE=1
      POWER_SUPPLY_CAPACITY=62
      POWER_SUPPLY_MODEL_NAME=nexx’s Trackpad
      POWER_SUPPLY_STATUS=Discharging
      Signed-off-by: NDaniel Nicoletti <dantti12@gmail.com>
      c5a92aa3
  2. 30 11月, 2011 1 次提交
  3. 28 11月, 2011 1 次提交
    • J
      HID: hid-input: add support for HID devices reporting Battery Strength · 4f5ca836
      Jeremy Fitzhardinge 提交于
      Some HID devices, such as my Bluetooth mouse, report their battery
      strength as an event.  Rather than passing it through as a strange
      absolute input event, this patch registers it with the power_supply
      subsystem as a battery, so that the device's Battery Strength can be
      reported to usermode.
      
      The battery appears in sysfs names
      /sys/class/power_supply/hid-<UNIQ>-battery, and it is a child of the
      battery-containing device, so it should be clear what it's the battery of.
      
      Unfortunately on my current Fedora 16 system, while the battery does
      appear in the UI, it is listed as a Laptop Battery with 0% charge (since
      it ignores the "capacity" property of the battery and instead computes
      it from the "energy*" fields, which we can't supply given the limited
      information contained within the HID Report).
      
      Still, this patch is the first step.
      Signed-off-by: NJeremy Fitzhardinge <jeremy@goop.org>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      4f5ca836
  4. 23 11月, 2011 4 次提交
  5. 20 11月, 2011 2 次提交
  6. 19 11月, 2011 1 次提交
  7. 16 11月, 2011 3 次提交
  8. 11 11月, 2011 1 次提交
  9. 01 11月, 2011 2 次提交
  10. 29 10月, 2011 1 次提交
  11. 28 10月, 2011 1 次提交
  12. 21 10月, 2011 2 次提交
  13. 17 10月, 2011 2 次提交
    • J
      HID: primax: remove spurious dependency · dfe9a312
      Jiri Kosina 提交于
      Remove Kconfig dependency for hid-primax driver on CONFIG_EXPERT.
      Please see changelog of 73d5e8f7 ("HID: fix up 'EMBEDDED' mess in
      Kconfig") for reasoning behind this.
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      dfe9a312
    • T
      HID: support primax keyboards violating USB HID spec · f6a04605
      Terry Lambert 提交于
      Primax keyboards with the issue this driver addresses report modifier
      keys as in band key events instead of as out of band modifier bits,
      resulting in the modifier keys generating key up events immediately
      before the keys they are intended to modify.  This driver rewrites
      the raw report data from such keyboards into USB HID 1.11 compliant
      report data.  It only matches the USB vendor and product IDs for the
      keyboard it has been tested on. Since there are several keyboards,
      notably a number of laptops and folding USB keyboards known to have
      similar unresolved problem reports, the list is expected to grow.
      Signed-off-by: NTerry Lambert <tlambert@chromium.org>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      f6a04605
  14. 14 10月, 2011 1 次提交
  15. 09 10月, 2011 1 次提交
  16. 05 10月, 2011 1 次提交
  17. 04 10月, 2011 1 次提交
  18. 03 10月, 2011 1 次提交
  19. 28 9月, 2011 1 次提交
  20. 27 9月, 2011 1 次提交
    • D
      HID: hiddev: potential info leak in hiddev_ioctl() · 9561f7fa
      Dan Carpenter 提交于
      Smatch has a new check for Rosenberg type information leaks where
      structs are copied to the user with uninitialized stack data in them.
      
      In this case, the hiddev_devinfo struct has a two byte hole.
      
      struct hiddev_devinfo {
              __u32                      bustype;              /*     0     4 */
              __u32                      busnum;               /*     4     4 */
              __u32                      devnum;               /*     8     4 */
              __u32                      ifnum;                /*    12     4 */
              __s16                      vendor;               /*    16     2 */
              __s16                      product;              /*    18     2 */
              __s16                      version;              /*    20     2 */
      
              /* XXX 2 bytes hole, try to pack */
      
              __u32                      num_applications;     /*    24     4 */
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      9561f7fa
  21. 26 9月, 2011 2 次提交
  22. 22 9月, 2011 1 次提交
  23. 20 9月, 2011 3 次提交
  24. 15 9月, 2011 1 次提交
    • N
      HID: Add full support for Logitech Unifying receivers · 534a7b8e
      Nestor Lopez Casado 提交于
      With this driver, all the devices paired to a single Unifying
      receiver are exposed to user processes in separated /input/dev
      nodes.
      
      Keyboards with different layouts can be treated differently,
      Multiplayer games on single PC (like home theater PC) can
      differentiate input coming from different kbds paired to the
      same receiver.
      
      Up to now, when Logitech Unifying receivers are connected to a
      Linux based system, a single keyboard and a single mouse are
      presented to the HID Layer, even if the Unifying receiver can
      pair up to six compatible devices. The Unifying receiver by default
      multiplexes all incoming events (from multiple keyboards/mice)
      into these two.
      Signed-off-by: NNestor Lopez Casado <nlopezcasad@logitech.com>
      Signed-off-by: NBenjamin Tissoires <benjamin.tissoires@gmail.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      534a7b8e
  25. 09 9月, 2011 1 次提交
  26. 07 9月, 2011 3 次提交