1. 05 2月, 2013 1 次提交
  2. 12 12月, 2012 1 次提交
  3. 07 12月, 2012 1 次提交
  4. 15 11月, 2012 3 次提交
  5. 13 10月, 2012 1 次提交
  6. 20 9月, 2012 2 次提交
  7. 09 7月, 2012 1 次提交
  8. 01 5月, 2012 5 次提交
  9. 28 4月, 2012 1 次提交
  10. 08 1月, 2012 4 次提交
    • J
      hid-input/battery: remove battery_val · ce63920b
      Jeremy Fitzhardinge 提交于
      hidinput_get_battery_property() now directly polls the device for the
      current battery strength, so there's no need for battery_val, or the
      code to set it on the input event path.
      Signed-off-by: NJeremy Fitzhardinge <jeremy@goop.org>
      ce63920b
    • J
      hid-input/battery: deal with both FEATURE and INPUT report batteries · fb8ac91b
      Jeremy Fitzhardinge 提交于
      Some devices seem to report batteries as FEATUREs, others as INPUTs.
      Signed-off-by: NJeremy Fitzhardinge <jeremy@goop.org>
      fb8ac91b
    • J
      hid-input/battery: add quirks for battery · bbc21cfd
      Jeremy Fitzhardinge 提交于
      Some devices always report percentage, despite having 0/255 as their
      min/max, so add a quirk for them.
      Signed-off-by: NJeremy Fitzhardinge <jeremy@goop.org>
      bbc21cfd
    • 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
  11. 21 12月, 2011 1 次提交
  12. 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
  13. 01 11月, 2011 1 次提交
    • P
      include: convert various register fcns to macros to avoid include chaining · eb5589a8
      Paul Gortmaker 提交于
      The original implementations reference THIS_MODULE in an inline.
      We could include <linux/export.h>, but it is better to avoid chaining.
      
      Fortunately someone else already thought of this, and made a similar
      inline into a #define in <linux/device.h> for device_schedule_callback(),
      [see commit 523ded71] so follow that precedent here.
      
      Also bubble up any __must_check that were used on the prev. wrapper inline
      functions up one to the real __register functions, to preserve any prev.
      sanity checks that were used in those instances.
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      eb5589a8
  14. 26 9月, 2011 1 次提交
  15. 10 8月, 2011 1 次提交
    • D
      HID: Fix race condition between driver core and ll-driver · 4ea54542
      David Herrmann 提交于
      HID low level drivers register new devices with the HID core which then
      adds the devices to the HID bus. The HID bus normally immediately probes
      an appropriate driver which then handles HID input for this device.
      The ll driver now uses the hid_input_report() function to report input
      events for a specific device. However, if the HID bus unloads the driver
      at the same time (for instance via a call to
       /sys/bus/hid/devices/<dev>/unbind) then the hdev->driver pointer may be
      used by hid_input_report() and hid_device_remove() at the same time
      which may cause hdev->driver to point to invalid memory.
      
      This fix adds a semaphore to every hid device which protects
      hdev->driver from asynchronous access. This semaphore is locked during
      driver *_probe and *_remove and also inside hid_input_report(). The
      *_probe and *_remove functions may sleep so the semaphore is good here,
      however, hid_input_report() is in atomic context and hence only uses
      down_trylock(). If it cannot acquire the lock it simply drops the input
      package.
      
      The low-level drivers report input events synchronously so
      hid_input_report() should never be entered twice at the same time on the
      same device. Hence, the lock should always be available. But if the
      driver is currently probed/removed then the lock is not available and
      dropping the package should be safe because this is what would have
      happened if the package arrived some milliseconds earlier/later.
      
      This also fixes another race condition while probing drivers:
      First the *_probe function of the driver is called and only if that
      succeeds, the related input device of hidinput is registered. If the low
      level driver reports input events after the *_probe function returned
      but before the input device is registered, then a NULL pointer
      dereference will occur. (Equivalently on driver remove function).
      This is not possible anymore, since the semaphore lock drops all
      incoming packages until the driver/device is fully initialized.
      Signed-off-by: NDavid Herrmann <dh.herrmann@googlemail.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      4ea54542
  16. 07 6月, 2011 1 次提交
    • T
      HID: yurex: recognize GeneralKeys wireless presenter as generic HID · 6dc1418e
      Tomoki Sekiyama 提交于
      Unfortunately, the device seems to have the same Vendor ID and Product ID
      as YUREX leg-shakes sensors, and the commit 6bc235a2 ("USB: add driver
      for Meywa-Denki & Kayac YUREX") added the ID to hid_ignore_list.
      
      I believe that we can distinguish YUREX and the Wireless Presenter by
      device type.  The patch below makes the driver ignore only YUREX
      (bInterfaceProtocol==0), and recognize Wireless Presenter
      (bInterfaceProtocol is keyboard or mouse) as generic HID.  (I don't have
      the Wireless Presenter, so not yet ested.)
      
      ** YUREX lsusb information:
      Bus 002 Device 007: ID 0c45:1010 Microdia
      Device Descriptor:
         bLength                18
         bDescriptorType         1
         bcdUSB               1.10
         bDeviceClass            0 (Defined at Interface level)
         bDeviceSubClass         0
         bDeviceProtocol         0
         bMaxPacketSize0         8
         idVendor           0x0c45 Microdia
         idProduct          0x1010
         bcdDevice            0.03
         iManufacturer           1 JESS
         iProduct                2 YUREX
         iSerial                 3 10000269
         bNumConfigurations      1
         Configuration Descriptor:
           bLength                 9
           bDescriptorType         2
           wTotalLength           34
           bNumInterfaces          1
           bConfigurationValue     1
           iConfiguration          0
           bmAttributes         0xa0
             (Bus Powered)
             Remote Wakeup
           MaxPower              100mA
           Interface Descriptor:
             bLength                 9
             bDescriptorType         4
             bInterfaceNumber        0
             bAlternateSetting       0
             bNumEndpoints           1
             bInterfaceClass         3 Human Interface Device
             bInterfaceSubClass      1 Boot Interface Subclass
             bInterfaceProtocol      0 None
             iInterface              0
               HID Device Descriptor:
                 bLength                 9
                 bDescriptorType        33
                 bcdHID               1.10
                 bCountryCode            0 Not supported
                 bNumDescriptors         1
                 bDescriptorType        34 Report
                 wDescriptorLength      31
                Report Descriptors:
                  ** UNAVAILABLE **
             Endpoint Descriptor:
               bLength                 7
               bDescriptorType         5
               bEndpointAddress     0x81  EP 1 IN
               bmAttributes            3
                 Transfer Type            Interrupt
                 Synch Type               None
                 Usage Type               Data
               wMaxPacketSize     0x0008  1x 8 bytes
               bInterval              10
      Device Status:     0x0002
         (Bus Powered)
         Remote Wakeup Enabled
      
      Addresses https://bugzilla.kernel.org/show_bug.cgi?id=26922Signed-off-by: NTomoki Sekiyama <tomoki.sekiyama@gmail.com>
      Cc: Greg KH <gregkh@suse.de>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Cc: Maciej Rutecki <maciej.rutecki@gmail.com>
      Reported-by: NThomas B?chler <thomas@archlinux.org>
      Tested-by: NThomas B?chler <thomas@archlinux.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      6dc1418e
  17. 31 3月, 2011 1 次提交
  18. 02 3月, 2011 1 次提交
  19. 11 2月, 2011 1 次提交
  20. 12 1月, 2011 2 次提交
  21. 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
  22. 08 12月, 2010 1 次提交
  23. 21 9月, 2010 1 次提交
  24. 10 8月, 2010 1 次提交
  25. 19 7月, 2010 1 次提交
  26. 27 4月, 2010 1 次提交
  27. 19 4月, 2010 1 次提交
    • B
      HID: add HID_QUIRK_HIDDEV_FORCE and HID_QUIRK_NO_IGNORE · b5e5a37e
      Bastien Nocera 提交于
      Add two quirks to make it possible for usbhid module options to
      override whether a device is ignored (HID_QUIRK_NO_IGNORE) and
      whether to connect a hiddev device (HID_QUIRK_HIDDEV_FORCE).
      
      Passing HID_QUIRK_NO_IGNORE for your device means that it will
      not be ignored by the HID layer, even if present in a blacklist.
      
      HID_QUIRK_HIDDEV_FORCE will force the creation of a hiddev for that
      device, making it accessible from user-space.
      
      Tested with an Apple IR Receiver, switching it from using appleir
      to using lirc's macmini driver.
      Signed-off-by: NBastien Nocera <hadess@hadess.net>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      b5e5a37e
  28. 10 2月, 2010 1 次提交
  29. 03 2月, 2010 1 次提交
    • J
      HID: make raw reports possible for both feature and output reports · d4bfa033
      Jiri Kosina 提交于
      In commit 2da31939 ("Bluetooth: Implement raw output support for HIDP
      layer"), support for Bluetooth hid_output_raw_report was added, but it
      pushes the data to the intr socket instead of the ctrl one. This has been
      fixed by 6bf8268f ("Bluetooth: Use the control channel for raw HID reports")
      
      Still, it is necessary to distinguish whether the report in question should be
      either FEATURE or OUTPUT. For this, we have to extend the generic HID API,
      so that hid_output_raw_report() callback provides means to specify this
      value so that it can be passed down to lower level hardware drivers (currently
      Bluetooth and USB).
      
      Based on original patch by Bastien Nocera <hadess@hadess.net>
      Acked-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      d4bfa033