import PULS_20160108
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / misc / mediatek / accelerometer / bma222E / bma222E.h
1 /* linux/drivers/hwmon/adxl345.c
2 *
3 * (C) Copyright 2008
4 * MediaTek <www.mediatek.com>
5 *
6 * BMA150 driver for MT6516
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA BMA150
21 */
22 #ifndef BMA150_H
23 #define BMA150_H
24
25 #include <linux/ioctl.h>
26
27 #define BMA222_I2C_SLAVE_WRITE_ADDR 0x10
28
29 /* BMA222 Register Map (Please refer to BMA150 Specifications) */
30 #define BMA222_REG_DEVID 0x00
31 #define BMA222_FIXED_DEVID 0x03
32 #define BMA222_REG_OFSX 0x16
33 #define BMA222_REG_OFSX_HIGH 0x1A
34 #define BMA222_REG_BW_RATE 0x10
35 #define BMA222_BW_MASK 0x1f
36 #define BMA222_BW_200HZ 0x0d
37 #define BMA222_BW_100HZ 0x0c
38 #define BMA222_BW_50HZ 0x0b
39 #define BMA222_BW_25HZ 0x0a
40 #define BMA222_REG_POWER_CTL 0x11
41 #define BMA222_REG_DATA_FORMAT 0x0f
42 #define BMA222_RANGE_MASK 0x0f
43 #define BMA222_RANGE_2G 0x03
44 #define BMA222_RANGE_4G 0x05
45 #define BMA222_RANGE_8G 0x08
46 #define BMA222_REG_DATAXLOW 0x03
47 #define BMA222_REG_DATA_RESOLUTION 0x14
48 #define BMA222_MEASURE_MODE 0x80
49 #define BMA222_SELF_TEST 0x32
50 #define BMA222_SELF_TEST_AXIS_X 0x01
51 #define BMA222_SELF_TEST_AXIS_Y 0x02
52 #define BMA222_SELF_TEST_AXIS_Z 0x03
53 #define BMA222_SELF_TEST_POSITIVE 0x00
54 #define BMA222_SELF_TEST_NEGATIVE 0x04
55 #define BMA222_INT_REG_1 0x16
56 #define BMA222_INT_REG_2 0x17
57
58
59 #define BMA222_SUCCESS 0
60 #define BMA222_ERR_I2C -1
61 #define BMA222_ERR_STATUS -3
62 #define BMA222_ERR_SETUP_FAILURE -4
63 #define BMA222_ERR_GETGSENSORDATA -5
64 #define BMA222_ERR_IDENTIFICATION -6
65
66
67
68 #define BMA222_BUFSIZE 256
69
70 #endif
71