blob: 242943c0c4e496c4b054bb5426cc06c5380accdb [file] [log] [blame]
Denis CIOCCA217494e2013-06-03 15:58:00 +01001/*
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
Lee Jones7885a8c2013-09-16 17:02:00 +010017#define LPS001WP_PRESS_DEV_NAME "lps001wp"
Denis CIOCCA93187842014-02-20 17:49:00 +000018#define LPS25H_PRESS_DEV_NAME "lps25h"
Denis CIOCCA217494e2013-06-03 15:58:00 +010019#define LPS331AP_PRESS_DEV_NAME "lps331ap"
20
Denis CIOCCA23cde4d2013-06-19 09:28:00 +010021/**
22 * struct st_sensors_platform_data - default press platform data
23 * @drdy_int_pin: default press DRDY is available on INT1 pin.
24 */
25static const struct st_sensors_platform_data default_press_pdata = {
26 .drdy_int_pin = 1,
27};
28
29int st_press_common_probe(struct iio_dev *indio_dev,
30 struct st_sensors_platform_data *pdata);
Denis CIOCCA217494e2013-06-03 15:58:00 +010031void st_press_common_remove(struct iio_dev *indio_dev);
32
33#ifdef CONFIG_IIO_BUFFER
34int st_press_allocate_ring(struct iio_dev *indio_dev);
35void st_press_deallocate_ring(struct iio_dev *indio_dev);
36int st_press_trig_set_state(struct iio_trigger *trig, bool state);
37#define ST_PRESS_TRIGGER_SET_STATE (&st_press_trig_set_state)
38#else /* CONFIG_IIO_BUFFER */
39static inline int st_press_allocate_ring(struct iio_dev *indio_dev)
40{
41 return 0;
42}
43
44static inline void st_press_deallocate_ring(struct iio_dev *indio_dev)
45{
46}
47#define ST_PRESS_TRIGGER_SET_STATE NULL
48#endif /* CONFIG_IIO_BUFFER */
49
50#endif /* ST_PRESS_H */