tegrakernel/kernel/nvidia/Documentation/devicetree/bindings/iio/light/nvs_bh1730fvc.txt

61 lines
2.8 KiB
Plaintext
Raw Permalink Normal View History

2022-02-16 09:13:02 -06:00
* ROHM BH1730FVC ambient light sensor
nvs_ drivers use the NVidia Sensor (NVS) framework.
See the nvs.txt documentation for NVS DT capabilities.
Required properties:
- compatible: must be "rohm,bh1730fvc"
- reg: i2c address of the device. It should be 0x29.
Optional properties:
- status: set to "ok" or "okay" for normal operation. Set to anything else
to unload the driver without ever communicating with the device.
Note: The "anything else" above is typically "disabled".
Since the driver will unload without communicating with the device, the
device will be left in its POR state.
- vdd-supply: regulator supply for the chip vcc
- vid-supply: regulator supply for the chip dvi
Note: This is required if the driver is to control the regulator.
- bh1730fvc-lux-coeff-size: array size of bh1730fvc-lux-coeff.
- bh1730fvc-lux-coeff: Lux calculation coefficient table. See the note.
- bh1730fvc-lux-resolution: See the note.
- bh1730fvc-lux-multiplier: See the note.
Note: If lux coefficient data is not present, default calculation table is used.
If present, lux calculation is done with following equation.
Let following is set in dt:
bh1730fvc-lux-coeff-size = <5>;
bh1730fvc-lux-coeff = < 500 5002 7502>,
< 754 2250 2000>,
<1029 1999 1667>,
<1373 884 583>,
<1879 309 165>;
bh1730fvc-lux-resolution = <1000>;
bh1730fvc-lux-multiplier = <360>;
Then lux is calculated with this equation:
if (data1 * 1000 / data0 < 500)
lux = 5002 * data0 - 7502 * data1
else if (data1 * 1000 / data0 < 754)
lux = 2250 * data0 - 2000 * data1
else if (data1 * 1000 / data0 < 1029)
lux = 1999 * data0 - 1667 * data1
else if (data1 * 1000 / data0 < 1373)
lux = 884 * data0 - 583 * data1
else if (data1 * 1000 / data0 < 1879)
lux = 309 * data0 - 165 * data1
lux = lux * 360 / (gain * itime_us)
Example:
bh1730fvc@29 {
compatible = "rohm,bh1730fvc";
reg = <0x29>;
bh1730fvc-lux-coeff-size = <5>;
bh1730fvc-lux-coeff = < 500 5002 7502>,
< 754 2250 2000>,
<1029 1999 1667>,
<1373 884 583>,
<1879 309 165>;
bh1730fvc-lux-resolution = <1000>;
bh1730fvc-lux-multiplier = <360>;
};