import PULS_20160108
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / misc / mediatek / magnetometer / af7133 / af7133.h
1 /* include/linux/af7133.h - AF7133 compass driver
2 *
3 *
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 */
14
15 /*
16 * Definitions for af7133 compass chip.
17 */
18 #ifndef AF7133_H
19 #define AF7133_H
20
21 #include <linux/ioctl.h>
22
23 #define AF7133_I2C_ADDRESS 0x1E //7-bit address
24 #define AF7133_BUFSIZE 6
25
26
27 /*AF7133 register address*/
28 #define AF7133_REG_DATA 0x00
29 #define AF7133_REG_STATUS 0x06
30 #define AF7133_REG_MODE 0x0B
31 #define AF7133_REG_HF 0x10
32 #define AF7133_REG_PCODE 0x16
33 #define AF7133_REG_POR 0x18
34 #define AF7133_REG_RATE 0x19
35 #define AF7133_REG_CHIPID 0x1C
36
37
38 /*AF7133 parameters*/
39 #define AF7133_MODE_IDLE 0x00
40 #define AF7133_MODE_WAKE 0x01
41 #define AF7133_MODE_SINGLE 0x02
42
43 #define AF7133_HF_ENABLE 0x80
44 #define AF7133_HF_DISABLE 0x00
45
46 #define AF7133_PCODE_VALUE 0x48
47
48 #define AF7133_POR_RESET 0x01
49
50 #define AF7133_RATE_10HZ 0x0C
51 #define AF7133_RATE_25HZ 0x05
52 #define AF7133_RATE_30HZ 0x04
53
54 // conversion of magnetic data (for AF7133) to uT units
55 #define CONVERT_M 5
56 #define CONVERT_M_DIV 100
57
58 // conversion of orientation data to degree units
59 #define CONVERT_O 1
60 #define CONVERT_O_DIV 1
61
62
63
64 #endif
65