2 * Definitions for ak8973 compass chip.
7 #include <linux/ioctl.h>
9 #define AKM8973_I2C_NAME "ak8973"
11 /* Compass device dependent definition */
12 #define AKECS_MODE_MEASURE 0x00 /* Starts measurement. Please use AKECS_MODE_MEASURE_SNG */
13 /* or AKECS_MODE_MEASURE_SEQ instead of this. */
14 #define AKECS_MODE_E2P_READ 0x02 /* E2P access mode (read). */
15 #define AKECS_MODE_POWERDOWN 0x03 /* Power down mode */
17 #define RBUFF_SIZE 4 /* Rx buffer size */
19 /* AK8973 register address */
20 #define AKECS_REG_ST 0xC0
21 #define AKECS_REG_TMPS 0xC1
22 #define AKECS_REG_MS1 0xE0
26 /* IOCTLs for AKM library */
27 #define ECS_IOCTL_WRITE _IOW(AKMIO, 0x01, char[5])
28 #define ECS_IOCTL_READ _IOWR(AKMIO, 0x02, char[5])
29 #define ECS_IOCTL_RESET _IO(AKMIO, 0x03)
30 #define ECS_IOCTL_SET_MODE _IOW(AKMIO, 0x04, short)
31 #define ECS_IOCTL_GETDATA _IOR(AKMIO, 0x05, char[RBUFF_SIZE+1])
32 #define ECS_IOCTL_SET_YPR _IOW(AKMIO, 0x06, short[12])
33 #define ECS_IOCTL_GET_OPEN_STATUS _IOR(AKMIO, 0x07, int)
34 #define ECS_IOCTL_GET_CLOSE_STATUS _IOR(AKMIO, 0x08, int)
35 #define ECS_IOCTL_GET_DELAY _IOR(AKMIO, 0x30, short)
38 #define ECS_IOCTL_APP_SET_MODE _IOW(AKMIO, 0x10, short)
39 #define ECS_IOCTL_APP_SET_MFLAG _IOW(AKMIO, 0x11, short)
40 #define ECS_IOCTL_APP_GET_MFLAG _IOW(AKMIO, 0x12, short)
41 #define ECS_IOCTL_APP_SET_AFLAG _IOW(AKMIO, 0x13, short)
42 #define ECS_IOCTL_APP_GET_AFLAG _IOR(AKMIO, 0x14, short)
43 #define ECS_IOCTL_APP_SET_TFLAG _IOR(AKMIO, 0x15, short)
44 #define ECS_IOCTL_APP_GET_TFLAG _IOR(AKMIO, 0x16, short)
45 #define ECS_IOCTL_APP_RESET_PEDOMETER _IO(AKMIO, 0x17)
46 #define ECS_IOCTL_APP_SET_DELAY _IOW(AKMIO, 0x18, short)
47 #define ECS_IOCTL_APP_GET_DELAY ECS_IOCTL_GET_DELAY
48 #define ECS_IOCTL_APP_SET_MVFLAG _IOW(AKMIO, 0x19, short) /* Set raw magnetic vector flag */
49 #define ECS_IOCTL_APP_GET_MVFLAG _IOR(AKMIO, 0x1A, short) /* Get raw magnetic vector flag */