Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
tsl2x7x.h
Go to the documentation of this file.
1 /*
2  * Device driver for monitoring ambient light intensity (lux)
3  * and proximity (prox) within the TAOS TSL2X7X family of devices.
4  *
5  * Copyright (c) 2012, TAOS Corporation.
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15  * more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  */
21 
22 #ifndef __TSL2X7X_H
23 #define __TSL2X7X_H
24 #include <linux/pm.h>
25 
26 /* Max number of segments allowable in LUX table */
27 #define TSL2X7X_MAX_LUX_TABLE_SIZE 9
28 #define MAX_DEFAULT_TABLE_BYTES (sizeof(int) * TSL2X7X_MAX_LUX_TABLE_SIZE)
29 
30 struct iio_dev;
31 
32 struct tsl2x7x_lux {
33  unsigned int ratio;
34  unsigned int ch0;
35  unsigned int ch1;
36 };
37 
65  int als_time;
66  int als_gain;
68  int wait_time;
69  int prx_time;
70  int prox_gain;
81 };
82 
94  int (*power_on) (struct iio_dev *indio_dev);
95  int (*power_off) (struct i2c_client *dev);
98 };
99 
100 #endif /* __TSL2X7X_H */