us5182d.txt 2.0 KB

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