import PULS_20160108
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / misc / mediatek / magnetometer / bmm056-new / bmm056.h
1 /* bmm050.c - bmm050 compass 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 /*
12 * Definitions for bmm050 magnetic sensor chip.
13 */
14 #ifndef __BMM050_H__
15 #define __BMM050_H__
16
17 #include <linux/ioctl.h>
18
19 #define CALIBRATION_DATA_SIZE 12
20
21 /* 7-bit addr:
22 * 0x12 (SDO connected to GND, CSB2 connected to VDDIO)
23 * 0x13 (SDO connected to VDDIO, CSB2 connected to VDDIO)
24 */
25 #define BMM050_I2C_ADDR 0x13
26
27 // conversion of magnetic data (for bmm050) to uT units
28 // conversion of magnetic data to uT units
29 // 32768 = 1Guass = 100 uT
30 // 100 / 32768 = 25 / 8096
31 // 65536 = 360Degree
32 // 360 / 65536 = 45 / 8192
33
34
35 #define CONVERT_M 1
36 #define CONVERT_M_DIV 4
37 #define CONVERT_O 1
38 #define CONVERT_O_DIV 71 //(C_PI_F32X * AXIS_RESOLUTION_FACTOR / 180)
39 #define CONVERT_G 1
40 #define CONVERT_G_DIV 938
41 #define CONVERT_VRV 1
42 #define CONVERT_VRV_DIV 16384
43
44 #endif /* __BMM050_H__ */
45