irqchip/atmel-aic: Remove duplicate bit operation
[linux-2.6/btrfs-unstable.git] / drivers / iio / pressure / ms5611.h
blob23b93c797dba7009cafacdb07b5c895652d834e0
1 /*
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.
12 #ifndef _MS5611_H
13 #define _MS5611_H
15 #include <linux/device.h>
16 #include <linux/iio/iio.h>
17 #include <linux/mutex.h>
19 #define MS5611_RESET 0x1e
20 #define MS5611_READ_ADC 0x00
21 #define MS5611_READ_PROM_WORD 0xA0
22 #define MS5611_START_TEMP_CONV 0x58
23 #define MS5611_START_PRESSURE_CONV 0x48
25 #define MS5611_CONV_TIME_MIN 9040
26 #define MS5611_CONV_TIME_MAX 10000
28 #define MS5611_PROM_WORDS_NB 8
30 enum {
31 MS5611,
32 MS5607,
35 struct ms5611_chip_info {
36 u16 prom[MS5611_PROM_WORDS_NB];
38 int (*temp_and_pressure_compensate)(struct ms5611_chip_info *chip_info,
39 s32 *temp, s32 *pressure);
42 struct ms5611_state {
43 void *client;
44 struct mutex lock;
46 int (*reset)(struct device *dev);
47 int (*read_prom_word)(struct device *dev, int index, u16 *word);
48 int (*read_adc_temp_and_pressure)(struct device *dev,
49 s32 *temp, s32 *pressure);
51 struct ms5611_chip_info *chip_info;
54 int ms5611_probe(struct iio_dev *indio_dev, struct device *dev, int type);
56 #endif /* _MS5611_H */