aboutsummaryrefslogtreecommitdiff
path: root/drivers/iio/pressure/st_pressure.h
blob: 5c746ff6087e04946dfdee2ee0b6b74b89860383 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * 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>

enum st_press_type {
	LPS001WP,
	LPS25H,
	LPS331AP,
	LPS22HB,
	LPS33HW,
	LPS35HW,
	LPS22HH,
	ST_PRESS_MAX,
};

#define LPS001WP_PRESS_DEV_NAME		"lps001wp"
#define LPS25H_PRESS_DEV_NAME		"lps25h"
#define LPS331AP_PRESS_DEV_NAME		"lps331ap"
#define LPS22HB_PRESS_DEV_NAME		"lps22hb"
#define LPS33HW_PRESS_DEV_NAME		"lps33hw"
#define LPS35HW_PRESS_DEV_NAME		"lps35hw"
#define LPS22HH_PRESS_DEV_NAME		"lps22hh"

/**
 * struct st_sensors_platform_data - default press platform data
 * @drdy_int_pin: default press DRDY is available on INT1 pin.
 */
static __maybe_unused const struct st_sensors_platform_data default_press_pdata = {
	.drdy_int_pin = 1,
};

const struct st_sensor_settings *st_press_get_settings(const char *name);
int st_press_common_probe(struct iio_dev *indio_dev);
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 */