Skip to content

Commit 1c28799

Browse files
mothacehejic23
authored andcommitted
iio: light: isl29501: Add support for the ISL29501 ToF sensor.
This patch adds support for the ISL29501 Time of Flight sensor. Signed-off-by: Mathieu Othacehe <m.othacehe@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent c73314e commit 1c28799

File tree

5 files changed

+1101
-0
lines changed

5 files changed

+1101
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
What: /sys/bus/iio/devices/iio:deviceX/in_proximity0_agc_gain
2+
What: /sys/bus/iio/devices/iio:deviceX/in_proximity0_agc_gain_bias
3+
KernelVersion: 4.18
4+
Contact: linux-iio@vger.kernel.org
5+
Description:
6+
This sensor has an automatic gain control (agc) loop
7+
which sets the analog signal levels at an optimum
8+
level by controlling programmable gain amplifiers. The
9+
criteria for optimal gain is determined by the sensor.
10+
11+
Return the actual gain value as an integer in [0; 65536]
12+
range when read from.
13+
14+
The agc gain read when measuring crosstalk shall be
15+
written into in_proximity0_agc_gain_bias.
16+
17+
What: /sys/bus/iio/devices/iio:deviceX/in_proximity0_calib_phase_temp_a
18+
What: /sys/bus/iio/devices/iio:deviceX/in_proximity0_calib_phase_temp_b
19+
What: /sys/bus/iio/devices/iio:deviceX/in_proximity0_calib_phase_light_a
20+
What: /sys/bus/iio/devices/iio:deviceX/in_proximity0_calib_phase_light_b
21+
KernelVersion: 4.18
22+
Contact: linux-iio@vger.kernel.org
23+
Description:
24+
The sensor is able to perform correction of distance
25+
measurements due to changing temperature and ambient
26+
light conditions. It can be programmed to correct for
27+
a second order error polynomial.
28+
29+
Phase data has to be collected when temperature and
30+
ambient light are modulated independently.
31+
32+
Then a least squares curve fit to a second order
33+
polynomial has to be generated from the data. The
34+
resultant curves have the form ax^2 + bx + c.
35+
36+
From those two curves, a and b coefficients shall be
37+
stored in in_proximity0_calib_phase_temp_a and
38+
in_proximity0_calib_phase_temp_b for temperature and
39+
in in_proximity0_calib_phase_light_a and
40+
in_proximity0_calib_phase_light_b for ambient light.
41+
42+
Those values must be integer in [0; 8355840] range.
43+
44+
Finally, the c constant is set by the sensor
45+
internally.
46+
47+
The value stored in sensor is displayed when read from.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
* ISL29501 Time-of-flight sensor.
2+
3+
Required properties:
4+
5+
- compatible : should be "renesas,isl29501"
6+
- reg : the I2C address of the sensor
7+
8+
Example:
9+
10+
isl29501@57 {
11+
compatible = "renesas,isl29501";
12+
reg = <0x57>;
13+
};

drivers/iio/proximity/Kconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,19 @@ endmenu
2020

2121
menu "Proximity and distance sensors"
2222

23+
config ISL29501
24+
tristate "Intersil ISL29501 Time Of Flight sensor"
25+
depends on I2C
26+
select IIO_BUFFER
27+
select IIO_TRIGGERED_BUFFER
28+
select IIO_KFIFO_BUF
29+
help
30+
Say Y here if you want to build a driver for the Intersil ISL29501
31+
Time of Flight sensor.
32+
33+
To compile this driver as a module, choose M here: the module will be
34+
called isl29501.
35+
2336
config LIDAR_LITE_V2
2437
tristate "PulsedLight LIDAR sensor"
2538
select IIO_BUFFER

drivers/iio/proximity/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
# When adding new entries keep the list in alphabetical order
77
obj-$(CONFIG_AS3935) += as3935.o
8+
obj-$(CONFIG_ISL29501) += isl29501.o
89
obj-$(CONFIG_LIDAR_LITE_V2) += pulsedlight-lidar-lite-v2.o
910
obj-$(CONFIG_RFD77402) += rfd77402.o
1011
obj-$(CONFIG_SRF04) += srf04.o

0 commit comments

Comments
 (0)