1. 29 10月, 2014 1 次提交
  2. 21 10月, 2014 1 次提交
  3. 26 8月, 2014 1 次提交
  4. 03 6月, 2014 1 次提交
  5. 28 4月, 2014 1 次提交
  6. 25 2月, 2014 2 次提交
  7. 17 2月, 2014 3 次提交
  8. 03 2月, 2014 2 次提交
  9. 21 12月, 2013 1 次提交
  10. 18 10月, 2013 1 次提交
    • N
      HID: Fix unit exponent parsing again · ad0e669b
      Nikolai Kondrashov 提交于
      Revert some changes done in 77463838.
      
      Revert all changes done in hidinput_calc_abs_res as it mistakingly used
      "Unit" item exponent nibbles to affect resolution value. This wasn't
      breaking resolution calculation of relevant axes of any existing
      devices, though, as they have only one dimension to their units and thus
      1 in the corresponding nible.
      
      Revert to reading "Unit Exponent" item value as a signed integer in
      hid_parser_global to fix reading specification-complying values. This
      fixes resolution calculation of devices complying to the HID standard,
      including Huion, KYE, Waltop and UC-Logic graphics tablets which have
      their report descriptors fixed by the drivers.
      
      Explanations follow.
      
      There are two "unit exponents" in HID specification and it is important
      not to mix them. One is the global "Unit Exponent" item and another is
      nibble values in the global "Unit" item. See 6.2.2.7 Global Items.
      
      The "Unit Exponent" value is just a signed integer and is used to scale
      the integer resolution unit values, so fractions can be expressed.
      
      The nibbles of "Unit" value are used to select the unit system (nibble
      0), and presence of a particular basic unit type in the unit formula and
      its *exponent* (or power, nibbles 1-6). And yes, the latter is in two
      complement and zero means absence of the unit type.
      
      Taking the representation example of (integer) joules from the
      specification:
      
      [mass(grams)][length(centimeters)^2][time(seconds)^-2] * 10^-7
      
      the "Unit Exponent" would be -7 (or 0xF9, if stored as a byte) and the
      "Unit" value would be 0xE121, signifying:
      
      Nibble  Part        Value   Meaning
      -----   ----        -----   -------
      0       System      1       SI Linear
      1       Length      2       Centimeters^2
      2       Mass        1       Grams
      3       Time        -2      Seconds^-2
      
      To give the resolution in e.g. hundredth of joules the "Unit Exponent"
      item value should have been -9.
      
      See also the examples of "Unit" values for some common units in the same
      chapter.
      
      However, there is a common misunderstanding about the "Unit Exponent"
      value encoding, where it is assumed to be stored the same as nibbles in
      "Unit" item. This is most likely due to the specification being a bit
      vague and overloading the term "unit exponent". This also was and still
      is proliferated by the official "HID Descriptor Tool", which makes this
      mistake and stores "Unit Exponent" as such. This format is also
      mentioned in books such as "USB Complete" and in Microsoft's hardware
      design guides.
      
      As a result many devices currently on the market use this encoding and
      so the driver should support them.
      Signed-off-by: NNikolai Kondrashov <spbnick@gmail.com>
      Acked-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      ad0e669b
  11. 13 9月, 2013 1 次提交
  12. 02 9月, 2013 1 次提交
  13. 31 7月, 2013 1 次提交
    • D
      HID: input: generic hidinput_input_event handler · 50c9d75b
      David Herrmann 提交于
      The hidinput_input_event() callback converts input events written from
      userspace into HID reports and sends them to the device. We currently
      implement this in every HID transport driver, even though most of them do
      the same.
      
      This provides a generic hidinput_input_event() implementation which is
      mostly copied from usbhid. It uses a delayed worker to allow multiple LED
      events to be collected into a single output event.
      We use the custom ->request() transport driver callback to allow drivers
      to adjust the outgoing report and handle the request asynchronously. If no
      custom ->request() callback is available, we fall back to the generic raw
      output report handler (which is synchronous).
      
      Drivers can still provide custom hidinput_input_event() handlers (see
      logitech-dj) if the generic implementation doesn't fit their needs.
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      50c9d75b
  14. 20 6月, 2013 2 次提交
  15. 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
  16. 27 3月, 2013 1 次提交
  17. 29 11月, 2012 1 次提交
  18. 26 11月, 2012 1 次提交
  19. 15 11月, 2012 3 次提交
  20. 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
  21. 20 9月, 2012 1 次提交
  22. 09 7月, 2012 1 次提交
  23. 04 7月, 2012 1 次提交
  24. 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
  25. 28 3月, 2012 1 次提交
  26. 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
  27. 04 2月, 2012 1 次提交
  28. 08 1月, 2012 6 次提交