import PULS_20160108
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / misc / mediatek / accelerometer / bma050 / bma050.h
1 /* BMA250 motion sensor driver
2 *
3 *
4 * This software program is licensed subject to the GNU General Public License
5 * (GPL).Version 2,June 1991, available at http://www.fsf.org/copyleft/gpl.html
6
7 * (C) Copyright 2011 Bosch Sensortec GmbH
8 * All Rights Reserved
9 */
10
11 #ifndef BMA250_H
12 #define BMA250_H
13
14 #include <linux/ioctl.h>
15
16 #define BMA250_I2C_SLAVE_WRITE_ADDR 0x30
17 #define BMA250_FIXED_DEVID 0x03
18
19 /* BMA250 Register Map (Please refer to BMA250 Specifications) */
20 #define BMA250_REG_DEVID 0x00
21 #define BMA250_REG_OFSX 0x16
22 #define BMA250_REG_OFSX_HIGH 0x1A
23 #define BMA250_REG_BW_RATE 0x10
24 #define BMA250_BW_MASK 0x1f
25 #define BMA250_BW_200HZ 0x0d
26 #define BMA250_BW_100HZ 0x0c
27 #define BMA250_BW_50HZ 0x0b
28 #define BMA250_BW_25HZ 0x0a
29 #define BMA250_REG_POWER_CTL 0x11
30 #define BMA250_REG_DATA_FORMAT 0x0f
31 #define BMA250_RANGE_MASK 0x0f
32 #define BMA250_RANGE_2G 0x03
33 #define BMA250_RANGE_4G 0x05
34 #define BMA250_RANGE_8G 0x08
35 #define BMA250_REG_DATAXLOW 0x02
36 #define BMA250_REG_DATA_RESOLUTION 0x14
37 #define BMA250_MEASURE_MODE 0x80
38 #define BMA250_SELF_TEST 0x32
39 #define BMA250_SELF_TEST_AXIS_X 0x01
40 #define BMA250_SELF_TEST_AXIS_Y 0x02
41 #define BMA250_SELF_TEST_AXIS_Z 0x03
42 #define BMA250_SELF_TEST_POSITIVE 0x00
43 #define BMA250_SELF_TEST_NEGATIVE 0x04
44 #define BMA250_INT_REG_1 0x16
45 #define BMA250_INT_REG_2 0x17
46
47
48 #define BMA250_SUCCESS 0
49 #define BMA250_ERR_I2C -1
50 #define BMA250_ERR_STATUS -3
51 #define BMA250_ERR_SETUP_FAILURE -4
52 #define BMA250_ERR_GETGSENSORDATA -5
53 #define BMA250_ERR_IDENTIFICATION -6
54
55
56
57 #define BMA250_BUFSIZE 256
58
59 #endif
60