Commit Graph

8 Commits

Author SHA1 Message Date
kbuild test robot 2535cc7ae0 iio: chemical: vz89x: fix boolreturn.cocci warnings
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 <mranostay@gmail.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-09-03 17:49:53 +01:00
Matt Ranostay 9d1894cd19 iio: chemical: vz89x: prevent corrupted buffer from being read
Signed-off-by: Matt Ranostay <mranostay@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-08-29 18:00:46 +01:00
Matt Ranostay 0a735aa07f iio: chemical: vz89x: add support for VZ89TE part
Add support the VZ89TE variant which removes the voc_short channel,
and has CRC check for data transactions.

Signed-off-by: Matt Ranostay <mranostay@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-08-29 18:00:06 +01:00
Matt Ranostay 8376882f16 iio: chemical: vz89x: abstract chip configuration
Abstract chip configuration data to allow supporting multiple variants
of the VZ89 chemical sensor line.

Signed-off-by: Matt Ranostay <mranostay@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-08-29 17:46:52 +01:00
Matt Ranostay f8d9d3b434 iio: convert to common i2c_check_functionality() return value
Previously most drivers that used a i2c_check_functionality() check
condition required various error codes on failure. This patchset
converts to a standard of -EOPNOTSUPP

Signed-off-by: Matt Ranostay <mranostay@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-02-27 17:17:43 +00:00
Matt Ranostay 93e87d73cc iio: chemical: vz89x: rework i2c transfer reading
Add an optimized i2c transfer reading function, and fallback
to racey smbus transfers if client->adapter doesn't support this.

Signed-off-by: Matt Ranostay <mranostay@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-12-03 18:31:12 +00:00
Matt Ranostay bf23cee62d iio: chemical: vz89x hardware i2c workaround
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 <mranostay@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-09-30 18:20:53 +01:00
Matt Ranostay cd8d97774f iio: chemical: add SGX VZ89x VOC sensor support
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 <mranostay@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-09-23 20:23:26 +01:00