1/*
2 * Copyright (c) 2008-2009, Motorola, All Rights Reserved.
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 as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
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.
13 *
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/>.
16 *
17 */
18
19#ifndef __LIS331DLH_H__
20#define __LIS331DLH_H__
21
22#include <linux/ioctl.h>  /* For IOCTL macros */
23
24/** This define controls compilation of the master device interface */
25/*#define LIS331DLH_MASTER_DEVICE*/
26
27#define LIS331DLH_IOCTL_BASE 77
28/** The following define the IOCTL command values via the ioctl macros */
29#define LIS331DLH_IOCTL_SET_DELAY	_IOW(LIS331DLH_IOCTL_BASE, 0, int)
30#define LIS331DLH_IOCTL_GET_DELAY	_IOR(LIS331DLH_IOCTL_BASE, 1, int)
31#define LIS331DLH_IOCTL_SET_ENABLE	_IOW(LIS331DLH_IOCTL_BASE, 2, int)
32#define LIS331DLH_IOCTL_GET_ENABLE	_IOR(LIS331DLH_IOCTL_BASE, 3, int)
33#define LIS331DLH_IOCTL_SET_G_RANGE	_IOW(LIS331DLH_IOCTL_BASE, 4, int)
34
35#define LIS331DLH_G_2G 0x00
36#define LIS331DLH_G_4G 0x10
37#define LIS331DLH_G_8G 0x30
38
39#ifdef __KERNEL__
40struct lis331dlh_platform_data {
41	int poll_interval;
42	int min_interval;
43
44	u8 g_range;
45
46	u8 axis_map_x;
47	u8 axis_map_y;
48	u8 axis_map_z;
49
50	u8 negate_x;
51	u8 negate_y;
52	u8 negate_z;
53
54	int (*init)(void);
55	void (*exit)(void);
56	int (*power_on)(void);
57	int (*power_off)(void);
58
59};
60#endif /* __KERNEL__ */
61
62#endif  /* __LIS331DLH_H__ */
63
64