1. 04 9月, 2015 1 次提交
    • F
      HID: sensor-hub: Fixup for Lenovo ThinkPad Helix 2 sensor hub report · 9fe8ecca
      Fernando D S Lima 提交于
      There is an error in the report descriptor of the Thinkpad Helix 2 where
      logical minimum value (557376) is greater than logical maximum (491200)
      for all of the magnetic flux axis data fields. This error results in a
      report descriptor parsing failure that causes the sensors attached to the
      hub not to be detected.
      
      dmesg excerpt:
      [   19.866905] drivers/hid/hid-core.c: logical range invalid 0x88140 0x77ec0
      [   19.866914] hid-sensor-hub 0018:2047:0855.0007: item 0 1 0 8 parsing failed
      [   19.866926] hid-sensor-hub 0018:2047:0855.0007: parse failed
      [   19.866933] hid-sensor-hub: probe of 0018:2047:0855.0007 failed with error -22
      
      Add a report fixup to change magnetic flux logical minimums to -557376
      for the parsing to succeed and the sensors to get detected.
      After applying the fix the sensors get detected, with corresponding drivers
      (hid-accel-3d,hid-gyro-3d,etc) loaded, and its possible to read their values.
      Signed-off-by: NFernando D S Lima <fernandodsl@gmail.com>
      Reviewed-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      9fe8ecca
  2. 08 7月, 2015 1 次提交
  3. 12 5月, 2015 1 次提交
    • S
      HID: hid-sensor-hub: Fix debug lock warning · 2d94e522
      Srinivas Pandruvada 提交于
      When CONFIG_DEBUG_LOCK_ALLOC is defined, mutex magic is compared and
      warned for (l->magic != l), here l is the address of mutex pointer.
      In hid-sensor-hub as part of hsdev creation, a per hsdev mutex is
      initialized during MFD cell creation. This hsdev, which contains, mutex
      is part of platform data for the a cell. But platform_data is copied
      in platform_device_add_data() in platform.c. This copy will copy the
      whole hsdev structure including mutex. But once copied the magic
      will no longer match. So when client driver call
      sensor_hub_input_attr_get_raw_value, this will trigger mutex warning.
      So to avoid this allocate mutex dynamically. This will be same even
      after copy.
      Signed-off-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      2d94e522
  4. 16 3月, 2015 2 次提交
  5. 23 2月, 2015 5 次提交
  6. 17 2月, 2015 1 次提交
  7. 26 11月, 2014 1 次提交
  8. 04 9月, 2014 1 次提交
  9. 15 8月, 2014 1 次提交
  10. 12 8月, 2014 1 次提交
  11. 30 6月, 2014 1 次提交
    • J
      HID: sensor-hub: fix potential memory leak · ceec6340
      Jiri Slaby 提交于
      hsdev is not freed in sensor_hub_probe when kasprintf inside the for
      loop fails. This is because hsdev is not set to platform_data yet (to
      be freed by the code in the err_no_mem label). So free the memory
      explicitly in the 'if' branch, as this is the only place where this is
      (and will) be needed.
      
      Reported-by: coverity
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: srinivas pandruvada <srinivas.pandruvada@intel.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      ceec6340
  12. 10 6月, 2014 1 次提交
  13. 02 6月, 2014 1 次提交
  14. 28 5月, 2014 1 次提交
  15. 06 5月, 2014 1 次提交
  16. 04 4月, 2014 1 次提交
  17. 25 3月, 2014 1 次提交
    • S
      HID: hid-sensor-hub: fix sleeping function called from invalid context · f74346a0
      Srinivas Pandruvada 提交于
      Fix issue with the sleeping calling hid_hw_request under spinlock.
      When i2c is used as HID transport, this is calling kmalloc, which
      can sleep. So remove call to this function while under spinlock.
       [ 1067.021961] Call Trace:
       [ 1067.021970]  [<ffffffff8192f5f2>] dump_stack+0x4d/0x6f
       [ 1067.021976]  [<ffffffff811109f2>] __might_sleep+0xd2/0xf0
       [ 1067.021981]  [<ffffffff811ea15b>] __kmalloc+0xeb/0x200
       [ 1067.021989]  [<ffffffff816e0cb3>] ? hid_alloc_report_buf+0x23/0x30
       [ 1067.021993]  [<ffffffff816e0cb3>] hid_alloc_report_buf+0x23/0x30
       [ 1067.021997]  [<ffffffff816f4cb7>] i2c_hid_request+0x57/0x110
       [ 1067.022006]  [<ffffffffa02bc61c>] sensor_hub_input_attr_get_raw_value+0xbc/0x100 [hid_sensor_hub]
      Signed-off-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      f74346a0
  18. 18 2月, 2014 1 次提交
    • S
      HID: hid-sensor-hub: Processing for duplicate physical ids · ca2ed12f
      Srinivas Pandruvada 提交于
      In HID sensor hub, HID physical ids are used to represent different sensors.
      For example physical id of 0x73 in usage page = 0x20, represents an
      accelerometer. The HID sensor hub driver uses this physical ids to create
      platform devices using MFD. There is 1:1 correspondence between an phy id and a
      client driver.
      
      But in some cases these physical ids are reused. There is a phy id 0xe1, which
      specifies a custom sensor, which can exist multiple times to represent various
      custom sensors. In this case there can be multiple instances of client MFD
      drivers, processing specific custom sensor. In this case when client driver
      looks for report id or a field index, it should still get the report id
      specific to its own type. This is also true for reports, they should be
      directed towards correct instance.  This change introduce a way to parse and
      tie physical devices to their correct instance.
      
      Summary of changes:
      - To get physical ids, use collections. If a collection of type=physical
        exist then use usage id as in the name of platform device name
      - As part of the platform data, we assign a hdsev instance, which has
        start and end of collection indexes. Using these indexes attributes
        can be tied to correct MFD client instances
      - When a report is received, call callback with correct hsdev instance.
        In this way using its private data stored as part of its registry, it
        can distinguish different sensors even when they have same physical and
        logical ids.
      
        This patch is co-authored with Archana Patni <archna.patni@intel.com>.
      Reported-by: NArchana Patni <archana.patni@intel.com>
      Signed-off-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: NArchana Patni <archana.patni@intel.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      ca2ed12f
  19. 17 2月, 2014 2 次提交
  20. 17 1月, 2014 1 次提交
    • S
      HID: hid-sensor-hub: Fix buggy report descriptors · 875e36f8
      Srinivas Pandruvada 提交于
      This addresses regression caused by commit id "751d17e2"
       iio: hid-sensors: Fix power and report state.
      This commit removed a quirk, to change the enumeration base
      to 1 from 0 based on an CONFIG paramter. There was objection to
      add more changes under this quirk, instead suggested to add an
      HID quirk. But there is no easy way to add HID qurik as the
      reports are not properly using collection class.
      
      The solution was to use logical minimum, which is a correct way.
      There were changes done in firmware to address this.
      
      Unfortunately some devices, still use old FW and can't be upgraded
      to newer version on Linux devices as there is no FW upgrade tool
      available for Linux devices. So we need to fix report descriptors,
      for such devices. This will not have any impact, if the FW uses
      logical 1 as minimum.
      
      In this patch we look for usage id for "power and report state", and
      modify logical minimum value to 1.
      
      Background on enum:
      In the original HID sensor hub firmwares all Named array enums were
      to 0-based. But the most recent hub implemented as 1-based,
      because of the implementation by one of the major OS vendor.
      Using logical minimum for the field as the base of enum. So we add
      logical minimum to the selector values before setting those fields.
      Some sensor hub FWs already changed logical minimum from 0 to 1
      to reflect this and hope every other vendor will follow.
      There is no easy way to add a common HID quirk for NAry elements,
      even if the standard specifies these field as NAry, the collection
      used to describe selectors is still just "logical".
      Signed-off-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      875e36f8
  21. 09 12月, 2013 1 次提交
    • S
      HID: hid-sensor-hub: fix duplicate sysfs entry error · d81cae80
      Srinivas Pandruvada 提交于
      Fix kernel warning and failure to register sensor hub devices with MFD.  Now
      many devices has in-built sensor hubs. So by default this HID hub, is properly
      parsed and register individual sensors as platform device using MFD framework.
      But if a second sensor hub is attached via USB, which has same sensors, it will
      result in kernel warning and failure to register MFD cell as the platform
      device sysfs file name will be same as created by in-built sensor hubs. This
      patch sets MFD cell id to PLATFORM_DEVID_AUTO. In this way there will never be
      duplicate sysfs file names.
      Signed-off-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      d81cae80
  22. 03 12月, 2013 1 次提交
  23. 30 10月, 2013 1 次提交
    • S
      HID: hid-sensor-hub: fix report size · d4b1bba7
      Srinivas Pandruvada 提交于
      Most of the hid sensor field size is reported in report_size field
      in the report descriptor. For rotation fusion sensor the quaternion
      data is 16 byte field, the report size was set to 4 and report
      count field is set to 4. So the total size is 16 bytes. But the current
      driver has a bug and not taking account for report count field. This
      causes user space to see only 4 bytes of data sent via IIO interface.
      The number of bytes in a field needs to take account of report_count
      field. Need to multiply report_size and report_count to get total
      number of bytes.
      Signed-off-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      d4b1bba7
  24. 01 10月, 2013 1 次提交
  25. 04 9月, 2013 4 次提交
  26. 26 8月, 2013 1 次提交
  27. 25 2月, 2013 2 次提交
  28. 18 2月, 2013 2 次提交
  29. 03 1月, 2013 1 次提交