1. 24 May, 2015 38 commits
  2. 23 May, 2015 2 commits
    • Tiberiu Breana's avatar
      iio: accel: Add support for Sensortek STK8BA50 · 884ca456
      Tiberiu Breana authored
      Minimal implementation of an IIO driver for the Sensortek
      STK8BA50 3-axis accelerometer. Datasheet:
      http://szgsensor.com/uploads/soft/141229/STK8BA50%D2%E5%BC%CE.pdf
      
      Includes:
      - ACPI support;
      - read_raw for x,y,z axes;
      - reading and setting the scale (range) parameter.
      - power management
      Signed-off-by: default avatarTiberiu Breana <tiberiu.a.breana@intel.com>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      884ca456
    • Lars-Peter Clausen's avatar
      iio: __iio_update_buffers: Leave device in sane state on error · 1250186a
      Lars-Peter Clausen authored
      Currently when something goes wrong at some step when disabling the buffers
      we immediately abort. This has the effect that the enable/disable calls are
      no longer balanced. So make sure that even if one step in the disable
      sequence fails the other steps are still executed.
      
      The other issue is that when either enable or disable fails buffers that
      were active at that time stay active while the device itself is disabled.
      This leaves things in a inconsistent state and can cause unbalanced
      enable/disable calls. Furthermore when enable fails we restore the old scan
      mask, but still keeps things disabled.
      
      Given that verification of the configuration was performed earlier and it
      is valid at the point where we try to enable/disable the most likely reason
      of failure is a communication failure with the device or maybe a
      out-of-memory situation. There is not really a good recovery strategy in
      such a case, so it makes sense to leave the device disabled, but we should
      still leave it in a consistent state.
      
      What the patch does if disable/enable fails is to deactivate all buffers
      and make sure that the device will be in the same state as if all buffers
      had been manually disabled.
      Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      1250186a