2 * Copyright (c) 2008-2009, Kionix, Inc. All Rights Reserved.
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #include <linux/ioctl.h> /* For IOCTL macros */
24 /** This define controls compilation of the master device interface */
25 /*#define KXTF9_MASTER_DEVICE*/
27 #define KXTF9_IOCTL_BASE 77
28 /** The following define the IOCTL command values via the ioctl macros */
29 #define KXTF9_IOCTL_SET_DELAY _IOW(KXTF9_IOCTL_BASE, 0, int)
30 #define KXTF9_IOCTL_GET_DELAY _IOR(KXTF9_IOCTL_BASE, 1, int)
31 #define KXTF9_IOCTL_SET_ENABLE _IOW(KXTF9_IOCTL_BASE, 2, int)
32 #define KXTF9_IOCTL_GET_ENABLE _IOR(KXTF9_IOCTL_BASE, 3, int)
33 #define KXTF9_IOCTL_SET_G_RANGE _IOW(KXTF9_IOCTL_BASE, 4, int)
35 #define KXTF9_IOCTL_SET_TILT_ENABLE _IOW(KXTF9_IOCTL_BASE, 5, int)
36 #define KXTF9_IOCTL_SET_TAP_ENABLE _IOW(KXTF9_IOCTL_BASE, 6, int)
37 #define KXTF9_IOCTL_SET_WAKE_ENABLE _IOW(KXTF9_IOCTL_BASE, 7, int)
38 #define KXTF9_IOCTL_SET_PM_MODE _IOW(KXTF9_IOCTL_BASE, 8, int)
39 #define KXTF9_IOCTL_SELF_TEST _IOW(KXTF9_IOCTL_BASE, 9, int)
40 #define KXTF9_IOCTL_SET_SENSITIVITY _IOW(KXTF9_IOCTL_BASE, 10, int)
42 /* CONTROL REGISTER 1 BITS */
43 #define RES_12BIT 0x40
44 #define KXTF9_G_2G 0x00
45 #define KXTF9_G_4G 0x08
46 #define KXTF9_G_8G 0x10
47 #define TPE 0x01 /* tilt position function enable bit */
48 #define WUFE 0x02 /* wake-up function enable bit */
49 #define TDTE 0x04 /* tap/double-tap function enable bit */
50 /* CONTROL REGISTER 3 BITS */
51 #define OTP1_6 0x00 /* tilt ODR masks */
55 #define OWUF25 0x00 /* wuf ODR masks */
59 #define OTDT50 0x00 /* tdt ODR masks */
63 /* INTERRUPT CONTROL REGISTER 1 BITS */
64 #define IEN 0x20 /* interrupt enable */
65 #define IEA 0x10 /* interrupt polarity */
66 #define IEL 0x08 /* interrupt response */
67 #define IEU 0x04 /* alternate unlatched response */
68 /* DATA CONTROL REGISTER BITS */
69 #define ODR800 0x06 /* lpf output ODR masks */
77 #define SENSITIVITY_REGS 0x07
80 struct kxtf9_platform_data {
102 u8 tdt_h_thresh_init;
103 u8 tdt_l_thresh_init;
104 u8 tdt_tap_timer_init;
105 u8 tdt_total_timer_init;
106 u8 tdt_latency_timer_init;
107 u8 tdt_window_timer_init;
112 u8 sensitivity_low[SENSITIVITY_REGS];
113 u8 sensitivity_medium[SENSITIVITY_REGS];
114 u8 sensitivity_high[SENSITIVITY_REGS];
117 #endif /* __KERNEL__ */
119 #endif /* __KXTF9_H__ */