04 Feb, 2018

1 commit

  • commit 8f114acd4e1a9cfa05b70bcc4219bc88197b5c9b upstream.

    in_concentration_raw should report, according to sysfs-bus-iio documentation,
    a "Raw (unscaled no offset etc.) percentage reading of a substance."

    Modify scale to convert from ppm/ppb to percentage:
    1 ppm = 0.0001%
    1 ppb = 0.0000001%

    There is no offset needed to convert the ppm/ppb to percentage,
    so remove offset from IIO_CONCENTRATION (IIO_MOD_CO2) channel.

    Cc'd stable to reduce chance of userspace breakage in the long
    run as we fix this wrong bit of ABI usage.

    Signed-off-by: Narcisa Ana Maria Vasile
    Reviewed-by: Matt Ranostay
    Signed-off-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Narcisa Ana Maria Vasile
     

18 Aug, 2017

1 commit


23 Jul, 2017

1 commit

  • Add support for CCS811 VOC sensor. This patch adds support
    for reading current and voltage across the sensor and TVOC
    and equivalent CO2 values.

    Scale and offset values have been computed according to datasheet:
    - For current: raw value is in microamps
    => 0.001 scale to convert to milliamps
    - For voltage: 1.65V = 1023, therefore 1650mV = 1023
    => 1650.0/1023 = 1.612903 scale to convert to millivolts
    - For eCO2: raw value range is from 400ppm to 8192ppm.
    => (val - 400) * (100 - 0) / (8192 - 400) + 0 =
    (val - 400) * 0.01283367 => offset: -400, scale = 0.012834
    to get a percentage value
    -For TVOC: raw value range is from 0ppb to 1187ppb.
    => (val - 0) * 100 / (1187 - 0) + 0 = val * 0.0842459 =>
    scale = 0.084246 for getting a percentage value

    Cc: Daniel Baluta
    Cc: Alison Schofield
    Signed-off-by: Narcisa Ana Maria Vasile
    Signed-off-by: Jonathan Cameron

    Narcisa Ana Maria Vasile
     

31 Mar, 2017

1 commit

  • Replace a comma between expression statements by a semicolon. This
    changes the semantics of the code, but given the current indentation
    appears to be what is intended.
    A simplified version of the Coccinelle semantic patch that performs this
    transformation is as follows:

    //
    @r@
    expression e1,e2;
    @@

    e1
    -,
    +;
    e2;
    //

    Signed-off-by: Arushi Singhal
    Signed-off-by: Jonathan Cameron

    Arushi Singhal
     

24 Oct, 2016

1 commit

  • This will result in a random value being reported on big endian architectures.
    (thanks to Lars-Peter Clausen for pointing out the effects of this bug)

    Only effects a value printed to the log, but as this reports the settings of
    the probe in question it may be of direct interest to users.

    Also, fixes the following sparse endianness warnings:

    drivers/iio/chemical/atlas-ph-sensor.c:215:9: warning: cast to restricted __be16
    drivers/iio/chemical/atlas-ph-sensor.c:215:9: warning: cast to restricted __be16
    drivers/iio/chemical/atlas-ph-sensor.c:215:9: warning: cast to restricted __be16
    drivers/iio/chemical/atlas-ph-sensor.c:215:9: warning: cast to restricted __be16
    drivers/iio/chemical/atlas-ph-sensor.c:215:9: warning: cast to restricted __be16
    drivers/iio/chemical/atlas-ph-sensor.c:215:9: warning: cast to restricted __be16
    drivers/iio/chemical/atlas-ph-sensor.c:215:9: warning: cast to restricted __be16
    drivers/iio/chemical/atlas-ph-sensor.c:215:9: warning: cast to restricted __be16

    Signed-off-by: Sandhya Bankar
    Fixes: e8dd92bfbff25 ("iio: chemical: atlas-ph-sensor: add EC feature")
    Cc:
    Signed-off-by: Jonathan Cameron

    Sandhya Bankar
     

15 Sep, 2016

