Denis CIOCCA | 217494e | 2013-06-03 15:58:00 +0100 | [diff] [blame] | 1 | /* |
| 2 | * STMicroelectronics pressures driver |
| 3 | * |
| 4 | * Copyright 2013 STMicroelectronics Inc. |
| 5 | * |
| 6 | * Denis Ciocca <denis.ciocca@st.com> |
| 7 | * v. 1.0.0 |
| 8 | * Licensed under the GPL-2. |
| 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 | |
Shrirang Bagul | 9d31772 | 2016-11-24 13:33:45 +0800 | [diff] [blame] | 17 | enum st_press_type { |
| 18 | LPS001WP, |
| 19 | LPS25H, |
| 20 | LPS331AP, |
| 21 | LPS22HB, |
Lorenzo Bianconi | b954d77 | 2017-09-02 19:39:14 +0200 | [diff] [blame] | 22 | LPS33HW, |
| 23 | LPS35HW, |
Shrirang Bagul | 9d31772 | 2016-11-24 13:33:45 +0800 | [diff] [blame] | 24 | ST_PRESS_MAX, |
| 25 | }; |
| 26 | |
Lee Jones | 7885a8c | 2013-09-16 17:02:00 +0100 | [diff] [blame] | 27 | #define LPS001WP_PRESS_DEV_NAME "lps001wp" |
Denis CIOCCA | 9318784 | 2014-02-20 17:49:00 +0000 | [diff] [blame] | 28 | #define LPS25H_PRESS_DEV_NAME "lps25h" |
Denis CIOCCA | 217494e | 2013-06-03 15:58:00 +0100 | [diff] [blame] | 29 | #define LPS331AP_PRESS_DEV_NAME "lps331ap" |
Gregor Boirie | e039e2f | 2016-04-19 11:18:32 +0200 | [diff] [blame] | 30 | #define LPS22HB_PRESS_DEV_NAME "lps22hb" |
Lorenzo Bianconi | b954d77 | 2017-09-02 19:39:14 +0200 | [diff] [blame] | 31 | #define LPS33HW_PRESS_DEV_NAME "lps33hw" |
| 32 | #define LPS35HW_PRESS_DEV_NAME "lps35hw" |
Denis CIOCCA | 217494e | 2013-06-03 15:58:00 +0100 | [diff] [blame] | 33 | |
Denis CIOCCA | 23cde4d | 2013-06-19 09:28:00 +0100 | [diff] [blame] | 34 | /** |
| 35 | * struct st_sensors_platform_data - default press platform data |
| 36 | * @drdy_int_pin: default press DRDY is available on INT1 pin. |
| 37 | */ |
| 38 | static const struct st_sensors_platform_data default_press_pdata = { |
| 39 | .drdy_int_pin = 1, |
| 40 | }; |
| 41 | |
Denis CIOCCA | 0baa3fc | 2014-10-03 17:35:39 +0200 | [diff] [blame] | 42 | int st_press_common_probe(struct iio_dev *indio_dev); |
Denis CIOCCA | 217494e | 2013-06-03 15:58:00 +0100 | [diff] [blame] | 43 | void st_press_common_remove(struct iio_dev *indio_dev); |
| 44 | |
| 45 | #ifdef CONFIG_IIO_BUFFER |
| 46 | int st_press_allocate_ring(struct iio_dev *indio_dev); |
| 47 | void st_press_deallocate_ring(struct iio_dev *indio_dev); |
| 48 | int st_press_trig_set_state(struct iio_trigger *trig, bool state); |
| 49 | #define ST_PRESS_TRIGGER_SET_STATE (&st_press_trig_set_state) |
| 50 | #else /* CONFIG_IIO_BUFFER */ |
| 51 | static inline int st_press_allocate_ring(struct iio_dev *indio_dev) |
| 52 | { |
| 53 | return 0; |
| 54 | } |
| 55 | |
| 56 | static inline void st_press_deallocate_ring(struct iio_dev *indio_dev) |
| 57 | { |
| 58 | } |
| 59 | #define ST_PRESS_TRIGGER_SET_STATE NULL |
| 60 | #endif /* CONFIG_IIO_BUFFER */ |
| 61 | |
| 62 | #endif /* ST_PRESS_H */ |