diff options
author | Tomasz Duszynski <tduszyns@gmail.com> | 2015-06-23 20:45:48 +0200 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2015-07-05 14:34:00 +0100 |
commit | 9690d81a02dc4eea78de1686c3bf23a8dd4c0f28 (patch) | |
tree | d4c0d6c0703927b9d0f4bf2d228833c676e25102 /drivers/iio/pressure/ms5611.h | |
parent | 7cb46c2a0666547493132327ccfc0698d90e52f7 (diff) |
iio: pressure: ms5611: add support for MS5607 temperature and pressure sensor
MS5607 is temperature and pressure sensor which hardware is similar to MS5611.
Both sensors share command protocol and support both I2C and SPI serial
protocols. They only differ in compensation algorithms.
Signed-off-by: Tomasz Duszynski <tduszyns@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/pressure/ms5611.h')
-rw-r--r-- | drivers/iio/pressure/ms5611.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/iio/pressure/ms5611.h b/drivers/iio/pressure/ms5611.h index 099c6cdea43f..23b93c797dba 100644 --- a/drivers/iio/pressure/ms5611.h +++ b/drivers/iio/pressure/ms5611.h @@ -27,6 +27,18 @@ #define MS5611_PROM_WORDS_NB 8 +enum { + MS5611, + MS5607, +}; + +struct ms5611_chip_info { + u16 prom[MS5611_PROM_WORDS_NB]; + + int (*temp_and_pressure_compensate)(struct ms5611_chip_info *chip_info, + s32 *temp, s32 *pressure); +}; + struct ms5611_state { void *client; struct mutex lock; @@ -36,9 +48,9 @@ struct ms5611_state { int (*read_adc_temp_and_pressure)(struct device *dev, s32 *temp, s32 *pressure); - u16 prom[MS5611_PROM_WORDS_NB]; + struct ms5611_chip_info *chip_info; }; -int ms5611_probe(struct iio_dev *indio_dev, struct device *dev); +int ms5611_probe(struct iio_dev *indio_dev, struct device *dev, int type); #endif /* _MS5611_H */ |