xref: /openbmc/linux/include/linux/bma150.h (revision fb12ad5e)
174ba9207SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */
2c17ca3f5SEric Andersson /*
3c17ca3f5SEric Andersson  * Copyright (c) 2011 Bosch Sensortec GmbH
4c17ca3f5SEric Andersson  * Copyright (c) 2011 Unixphere
5c17ca3f5SEric Andersson  */
6c17ca3f5SEric Andersson 
7c17ca3f5SEric Andersson #ifndef _BMA150_H_
8c17ca3f5SEric Andersson #define _BMA150_H_
9c17ca3f5SEric Andersson 
10c17ca3f5SEric Andersson #define BMA150_DRIVER		"bma150"
11c17ca3f5SEric Andersson 
120db3863aSMichael Trimarchi #define BMA150_RANGE_2G		0
130db3863aSMichael Trimarchi #define BMA150_RANGE_4G		1
140db3863aSMichael Trimarchi #define BMA150_RANGE_8G		2
150db3863aSMichael Trimarchi 
160db3863aSMichael Trimarchi #define BMA150_BW_25HZ		0
170db3863aSMichael Trimarchi #define BMA150_BW_50HZ		1
180db3863aSMichael Trimarchi #define BMA150_BW_100HZ		2
190db3863aSMichael Trimarchi #define BMA150_BW_190HZ		3
200db3863aSMichael Trimarchi #define BMA150_BW_375HZ		4
210db3863aSMichael Trimarchi #define BMA150_BW_750HZ		5
220db3863aSMichael Trimarchi #define BMA150_BW_1500HZ	6
230db3863aSMichael Trimarchi 
24c17ca3f5SEric Andersson struct bma150_cfg {
25c17ca3f5SEric Andersson 	bool any_motion_int;		/* Set to enable any-motion interrupt */
26c17ca3f5SEric Andersson 	bool hg_int;			/* Set to enable high-G interrupt */
27c17ca3f5SEric Andersson 	bool lg_int;			/* Set to enable low-G interrupt */
28c17ca3f5SEric Andersson 	unsigned char any_motion_dur;	/* Any-motion duration */
29c17ca3f5SEric Andersson 	unsigned char any_motion_thres;	/* Any-motion threshold */
30c17ca3f5SEric Andersson 	unsigned char hg_hyst;		/* High-G hysterisis */
31c17ca3f5SEric Andersson 	unsigned char hg_dur;		/* High-G duration */
32c17ca3f5SEric Andersson 	unsigned char hg_thres;		/* High-G threshold */
33c17ca3f5SEric Andersson 	unsigned char lg_hyst;		/* Low-G hysterisis */
34c17ca3f5SEric Andersson 	unsigned char lg_dur;		/* Low-G duration */
35c17ca3f5SEric Andersson 	unsigned char lg_thres;		/* Low-G threshold */
36*fb12ad5eSChristophe JAILLET 	unsigned char range;		/* one of BMA150_RANGE_xxx */
37*fb12ad5eSChristophe JAILLET 	unsigned char bandwidth;	/* one of BMA150_BW_xxx */
38c17ca3f5SEric Andersson };
39c17ca3f5SEric Andersson 
40c17ca3f5SEric Andersson struct bma150_platform_data {
41c17ca3f5SEric Andersson 	struct bma150_cfg cfg;
42c17ca3f5SEric Andersson 	int (*irq_gpio_cfg)(void);
43c17ca3f5SEric Andersson };
44c17ca3f5SEric Andersson 
45c17ca3f5SEric Andersson #endif /* _BMA150_H_ */
46