2019-05-28 16:57:06 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2013-06-03 14:58:00 +00:00
|
|
|
/*
|
|
|
|
* STMicroelectronics pressures driver
|
|
|
|
*
|
|
|
|
* Copyright 2013 STMicroelectronics Inc.
|
|
|
|
*
|
|
|
|
* Denis Ciocca <denis.ciocca@st.com>
|
|
|
|
* v. 1.0.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ST_PRESS_H
|
|
|
|
#define ST_PRESS_H
|
|
|
|
|
|
|
|
#include <linux/types.h>
|
|
|
|
#include <linux/iio/common/st_sensors.h>
|
|
|
|
|
2016-11-24 05:33:45 +00:00
|
|
|
enum st_press_type {
|
|
|
|
LPS001WP,
|
|
|
|
LPS25H,
|
|
|
|
LPS331AP,
|
|
|
|
LPS22HB,
|
2017-09-02 17:39:14 +00:00
|
|
|
LPS33HW,
|
|
|
|
LPS35HW,
|
2019-01-14 17:24:20 +00:00
|
|
|
LPS22HH,
|
2016-11-24 05:33:45 +00:00
|
|
|
ST_PRESS_MAX,
|
|
|
|
};
|
|
|
|
|
2013-09-16 16:02:00 +00:00
|
|
|
#define LPS001WP_PRESS_DEV_NAME "lps001wp"
|
2014-02-20 17:49:00 +00:00
|
|
|
#define LPS25H_PRESS_DEV_NAME "lps25h"
|
2013-06-03 14:58:00 +00:00
|
|
|
#define LPS331AP_PRESS_DEV_NAME "lps331ap"
|
2016-04-19 09:18:32 +00:00
|
|
|
#define LPS22HB_PRESS_DEV_NAME "lps22hb"
|
2017-09-02 17:39:14 +00:00
|
|
|
#define LPS33HW_PRESS_DEV_NAME "lps33hw"
|
|
|
|
#define LPS35HW_PRESS_DEV_NAME "lps35hw"
|
2019-01-14 17:24:20 +00:00
|
|
|
#define LPS22HH_PRESS_DEV_NAME "lps22hh"
|
2013-06-03 14:58:00 +00:00
|
|
|
|
2013-06-19 08:28:00 +00:00
|
|
|
/**
|
|
|
|
* struct st_sensors_platform_data - default press platform data
|
|
|
|
* @drdy_int_pin: default press DRDY is available on INT1 pin.
|
|
|
|
*/
|
2019-12-16 17:38:50 +00:00
|
|
|
static __maybe_unused const struct st_sensors_platform_data default_press_pdata = {
|
2013-06-19 08:28:00 +00:00
|
|
|
.drdy_int_pin = 1,
|
|
|
|
};
|
|
|
|
|
2019-07-18 22:53:47 +00:00
|
|
|
const struct st_sensor_settings *st_press_get_settings(const char *name);
|
2014-10-03 15:35:39 +00:00
|
|
|
int st_press_common_probe(struct iio_dev *indio_dev);
|
2013-06-03 14:58:00 +00:00
|
|
|
void st_press_common_remove(struct iio_dev *indio_dev);
|
|
|
|
|
|
|
|
#ifdef CONFIG_IIO_BUFFER
|
|
|
|
int st_press_allocate_ring(struct iio_dev *indio_dev);
|
|
|
|
void st_press_deallocate_ring(struct iio_dev *indio_dev);
|
|
|
|
int st_press_trig_set_state(struct iio_trigger *trig, bool state);
|
|
|
|
#define ST_PRESS_TRIGGER_SET_STATE (&st_press_trig_set_state)
|
|
|
|
#else /* CONFIG_IIO_BUFFER */
|
|
|
|
static inline int st_press_allocate_ring(struct iio_dev *indio_dev)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void st_press_deallocate_ring(struct iio_dev *indio_dev)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
#define ST_PRESS_TRIGGER_SET_STATE NULL
|
|
|
|
#endif /* CONFIG_IIO_BUFFER */
|
|
|
|
|
|
|
|
#endif /* ST_PRESS_H */
|