1 commit

  • …iio into staging-next

    Jonathan writes:

    Second set of iio new device support, features and cleanups for the 4.9 cycle.

    New device support
    * ad8801 dac
    - new driver supporting ad8801 and ad8803 DACs.
    * adc12138
    - new driver supporting TI adc12130/adc12132 and adc12138 ADCs.
    * ltc2485 adc
    - new driver
    * mxc6255
    - add support for the mxc6225 part name and fixup the ID check so it works.
    * vz89x VOC sensor
    - add support for the vz89te part which drops the voc_short channel and adds
    CRCs compared to other supported parts.

    New features
    * core
    - immutable triggers. These effectively grant exclusive control over a
    trigger. The typical usecase is a device representing an analog part
    (perhaps a MUX) that needs to control the sampling of a downstream
    ADC.
    - resource managed trigger registration and triggered_buffer_init.
    - iio_push_event now protected against case of the event interface
    registration not having yet occured. Only matters if an interrupt
    can occur during this window - might happen on shared interrupt lines.
    - helper to let a driver query if the trigger it is using is provided by
    itself (using the convention of both device and trigger having the same
    parent).
    * tools
    - iio-utils. Used channel modifier scaling in preference to generic scaling
    when both exist.
    * at91-adc
    - Add support for touchscreen switches closure time needed by some newer
    parts.
    * stx104
    - support the ADC channels on this ADC/DAC board. As these are the primary
    feature of the board also move the driver to the iio/adc directory.
    * sx9500
    - device tree bindings.

    Cleanups / Fixes
    * ad5755
    - fix an off-by-one on devnr limit check (introduced earlier this cycle)
    * ad7266
    - drop NULL check on devm_regulator_get_optional as it can't return NULL.
    * ak8974
    - avoid an unused functional warning due to rework in PM core code.
    - remove .owner field setting as done by i2c_core.
    * ina2xx
    - clear out a left over debug field from chip global data.
    * hid-sensors
    - avoid an unused functional warning due to rework in PM core code.
    * maxim-thermocouple
    - fix non static symbol warnings.
    * ms5611
    - fetch and enable regulators unconditionally when they aren't optional.
    * sca3000
    - whitespace cleanup.
    * st_sensors
    - fetch and enable regulators unconditionally rather than having them
    supported as optional regulators (missunderstanding on my part amongst
    others a while back)
    - followup to previous patch fixes error checking on the regulators.
    - mark symbols static where possible.
    - use the 'is it my trigger' help function. This prevents the odd case
    of another device triggering from the st-sensors trigger whilst the
    st-sensors trigger is itself not using it but rather using say an hrtimer.
    * ti-ads1015
    - add missing of_node_put.
    * vz89x
    - rework to all support of new devices.
    - prevent reading of a corrupted buffer.
    - fixup a return value of 0/1 in a bool returning function.

    Address updates
    - Vlad Dogaru email address change.

    Greg Kroah-Hartman
     

05 Sep, 2016

1 commit


04 Sep, 2016

1 commit

  • drivers/iio/chemical/vz89x.c:119:9-10: WARNING: return of 0/1 in function 'vz89x_measurement_is_valid' with return type bool

    Return statements in functions returning bool should use
    true/false instead of 1/0.
    Generated by: scripts/coccinelle/misc/boolreturn.cocci

    CC: Matt Ranostay
    Signed-off-by: Fengguang Wu
    Signed-off-by: Jonathan Cameron

    kbuild test robot
     

30 Aug, 2016

3 commits


21 Aug, 2016

4 commits


01 Jul, 2016

1 commit

  • Adds a new per-device sysfs attribute "current_timestamp_clock" to allow
    userspace to select a particular POSIX clock for buffered samples and
    events timestamping.

    Following clocks, as listed in clock_gettime(2), are supported:
    CLOCK_REALTIME, CLOCK_MONOTONIC, CLOCK_MONOTONIC_RAW,
    CLOCK_REALTIME_COARSE, CLOCK_MONOTONIC_COARSE, CLOCK_BOOTTIME and
    CLOCK_TAI.

    Signed-off-by: Gregor Boirie
    Acked-by: Sanchayan Maity
    Signed-off-by: Jonathan Cameron

    Gregor Boirie
     

30 May, 2016

2 commits


28 Feb, 2016

1 commit


25 Feb, 2016

1 commit


20 Feb, 2016

1 commit

  • switch from using REGCACHE_FLAT to REGCACHE_RBTREE so initial hw values
    are read from device. This also allows some volatile ranges to be
    dropped.

    Note that REGCACHE_FLAT is intended only for very low lag cases so doesn't
    do nice things like read initial values from the device. Hence this change.

    Signed-off-by: Matt Ranostay
    Signed-off-by: Jonathan Cameron

    Matt Ranostay
     

07 Feb, 2016

1 commit

  • The newly added atlas-ph-sensor driver uses irq_work_queue, which
    may not always be enabled:

    ERROR: "irq_work_queue" [drivers/iio/chemical/atlas-ph-sensor.ko] undefined!

    This adds a 'select' statement to Kconfig to ensure it's there
    when we need it.

    Signed-off-by: Arnd Bergmann
    Fixes: 27dec00ecf2d ("iio: chemical: add Atlas pH-SM sensor support")
    Reviewed-by: Matt Ranostay
    Signed-off-by: Jonathan Cameron

    Arnd Bergmann
     

31 Jan, 2016

1 commit


12 Dec, 2015

1 commit


04 Dec, 2015

1 commit


01 Oct, 2015

1 commit

  • Chipset sometime updates in the middle of a reading causing it
    to reset the data pointer, and causing invalid reading of previous data.

    We can check for this invalid state by reading MSB of the resistance
    reading that is always zero, and by also confirming the VOC_short isn't
    zero.

    Signed-off-by: Matt Ranostay
    Signed-off-by: Jonathan Cameron

    Matt Ranostay
     

24 Sep, 2015

1 commit