1 /* 2 * Copyright (C) 2010 Motorola, Inc. 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License version 2 as 6 * published by the Free Software Foundation. 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 * You should have received a copy of the GNU General Public License 14 * along with this program; if not, write to the Free Software 15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 16 * 02111-1307, USA 17 */ 18 19 #ifndef __L3G4200D_H__ 20 #define __L3G4200D_H__ 21 22 #include <linux/ioctl.h> /* For IOCTL macros */ 23 24 #define L3G4200D_NAME "l3g4200d" 25 26 #define L3G4200D_IOCTL_BASE 77 27 /** The following define the IOCTL command values via the ioctl macros */ 28 #define L3G4200D_IOCTL_SET_DELAY _IOW(L3G4200D_IOCTL_BASE, 0, int) 29 #define L3G4200D_IOCTL_GET_DELAY _IOR(L3G4200D_IOCTL_BASE, 1, int) 30 #define L3G4200D_IOCTL_SET_ENABLE _IOW(L3G4200D_IOCTL_BASE, 2, int) 31 #define L3G4200D_IOCTL_GET_ENABLE _IOR(L3G4200D_IOCTL_BASE, 3, int) 32 33 #ifdef __KERNEL__ 34 35 struct l3g4200d_platform_data { 36 int poll_interval; 37 int min_interval; 38 39 u8 ctrl_reg_1; 40 u8 ctrl_reg_2; 41 u8 ctrl_reg_3; 42 u8 ctrl_reg_4; 43 u8 ctrl_reg_5; 44 45 u8 int_config; 46 u8 int_source; 47 48 u8 int_th_x_h; 49 u8 int_th_x_l; 50 u8 int_th_y_h; 51 u8 int_th_y_l; 52 u8 int_th_z_h; 53 u8 int_th_z_l; 54 u8 int_duration; 55 56 u8 g_range; 57 58 u8 axis_map_x; 59 u8 axis_map_y; 60 u8 axis_map_z; 61 62 u8 negate_x; 63 u8 negate_y; 64 u8 negate_z; 65 66 void (*exit)(void); 67 int (*power_on)(void); 68 int (*power_off)(void); 69 70 }; 71 #endif /* __KERNEL__ */ 72 73 #endif /* __L3G4200D_H__ */ 74 75