iio: pressure: Add driver for Honeywell ABP family
authorMarcin Malagowski <mrc@bourne.st>
Mon, 26 Sep 2016 17:23:06 +0000 (19:23 +0200)
committerJonathan Cameron <jic23@kernel.org>
Sat, 1 Oct 2016 14:14:37 +0000 (15:14 +0100)
commit9ecca12edde435efc6d08f7a1e877ba9929a6c93
treefd4c62a7f6e25d9d68234f4b343a361f373f2c9e
parent00053566385e3e7a2f81f0fd2fa09bccce1589f2
iio: pressure: Add driver for Honeywell ABP family

This patch adds minimal driver for the Honeywell Amplified Basic
Pressure sensors series. Sensors are pretty simple but are
available in many variants:
- psi/mbar/kPa output,
- analog/i2c/spi,
- gage/differential measurement,
- different measure ranges etc.

Refer to datasheets for more details:
http://sensing.honeywell.com/honeywell-sensing-basic-board-mount-pressure-sensors-abp-series-datasheet-323005128-c-en.pdf
http://sensing.honeywell.com/index.php%3Fci_id%3D45841

Driver internals:
- i2c only. measure request is done by the SMBUS QUICK cmd, so if the i2c
  bus doesn't support it, it is required to send a dummy byte to trigger
  measurement,
- since iio sysfs expects kilopascals, mbar-variants are treated as their
  respective kPa-s, hence i2c id-table has doubled entries in one line:
{ "abp060mg", ABP006KG }, { "abp006kg", ABP006KG },
- psi-variants have prescaled values in config,
- no temperature reads yet.

Work remained:
- optional temperature channel,
- SPI support,
- DT binding.

Changes since v1:
- mutex is now locked in read_raw(),
- corrected error codes,
- fixed coding style issues,
- renamed few defines and functions abp -> abp060mg
(some structs left as they were to keep the sensible meaning).

Signed-off-by: Marcin Malagowski <mrc@bourne.st>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/pressure/Kconfig
drivers/iio/pressure/Makefile
drivers/iio/pressure/abp060mg.c [new file with mode: 0644]