xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/iio/light/us5182d.txt (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun* UPISEMI us5182d I2C ALS and Proximity sensor
2*4882a593Smuzhiyun
3*4882a593SmuzhiyunRequired properties:
4*4882a593Smuzhiyun- compatible: must be "upisemi,usd5182"
5*4882a593Smuzhiyun- reg: the I2C address of the device
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunOptional properties:
8*4882a593Smuzhiyun- upisemi,glass-coef: glass attenuation factor - compensation factor of
9*4882a593Smuzhiyun                      resolution 1000 for material transmittance.
10*4882a593Smuzhiyun
11*4882a593Smuzhiyun- upisemi,dark-ths: array of 8 elements containing 16-bit thresholds (adc
12*4882a593Smuzhiyun                    counts) corresponding to every scale.
13*4882a593Smuzhiyun
14*4882a593Smuzhiyun- upisemi,upper-dark-gain: 8-bit dark gain compensation factor(4 int and 4
15*4882a593Smuzhiyun                           fractional bits - Q4.4) applied when light > threshold
16*4882a593Smuzhiyun
17*4882a593Smuzhiyun- upisemi,lower-dark-gain: 8-bit dark gain compensation factor(4 int and 4
18*4882a593Smuzhiyun                           fractional bits - Q4.4) applied when light < threshold
19*4882a593Smuzhiyun
20*4882a593Smuzhiyun- upisemi,continuous: This chip has two power modes: one-shot (chip takes one
21*4882a593Smuzhiyun                      measurement and then shuts itself down) and continuous (
22*4882a593Smuzhiyun                      chip takes continuous measurements). The one-shot mode is
23*4882a593Smuzhiyun                      more power-friendly but the continuous mode may be more
24*4882a593Smuzhiyun                      reliable. If this property is specified the continuous
25*4882a593Smuzhiyun                      mode will be used instead of the default one-shot one for
26*4882a593Smuzhiyun                      raw reads.
27*4882a593Smuzhiyun
28*4882a593SmuzhiyunIf the optional properties are not specified these factors will default to the
29*4882a593Smuzhiyunvalues in the below example.
30*4882a593SmuzhiyunThe glass-coef defaults to no compensation for the covering material.
31*4882a593SmuzhiyunThe threshold array defaults to experimental values that work with US5182D
32*4882a593Smuzhiyunsensor on evaluation board - roughly between 12-32 lux.
33*4882a593SmuzhiyunThere will be no dark-gain compensation by default when ALS > thresh
34*4882a593Smuzhiyun(0 * dark-gain), and a 1.35 compensation factor when ALS < thresh.
35*4882a593Smuzhiyun
36*4882a593SmuzhiyunExample:
37*4882a593Smuzhiyun
38*4882a593Smuzhiyun    usd5182@39 {
39*4882a593Smuzhiyun                compatible = "upisemi,usd5182";
40*4882a593Smuzhiyun                reg = <0x39>;
41*4882a593Smuzhiyun                upisemi,glass-coef = < 1000 >;
42*4882a593Smuzhiyun                upisemi,dark-ths = /bits/ 16 <170 200 512 512 800 2000 4000 8000>;
43*4882a593Smuzhiyun                upisemi,upper-dark-gain = /bits/ 8 <0x00>;
44*4882a593Smuzhiyun                upisemi,lower-dark-gain = /bits/ 8 <0x16>;
45*4882a593Smuzhiyun    };
46