Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  * Copyright (c) 2011 Bosch Sensortec GmbH
0004  * Copyright (c) 2011 Unixphere
0005  */
0006 
0007 #ifndef _BMA150_H_
0008 #define _BMA150_H_
0009 
0010 #define BMA150_DRIVER       "bma150"
0011 
0012 #define BMA150_RANGE_2G     0
0013 #define BMA150_RANGE_4G     1
0014 #define BMA150_RANGE_8G     2
0015 
0016 #define BMA150_BW_25HZ      0
0017 #define BMA150_BW_50HZ      1
0018 #define BMA150_BW_100HZ     2
0019 #define BMA150_BW_190HZ     3
0020 #define BMA150_BW_375HZ     4
0021 #define BMA150_BW_750HZ     5
0022 #define BMA150_BW_1500HZ    6
0023 
0024 struct bma150_cfg {
0025     bool any_motion_int;        /* Set to enable any-motion interrupt */
0026     bool hg_int;            /* Set to enable high-G interrupt */
0027     bool lg_int;            /* Set to enable low-G interrupt */
0028     unsigned char any_motion_dur;   /* Any-motion duration */
0029     unsigned char any_motion_thres; /* Any-motion threshold */
0030     unsigned char hg_hyst;      /* High-G hysterisis */
0031     unsigned char hg_dur;       /* High-G duration */
0032     unsigned char hg_thres;     /* High-G threshold */
0033     unsigned char lg_hyst;      /* Low-G hysterisis */
0034     unsigned char lg_dur;       /* Low-G duration */
0035     unsigned char lg_thres;     /* Low-G threshold */
0036     unsigned char range;        /* one of BMA0150_RANGE_xxx */
0037     unsigned char bandwidth;    /* one of BMA0150_BW_xxx */
0038 };
0039 
0040 struct bma150_platform_data {
0041     struct bma150_cfg cfg;
0042     int (*irq_gpio_cfg)(void);
0043 };
0044 
0045 #endif /* _BMA150_H_ */