1. 18 Oct, 2017 37 commits
  2. 15 Oct, 2017 1 commit
    • Greg Kroah-Hartman's avatar
      Merge tag 'iio-for-4.15b' of... · c9a934b0
      Greg Kroah-Hartman authored
      Merge tag 'iio-for-4.15b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
      
      Jonathan writes:
      
      Second set of IIO new device support, features and cleanup for 4.15
      
      New device support
      * cros_ec_accel_legacy
        - New driver for this older chromebook accelerometer.
      * ds4422 dac driver
        - New driver and bindings for the Maxim ds4422 and ds4424 I2C DACs.
      * kxcjk1013
        - Support the KXTF9 accelerometers.
      * mcp320x
        - support mcp3550, mcp3551, mcp3553 21 bit ADCs.
      * rfd77402
        - new driver for this laser range finder.
      * st-sensors-accel
        - add support for the LIS2DW12 accelerometer with bindings
        - add support for the LIS3DHH accelerometer with bindings
      
      New features
      * core
        - Drop a duplicate forward declaration in iio.h
      * Docs
        - add a clarification of the meaning of IIO_DISTANCE to reflect
          existing use in various range finding devices.
      * st-sensors
        - add a register mask for the status register to correctly support
          2 channel devices.
        - decouple the irq1 and irq2 configuration parameters.
        - do not always write the enable_axis register as some newer devices
          are always on and don't support such configuration.
        - split open-drain control for irq1 and irq2
        - make sampling frequency control optional as non all hardware
          supports it.
      * st-sensors-gyro
        - support 3 wire SPI mode
      * st-sensors-magn
        - support 3 wire SPI mode
      * st-sensors-pressure
        - support 3 wire SPI mode.
      
      Cleanups and fixes
      * ad7192
        - expand the buffer lock to cover device state protection rather than
          using core mlock to provide the state protection.
      * ade7753
        - expand the buffer lock to cover device state protection as well
          rather than having an additional lock.
      * dummy-evgen
        - Use the new irq_sim infrastructure rather than having our
          own local version of the same thing.
      * hid-sensor-trigger
        - avoid touching sensors ever if user hasn't requested it.  This
          is a work around for one reported issue where turning a sensor
          off wasn't sufficient to make it actually switch off.  As we
          have only one report from what looks like buggy hardware we
          are sending this upstream the slow way.
      * ina2xx
        - Adhere to the published ABI docs and use Ohms instead of
          microohms.  We don't think that anyone will notice this ABI fix
          but are sending it the slow route to reduce fallout if someone
          does!
      * kxcjk1013 - refactors to support the KXTF9 being added.
        - Refactor ODR support.
        - Fix INT_CTRL/INT_SRC1 bit names to match the register name.
        - Extract code for reporting motion events as this isn't present
          on some parts to be supported.
        - Make the sysfs sampling_frequency_available stuff not a fixed
          string so as to allow for it to be chip type dependent.
        - Make the sampling frequency_available per type to match
          the sampling_frequency attributes.
      * lsm6dsx - rework prior to new device support.
        - express the max fifo depth in 'scans' rather than bytes.
        - split control of the fifo mode fifo output data rate.
        - move decimator registers into the sensor_settings structure
          as this will make it easier to support devices that don't have
          this function.
        - add a fifo ops datastructure to allow for inter-part variations.
      * max30100
        - fix i2c chip address in dt example
      * max30102
        - use correct binding name for max30102 in example
      * mma8452
        - Rename read/write event value callbacks to be more generic
          reflecting what they actually do now.
      * rcar-gyroadc
        - pointer case to fix warnings when moving to 64 bit as this IP is
          present on new 64 bit SOCs
        - enable compile-testing to improve build coverage on this driver.
        - use the of_device_get_match_data helper instead of open coding
      * sun4i-gpadc-iio
        - Register in the thermal framework after pm. Otherwise the IP is not
          enabled.
        - Don't fail probing if no thermal DT node is present.
      * tsl2x7x
        - renaming tsl2x7x_settings to settings to avoid excessive line
          lengths.
        - Use IIO core to generate the integration_time sysfs attributes
          rather than hand rolling.
      * vf6180
        - Move the range check on integration time to the setter function.
        - Refactor the code around integration time to be clearer including
          caching current integration time avoiding unnecessary chip reads.
        - cleanup the als_gain lookup avoiding reading registers on chip.
        - use rounded matching rather than precise values for als_gain
          lookup.
        - Correct the ALS  scale when non-default gain or integration time
          is used.
      c9a934b0
  3. 14 Oct, 2017 2 commits
    • Gwendal Grignou's avatar
      platform/chrome: Add cros_ec_accel_legacy driver · 11b86c70
      Gwendal Grignou authored
      Add driver to support older EC firmware that only support deprecated
      ec command. Rely on ACPI memory map register to access sensor
      information.
      Present same interface as the regular cros_ec sensor stack:
      - one iio device per accelerometer
      - use HTML5 axis definition
      - use iio abi units
      - accept calibration calls, but do nothing
      Chrome can use the same code than regular cros_ec sensor stack to
      calculate orientation and lid angle.
      Signed-off-by: default avatarGwendal Grignou <gwendal@chromium.org>
      Signed-off-by: default avatarThierry Escande <thierry.escande@collabora.com>
      Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
      11b86c70
    • Srinivas Pandruvada's avatar
      iio: hid-sensor-trigger: Don't touch sensors unless user space requests · ad7532ce
      Srinivas Pandruvada authored
      One of the user complained that on his system Thinkpad Yoga S1, with
      commit f1664eaa ("iio: hid-sensor-trigger: Fix the race with user
      space powering up sensors") causes the system to resume immediately
      on suspend (S3 operation). On this system the sensor hub is on USB
      and is a wake up device from S3. So if any sensor sends data on
      motion, the system will wake up. This can be a legitimate use case
      to wake up device motion, but that needs proper user space support
      to set right thresholds.
      
      In fact the above commit didn't cause this regression, but any operation
      which cause sensors to wake up would have caused the same issue. So if
      user reads the raw sensor data, same issue occurs, with or without this
      commit. Only difference is that the above commit by default will trigger
      a power up and power down of sensors as part of runtime pm enable
      (runtime enable will cause a runtime resume callback followed by
      runtime_suspend callback). Previously user has to do some action on
      sensors.
      
      On investigation it was observed that the current driver correctly
      changing the state of all sensors to power off but then also some sensor
      will still send some data. Only option is to never power up any sensor.
      
      Only good option is to:
      - Using sysfs interface disable USB as a wakeup device (This will not
      need any driver change)
      
      Since some user don't care about sensors. So for those users this change
      brings back old functionality. As long as they don't cause any operation
      to power up sensors (like raw read or start iio-sensor-proxy service),
      the sensors will not be to touched. This is done by delaying run time
      enable till user space does some operation with sensors.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=196853Signed-off-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
      ad7532ce