treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / drivers / iio / humidity / hts221.h
blob7d6771f7cf473663b7607a0fc886fa2b4822d802
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * STMicroelectronics hts221 sensor driver
5 * Copyright 2016 STMicroelectronics Inc.
7 * Lorenzo Bianconi <lorenzo.bianconi@st.com>
8 */
10 #ifndef HTS221_H
11 #define HTS221_H
13 #define HTS221_DEV_NAME "hts221"
15 #include <linux/iio/iio.h>
17 #define HTS221_DATA_SIZE 2
19 enum hts221_sensor_type {
20 HTS221_SENSOR_H,
21 HTS221_SENSOR_T,
22 HTS221_SENSOR_MAX,
25 struct hts221_sensor {
26 u8 cur_avg_idx;
27 int slope, b_gen;
30 struct hts221_hw {
31 const char *name;
32 struct device *dev;
33 struct regmap *regmap;
35 struct iio_trigger *trig;
36 int irq;
38 struct hts221_sensor sensors[HTS221_SENSOR_MAX];
40 bool enabled;
41 u8 odr;
44 extern const struct dev_pm_ops hts221_pm_ops;
46 int hts221_probe(struct device *dev, int irq, const char *name,
47 struct regmap *regmap);
48 int hts221_set_enable(struct hts221_hw *hw, bool enable);
49 int hts221_allocate_buffers(struct hts221_hw *hw);
50 int hts221_allocate_trigger(struct hts221_hw *hw);
52 #endif /* HTS221_H */