1. 20 6月, 2013 2 次提交
  2. 29 5月, 2013 1 次提交
    • D
      HID: input: return ENODATA if reading battery attrs fails · d0a934b7
      David Herrmann 提交于
      power_supply core has the bad habit of calling our battery callbacks
      from within power_supply_register(). Furthermore, if the callbacks
      fail with an unhandled error code, it will skip any uevent that it
      might currently process.
      So if HID-core registers battery devices, an "add" uevent is generated
      and the battery callbacks are called. These will gracefully fail due
      to timeouts as they might still hold locks on event processing. One
      could argue that this should be fixed in power_supply core, but the
      least we can do is to signal ENODATA so power_supply core will just
      skip the property and continue with the uevent.
      
      This fixes a bug where "add" and "remove" uevents are skipped for
      battery devices. upower is unable to track these devices and currently
      needs to ignore them.
      
      This patch also overwrites any other error code. I cannot see any reason
      why we should forward protocol- or I/O-errors to the power_supply core.
      We handle these errors in hid_ll_driver later, anyway, so just skip
      them. power_supply core cannot do anything useful with them, anyway,
      and we avoid skipping important uevents and confusing user-space.
      
      Thanks a lot to Daniel Nicoletti for pushing and investigating
      on this.
      
      Cc: Jiri Kosina <jkosina@suse.cz>
      Cc: Anton Vorontsov <cbou@mail.ru>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Reported-by: NDaniel Nicoletti <dantti12@gmail.com>
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      d0a934b7
  3. 27 3月, 2013 1 次提交
  4. 29 11月, 2012 1 次提交
  5. 26 11月, 2012 1 次提交
  6. 15 11月, 2012 3 次提交
  7. 31 10月, 2012 1 次提交
    • I
      HID: fix incorrect handling of devices with high button count · f8e86d05
      Ingo Ruhnke 提交于
      Button names for USB gamepads are currently assigned incorrectly, as the evdev
      code assigned to buttons is "BTN_GAMEPAD + code", which on devices with more
      then 16 buttons bleeds over into button names reserved for graphic tablets
      (BTN_TOOL_PEN, etc.). This causes problems further down the line as the device
      are now no longer detected as joystick. This patch fixes that by assigning
      buttons outside the range to BTN_TRIGGER_HAPPY (as is already the case for USB
      joysticks).
      
      Furthermore this patch corrects the assignment to BTN_TRIGGER_HAPPY, as
      currently the first button over 16 is assigned to BTN_TRIGGER_HAPPY17 (i.e.
      BTN_TRIGGER_HAPPY+0x10) not BTN_TRIGGER_HAPPY.
      Signed-off-by: NIngo Ruhnke <grumbel@gmail.com>
      Acked-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      f8e86d05
  8. 20 9月, 2012 1 次提交
  9. 09 7月, 2012 1 次提交
  10. 04 7月, 2012 1 次提交
  11. 01 5月, 2012 1 次提交
    • H
      HID: hid-multitouch: Switch to device groups · 4fa3a583
      Henrik Rydberg 提交于
      Switch the driver over to device group handling.  By adding the
      HID_GROUP_MULTITOUCH group to hid-core, hid-generic will no longer
      match multitouch devices.  By adding the HID_GROUP_MULTITOUCH entry to
      the device list, hid-multitouch will match all unknown multitouch
      devices, and udev will automatically load the module.
      
      Since HID_QUIRK_MULTITOUCH never gets set, the special quirks handling
      can be removed.  Since all HID MT devices have HID_DG_CONTACTID, they
      can be removed from the hid_have_special_driver list.
      
      With this patch, the unknown device ids are no longer NULL, so the code
      is modified to check for the generic entry instead.
      Signed-off-by: NHenrik Rydberg <rydberg@euromail.se>
      Acked-by: NBenjamin Tissoires <benjamin.tissoires@gmail.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      4fa3a583
  12. 28 3月, 2012 1 次提交
  13. 05 3月, 2012 1 次提交
    • N
      HID: hid-input: allow array fields out of range · 883e0e36
      Nikolai Kondrashov 提交于
      Allow array field values out of range as per HID 1.11 specification,
      section 6.2.25:
      
      	Rather than returning a single bit for each button in the group, an
      	array returns an index in each field that corresponds to the pressed
      	button (like keyboard scan codes). An out-of range value in and array
      	field is considered no controls asserted.
      
      Apparently, "and" above is a typo and should be "an".
      
      This fixes at least Waltop tablet pen clicks - otherwise BTN_TOUCH is never
      released.
      
      The relevant part of Waltop tablet report descriptors is this:
      
      	0x09, 0x42,         /*          Usage (Tip Switch),         */
      	0x09, 0x44,         /*          Usage (Barrel Switch),      */
      	0x09, 0x46,         /*          Usage (Tablet Pick),        */
      	0x15, 0x01,         /*          Logical Minimum (1),        */
      	0x25, 0x03,         /*          Logical Maximum (3),        */
      	0x75, 0x04,         /*          Report Size (4),            */
      	0x95, 0x01,         /*          Report Count (1),           */
      	0x80,               /*          Input,                      */
      
      This is a regression fix for commit b4b583d4 ("HID: be more strict when
      ignoring out-of-range fields").
      Signed-off-by: NNikolai Kondrashov <spbnick@gmail.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      883e0e36
  14. 04 2月, 2012 1 次提交
  15. 08 1月, 2012 8 次提交
  16. 21 12月, 2011 1 次提交
  17. 30 11月, 2011 1 次提交
  18. 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
  19. 16 11月, 2011 2 次提交
  20. 26 9月, 2011 1 次提交
  21. 18 5月, 2011 1 次提交
    • J
      HID: assorted usage updates from hut 1.12 · 437f3b19
      Jarod Wilson 提交于
      I've got a Tivo Slide bluetooth remote/dongle, which uses a fair number
      of hid usages that aren't currently mapped in hid-input.c. I'd initially
      written additions to hid-input.c with just this device in mind,
      including some bits that were specific to the device. This go around,
      I'm looking at adding/correcting as many generic HID usages from the HID
      Usage Tables, version 1.12, as I can -- which also serves to enable all
      but four of the buttons on the Tivo Slide remote[*].
      
      Outside of fixing the obviously incorrect mapping of 0xc 0x45 from
      KEY_RADIO to KEY_RIGHT, and making use of the new KEY_IMAGES (just added
      in 2.6.39-rc4) for AL Image Browser instead of KEY_MEDIA, these are
      purely additions, and thus should have no negative impact on any already
      functional HID devices. Most of the added mappings seemed to be
      perfectly logical to me, but there were a few that were mapped on more
      of an "I think this makes the most sense" basis.
      
      [*] I'll handle the last four tivo buttons via an hid-tivo.c follow-up.
      
      CC: Dmitry Torokhov <dmitry.torokhov@gmail.com>
      CC: Jiri Kosina <jkosina@suse.cz>
      Signed-off-by: NJarod Wilson <jarod@redhat.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      437f3b19
  22. 02 3月, 2011 1 次提交
  23. 16 2月, 2011 1 次提交
  24. 01 2月, 2011 1 次提交
  25. 12 1月, 2011 1 次提交
  26. 14 12月, 2010 1 次提交
  27. 10 12月, 2010 1 次提交
    • J
      HID: Add and use hid_<level>: dev_<level> equivalents · 4291ee30
      Joe Perches 提交于
      Neaten current uses of dev_<level> by adding and using
      hid specific hid_<level> macros.
      
      Convert existing uses of dev_<level> uses to hid_<level>.
      Convert hid-pidff printk uses to hid_<level>.
      
      Remove err_hid and use hid_err instead.
      
      Add missing newlines to logging messages where necessary.
      Coalesce format strings.
      
      Add and use pr_fmt(fmt) KBUILD_MODNAME ": " fmt
      
      Other miscellaneous changes:
      
      Add const struct hid_device * argument to hid-core functions
      extract() and implement() so hid_<level> can be used by them.
      Fix bad indentation in hid-core hid_input_field function
      that calls extract() function above.
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      4291ee30
  28. 08 12月, 2010 1 次提交
  29. 02 12月, 2010 1 次提交