Re: [RFC v2 4/4] iio: chemical: add SGX VZ89x VOC sensor support

2015-09-07 Thread Lars-Peter Clausen
On 09/07/2015 06:27 AM, Matt Ranostay wrote: > Thinking this over do we needed a IIO_CHAN_INFO_PROCESSED_OFFSET to > signal that it needs to be after the (value - offset) * scale > calculation? Well, value * scale + offset = (value + offset/scale) * scale. So just scale your offset inversely to

Re: [RFC v2 4/4] iio: chemical: add SGX VZ89x VOC sensor support

2015-09-07 Thread Lars-Peter Clausen
On 09/07/2015 06:27 AM, Matt Ranostay wrote: > Thinking this over do we needed a IIO_CHAN_INFO_PROCESSED_OFFSET to > signal that it needs to be after the (value - offset) * scale > calculation? Well, value * scale + offset = (value + offset/scale) * scale. So just scale your offset inversely to

Re: [RFC v2 4/4] iio: chemical: add SGX VZ89x VOC sensor support

2015-09-06 Thread Matt Ranostay
Thinking this over do we needed a IIO_CHAN_INFO_PROCESSED_OFFSET to signal that it needs to be after the (value - offset) * scale calculation? Thanks, Matt On Sun, Sep 6, 2015 at 9:20 PM, Matt Ranostay wrote: > Also one thing to note here is calculation is ((value - 13) * scale)) > + offset

Re: [RFC v2 4/4] iio: chemical: add SGX VZ89x VOC sensor support

2015-09-06 Thread Matt Ranostay
Also one thing to note here is calculation is ((value - 13) * scale)) + offset versus the normal (value + offset) * scale.. Not sure the best way to handle this possibly could be.. Thanks, Matt On Sun, Sep 6, 2015 at 8:13 PM, George McCollister wrote: > > > On Sun, Sep 6, 2015 at 9:39 PM, Matt

[RFC v2 4/4] iio: chemical: add SGX VZ89x VOC sensor support

2015-09-06 Thread Matt Ranostay
Add support for VZ89X sensors VOC and CO2 reporting channels in percentage which can be converted to part per million. Signed-off-by: Matt Ranostay --- .../ABI/testing/sysfs-bus-iio-chemical-vz89x | 30 +++ .../devicetree/bindings/i2c/trivial-devices.txt| 1 + drivers/iio/Kconfig

[RFC v2 4/4] iio: chemical: add SGX VZ89x VOC sensor support

2015-09-06 Thread Matt Ranostay
Add support for VZ89X sensors VOC and CO2 reporting channels in percentage which can be converted to part per million. Signed-off-by: Matt Ranostay --- .../ABI/testing/sysfs-bus-iio-chemical-vz89x | 30 +++ .../devicetree/bindings/i2c/trivial-devices.txt| 1 +

Re: [RFC v2 4/4] iio: chemical: add SGX VZ89x VOC sensor support

2015-09-06 Thread Matt Ranostay
Also one thing to note here is calculation is ((value - 13) * scale)) + offset versus the normal (value + offset) * scale.. Not sure the best way to handle this possibly could be.. Thanks, Matt On Sun, Sep 6, 2015 at 8:13 PM, George McCollister wrote: > > > On

Re: [RFC v2 4/4] iio: chemical: add SGX VZ89x VOC sensor support

2015-09-06 Thread Matt Ranostay
Thinking this over do we needed a IIO_CHAN_INFO_PROCESSED_OFFSET to signal that it needs to be after the (value - offset) * scale calculation? Thanks, Matt On Sun, Sep 6, 2015 at 9:20 PM, Matt Ranostay wrote: > Also one thing to note here is calculation is ((value - 13) *