xref: /linux/drivers/iio/accel/st_accel.h (revision 8137a49e1567726eb10fcf55ad141ac19804ca6b)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * STMicroelectronics accelerometers driver
4  *
5  * Copyright 2012-2013 STMicroelectronics Inc.
6  *
7  * Denis Ciocca <denis.ciocca@st.com>
8  * v. 1.0.0
9  */
10 
11 #ifndef ST_ACCEL_H
12 #define ST_ACCEL_H
13 
14 #include <linux/types.h>
15 #include <linux/iio/common/st_sensors.h>
16 
17 enum st_accel_type {
18 	LSM303DLH,
19 	LSM303DLHC,
20 	LIS3DH,
21 	LSM330D,
22 	LSM330DL,
23 	LSM330DLC,
24 	LIS331DLH,
25 	LSM303DL,
26 	LSM303DLM,
27 	LSM330,
28 	LSM303AGR,
29 	LIS2DH12,
30 	LIS3L02DQ,
31 	LNG2DM,
32 	H3LIS331DL,
33 	LIS331DL,
34 	LIS3LV02DL,
35 	LIS2DW12,
36 	LIS3DHH,
37 	LIS2DE12,
38 	LIS2HH12,
39 	ST_ACCEL_MAX,
40 };
41 
42 #define H3LIS331DL_ACCEL_DEV_NAME	"h3lis331dl_accel"
43 #define LIS3LV02DL_ACCEL_DEV_NAME	"lis3lv02dl_accel"
44 #define LSM303DLHC_ACCEL_DEV_NAME	"lsm303dlhc_accel"
45 #define LIS3DH_ACCEL_DEV_NAME		"lis3dh"
46 #define LSM330D_ACCEL_DEV_NAME		"lsm330d_accel"
47 #define LSM330DL_ACCEL_DEV_NAME		"lsm330dl_accel"
48 #define LSM330DLC_ACCEL_DEV_NAME	"lsm330dlc_accel"
49 #define LIS331DL_ACCEL_DEV_NAME		"lis331dl_accel"
50 #define LIS331DLH_ACCEL_DEV_NAME	"lis331dlh"
51 #define LSM303DL_ACCEL_DEV_NAME		"lsm303dl_accel"
52 #define LSM303DLH_ACCEL_DEV_NAME	"lsm303dlh_accel"
53 #define LSM303DLM_ACCEL_DEV_NAME	"lsm303dlm_accel"
54 #define LSM330_ACCEL_DEV_NAME		"lsm330_accel"
55 #define LSM303AGR_ACCEL_DEV_NAME	"lsm303agr_accel"
56 #define LIS2DH12_ACCEL_DEV_NAME		"lis2dh12_accel"
57 #define LIS3L02DQ_ACCEL_DEV_NAME	"lis3l02dq"
58 #define LNG2DM_ACCEL_DEV_NAME		"lng2dm"
59 #define LIS2DW12_ACCEL_DEV_NAME		"lis2dw12"
60 #define LIS3DHH_ACCEL_DEV_NAME		"lis3dhh"
61 #define LIS3DE_ACCEL_DEV_NAME		"lis3de"
62 #define LIS2DE12_ACCEL_DEV_NAME		"lis2de12"
63 #define LIS2HH12_ACCEL_DEV_NAME		"lis2hh12"
64 
65 #ifdef CONFIG_IIO_BUFFER
66 int st_accel_allocate_ring(struct iio_dev *indio_dev);
67 void st_accel_deallocate_ring(struct iio_dev *indio_dev);
68 int st_accel_trig_set_state(struct iio_trigger *trig, bool state);
69 #define ST_ACCEL_TRIGGER_SET_STATE (&st_accel_trig_set_state)
70 #else /* CONFIG_IIO_BUFFER */
71 static inline int st_accel_allocate_ring(struct iio_dev *indio_dev)
72 {
73 	return 0;
74 }
75 static inline void st_accel_deallocate_ring(struct iio_dev *indio_dev)
76 {
77 }
78 #define ST_ACCEL_TRIGGER_SET_STATE NULL
79 #endif /* CONFIG_IIO_BUFFER */
80 
81 #endif /* ST_ACCEL_H */
82