2 * MS5611 pressure and temperature sensor driver
4 * Copyright (c) Tomasz Duszynski <tduszyns@gmail.com>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
15 #include <linux/device.h>
16 #include <linux/iio/iio.h>
17 #include <linux/mutex.h>
21 #define MS5611_RESET 0x1e
22 #define MS5611_READ_ADC 0x00
23 #define MS5611_READ_PROM_WORD 0xA0
24 #define MS5611_PROM_WORDS_NB 8
31 struct ms5611_chip_info
{
32 u16 prom
[MS5611_PROM_WORDS_NB
];
34 int (*temp_and_pressure_compensate
)(struct ms5611_chip_info
*chip_info
,
35 s32
*temp
, s32
*pressure
);
39 * OverSampling Rate descriptor.
40 * Warning: cmd MUST be kept aligned on a word boundary (see
41 * m5611_spi_read_adc_temp_and_pressure in ms5611_spi.c).
44 unsigned long conv_usec
;
53 const struct ms5611_osr
*pressure_osr
;
54 const struct ms5611_osr
*temp_osr
;
56 int (*reset
)(struct device
*dev
);
57 int (*read_prom_word
)(struct device
*dev
, int index
, u16
*word
);
58 int (*read_adc_temp_and_pressure
)(struct device
*dev
,
59 s32
*temp
, s32
*pressure
);
61 struct ms5611_chip_info
*chip_info
;
62 struct regulator
*vdd
;
65 int ms5611_probe(struct iio_dev
*indio_dev
, struct device
*dev
,
66 const char* name
, int type
);
67 int ms5611_remove(struct iio_dev
*indio_dev
);
69 #endif /* _MS5611_H */