Linux Kernel
3.7.1
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
drivers
staging
iio
light
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
64
struct
tsl2x7x_settings
{
65
int
als_time
;
66
int
als_gain
;
67
int
als_gain_trim
;
68
int
wait_time
;
69
int
prx_time
;
70
int
prox_gain
;
71
int
prox_config
;
72
int
als_cal_target
;
73
u8
interrupts_en
;
74
u8
persistence
;
75
int
als_thresh_low
;
76
int
als_thresh_high
;
77
int
prox_thres_low
;
78
int
prox_thres_high
;
79
int
prox_pulse_count
;
80
int
prox_max_samples_cal
;
81
};
82
92
struct
tsl2X7X_platform_data
{
93
int
(*
platform_power
)(
struct
device
*
dev
,
pm_message_t
);
94
int
(*
power_on
) (
struct
iio_dev
*indio_dev);
95
int
(*
power_off
) (
struct
i2c_client
*
dev
);
96
struct
tsl2x7x_lux
platform_lux_table
[
TSL2X7X_MAX_LUX_TABLE_SIZE
];
97
struct
tsl2x7x_settings
*
platform_default_settings
;
98
};
99
100
#endif
/* __TSL2X7X_H */
Generated on Thu Jan 10 2013 14:28:48 for Linux Kernel by
1.8.2