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