1. 30 Dec, 2016 8 commits
    • Linus Walleij's avatar
      iio: light: add driver for Capella CM3605 · 8afa505c
      Linus Walleij authored
      This adds a driver for the Capella Microsystems CM3605 Ambient
      Light Sensor and proximity sensor. This is a pretty simple entirely
      analog device that is interfaced with the target system using
      the POUT (proximity out) and AOUT (ambient light out) signals.
      
      The POUT signal is a simple high/low signal that indicates whether
      an object is in proximity, most typically used to detect a face
      in front of a mobile device. The signal requires that an infrared
      LED is mounted next to the device, making IR light reflect off
      the object in proximity and triggering the POUT signal. We grab
      a GPIO pin to handle the POUT signal as an interrupt line and
      register this as an event channel for the sensor.
      
      Since the proximity sensor requires an IR LED, we add a LED trigger
      named "cm3605" so that the infrared LED can just associate with
      this trigger to be sure it is always on when the proximity sensor
      needs it.
      
      The AOUT is an analog voltage between 0 and 1550 mV that indicate
      the LUX value in the ambient light: this is orthogonal to the
      proximity sensor functionality. Since this analog voltage needs
      to be converted into a digital value, the driver grabs an IIO
      channel named "aout" associated with the device.
      
      This patch created a combined ALS and proximity sensor driver.
      The former supports raw reads of the LUX value and the latter
      will generate proximity events.
      
      To integrate this properly with Linux we also add a supply
      regulator for the VDD pin (driving both functions) and add device
      tree bindings to define the RSET resistor that in turn configures
      the luminosity range of the ALS sensor.
      
      Since the sensor needs to be on more or less constantly, we
      restrict the power management to system suspend/resume: we
      disable the IR LED and disable the regulator for VDD on suspend
      and take them back up on resume.
      
      Tests:
      cd /sys/bus/iio/devices/iio:device1
      cat in_illuminance_raw
      304
      (hold hand over sensor)
      cat in_illuminance_raw
      17
      iio_event_monitor cm3605
      Found IIO device with name cm3605 with device number 1
      (hold hand over sensor)
      Event: time: 2444842301447, type: proximity, channel: 0,
        evtype: thresh, direction: falling
      (remove hand over sensor)
      Event: time: 2445583440706, type: proximity, channel: 0,
        evtype: thresh, direction: rising
      
      Cc: Capella Microsystems <capellamicro@gmail.com>
      Cc: Kevin Tsai <ktsai@capellamicro.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      8afa505c
    • Linus Walleij's avatar
      iio: light: add DT bindings for Capella CM3605 · 170df593
      Linus Walleij authored
      This adds device tree bindings for the Capella Microsystems CM3605
      ambient light sensor and short range proximity sensor.
      
      Cc: devicetree@vger.kernel.org
      Cc: Capella Microsystems <capellamicro@gmail.com>
      Cc: Kevin Tsai <ktsai@capellamicro.com>
      Acked-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      170df593
    • Kweh, Hock Leong's avatar
      iio: light: hid-sensor-als: Add duplicate IIO_LIGHT channel · 578f8d77
      Kweh, Hock Leong authored
      There is one light sensor type defined in the sensor hub specification,
      which has one Illuminance field. It doesn't distinguish between ambient
      light sensor or color sensor. Currently it is presented as IIO_INTENSITY
      channel. There are some user spaces specifically looking for IIO_LIGHT
      channel.
      To satisfy such user spaces this change also add a duplicate IIO_LIGHT
      channel. The units of measurement of Illuminance field is Lux, so it is
      still compatible to IIO ABI.
      Signed-off-by: default avatarKweh, Hock Leong <hock.leong.kweh@intel.com>
      Signed-off-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      578f8d77
    • Marcin Niestroj's avatar
      iio: st_pressure: Export sampling frequency for lps25h and lps331ap · 7f0d8740
      Marcin Niestroj authored
      Both devices are using the same iio_chan_spec to define which settings
      are exported with sysfs. Both are properly configured to set/get
      sampling frequency for pressure and temperature. They also properly
      export available sampling frequencies. The only missing thing is
      sampling_frequency sysfs file, which allows to set/get this property
      from userspace.
      
      Add sampling frequency to iio channel info mask, so sampling_frequency
      file is properly exported using sysfs.
      Signed-off-by: default avatarMarcin Niestroj <m.niestroj@grinn-global.com>
      Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      7f0d8740
    • Marcin Niestroj's avatar
      iio: st_pressure: Fix data sign · 1b211d48
      Marcin Niestroj authored
      Datasheet of each device (lps331ap, lps25h, lps001wp, lps22hb) says that
      the pressure and temperature data is a 2's complement.
      
      I'm sending this the slow way, as negative pressures on these are pretty
      unusual and the nature of the fixing of multiple device introduction patches
      will make it hard to apply to older kernels - Jonathan.
      
      Fixes: 217494e5 ("iio:pressure: Add STMicroelectronics pressures driver")
      Fixes: 2f5effcb ("iio: pressure-core: st: Expand and rename LPS331AP's channel descriptor")
      Fixes: 7885a8ce ("iio: pressure: st: Add support for new LPS001WP pressure sensor")
      Fixes: e039e2f5 ("iio:st_pressure:initial lps22hb sensor support")
      Signed-off-by: default avatarMarcin Niestroj <m.niestroj@grinn-global.com>
      Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      1b211d48
    • Marcin Niestroj's avatar
      Documentation: DT: Add bmi160 imu binding · c7bff890
      Marcin Niestroj authored
      This adds documentation for Bosch BMI160 Inertial Measurement Unit
      device-tree bindings.
      Signed-off-by: default avatarMarcin Niestroj <m.niestroj@grinn-global.com>
      Acked-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      c7bff890
    • Marcin Niestroj's avatar
      iio: bmi160: Add of device table for spi · 75eadb8f
      Marcin Niestroj authored
      From now on we can add bmi160 device to device-tree by specifying
      compatible string.
      Signed-off-by: default avatarMarcin Niestroj <m.niestroj@grinn-global.com>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      75eadb8f
    • Marcin Niestroj's avatar
      iio: bmi160: Add of device table for i2c · 968bdbf8
      Marcin Niestroj authored
      From now on we can add bmi160 device to device-tree by specifying
      compatible string.
      Signed-off-by: default avatarMarcin Niestroj <m.niestroj@grinn-global.com>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      968bdbf8
  2. 10 Dec, 2016 3 commits
  3. 04 Dec, 2016 5 commits
  4. 03 Dec, 2016 11 commits
  5. 01 Dec, 2016 13 commits