1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * STMicroelectronics pressures driver
4 *
5 * Copyright 2013 STMicroelectronics Inc.
6 *
7 * Denis Ciocca <denis.ciocca@st.com>
8 * v. 1.0.0
9 */
10
11 #ifndef ST_PRESS_H
12 #define ST_PRESS_H
13
14 #include <linux/types.h>
15 #include <linux/iio/common/st_sensors.h>
16
17 enum st_press_type {
18 LPS001WP,
19 LPS25H,
20 LPS331AP,
21 LPS22HB,
22 LPS33HW,
23 LPS35HW,
24 LPS22HH,
25 ST_PRESS_MAX,
26 };
27
28 #define LPS001WP_PRESS_DEV_NAME "lps001wp"
29 #define LPS25H_PRESS_DEV_NAME "lps25h"
30 #define LPS331AP_PRESS_DEV_NAME "lps331ap"
31 #define LPS22HB_PRESS_DEV_NAME "lps22hb"
32 #define LPS33HW_PRESS_DEV_NAME "lps33hw"
33 #define LPS35HW_PRESS_DEV_NAME "lps35hw"
34 #define LPS22HH_PRESS_DEV_NAME "lps22hh"
35
36 /**
37 * struct st_sensors_platform_data - default press platform data
38 * @drdy_int_pin: default press DRDY is available on INT1 pin.
39 */
40 static __maybe_unused const struct st_sensors_platform_data default_press_pdata = {
41 .drdy_int_pin = 1,
42 };
43
44 const struct st_sensor_settings *st_press_get_settings(const char *name);
45 int st_press_common_probe(struct iio_dev *indio_dev);
46 void st_press_common_remove(struct iio_dev *indio_dev);
47
48 #ifdef CONFIG_IIO_BUFFER
49 int st_press_allocate_ring(struct iio_dev *indio_dev);
50 void st_press_deallocate_ring(struct iio_dev *indio_dev);
51 int st_press_trig_set_state(struct iio_trigger *trig, bool state);
52 #define ST_PRESS_TRIGGER_SET_STATE (&st_press_trig_set_state)
53 #else /* CONFIG_IIO_BUFFER */
st_press_allocate_ring(struct iio_dev * indio_dev)54 static inline int st_press_allocate_ring(struct iio_dev *indio_dev)
55 {
56 return 0;
57 }
58
st_press_deallocate_ring(struct iio_dev * indio_dev)59 static inline void st_press_deallocate_ring(struct iio_dev *indio_dev)
60 {
61 }
62 #define ST_PRESS_TRIGGER_SET_STATE NULL
63 #endif /* CONFIG_IIO_BUFFER */
64
65 #endif /* ST_PRESS_H */
66