1 /* SPDX-License-Identifier: GPL-2.0 */
3 * MS5611 pressure and temperature sensor driver
5 * Copyright (c) Tomasz Duszynski <tduszyns@gmail.com>
12 #include <linux/device.h>
13 #include <linux/iio/iio.h>
14 #include <linux/mutex.h>
18 #define MS5611_RESET 0x1e
19 #define MS5611_READ_ADC 0x00
20 #define MS5611_READ_PROM_WORD 0xA0
21 #define MS5611_PROM_WORDS_NB 8
28 struct ms5611_chip_info
{
29 u16 prom
[MS5611_PROM_WORDS_NB
];
31 int (*temp_and_pressure_compensate
)(struct ms5611_chip_info
*chip_info
,
32 s32
*temp
, s32
*pressure
);
36 * OverSampling Rate descriptor.
37 * Warning: cmd MUST be kept aligned on a word boundary (see
38 * m5611_spi_read_adc_temp_and_pressure in ms5611_spi.c).
41 unsigned long conv_usec
;
50 const struct ms5611_osr
*pressure_osr
;
51 const struct ms5611_osr
*temp_osr
;
53 int (*reset
)(struct device
*dev
);
54 int (*read_prom_word
)(struct device
*dev
, int index
, u16
*word
);
55 int (*read_adc_temp_and_pressure
)(struct device
*dev
,
56 s32
*temp
, s32
*pressure
);
58 struct ms5611_chip_info
*chip_info
;
59 struct regulator
*vdd
;
62 int ms5611_probe(struct iio_dev
*indio_dev
, struct device
*dev
,
63 const char *name
, int type
);
64 int ms5611_remove(struct iio_dev
*indio_dev
);
66 #endif /* _MS5611_H */