1. 08 Jan, 2012 4 commits
    • Jeremy Fitzhardinge's avatar
      hid-input/battery: deal with both FEATURE and INPUT report batteries · fb8ac91b
      Jeremy Fitzhardinge authored
      Some devices seem to report batteries as FEATUREs, others as INPUTs.
      Signed-off-by: default avatarJeremy Fitzhardinge <jeremy@goop.org>
      fb8ac91b
    • Jeremy Fitzhardinge's avatar
      hid-input/battery: add quirks for battery · bbc21cfd
      Jeremy Fitzhardinge authored
      Some devices always report percentage, despite having 0/255 as their
      min/max, so add a quirk for them.
      Signed-off-by: default avatarJeremy Fitzhardinge <jeremy@goop.org>
      bbc21cfd
    • Jeremy Fitzhardinge's avatar
    • Daniel Nicoletti's avatar
      hid-input: add support for HID devices reporting Battery Strength · c5a92aa3
      Daniel Nicoletti authored
      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: default avatarDaniel Nicoletti <dantti12@gmail.com>
      c5a92aa3
  2. 30 Nov, 2011 1 commit
  3. 28 Nov, 2011 1 commit
    • Jeremy Fitzhardinge's avatar
      HID: hid-input: add support for HID devices reporting Battery Strength · 4f5ca836
      Jeremy Fitzhardinge authored
      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: default avatarJeremy Fitzhardinge <jeremy@goop.org>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      4f5ca836
  4. 23 Nov, 2011 2 commits
  5. 22 Nov, 2011 2 commits
  6. 20 Nov, 2011 1 commit
  7. 19 Nov, 2011 2 commits
  8. 16 Nov, 2011 3 commits
  9. 11 Nov, 2011 1 commit
  10. 03 Nov, 2011 4 commits
  11. 02 Nov, 2011 19 commits