apds990x.txt 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. Kernel driver apds990x
  2. ======================
  3. Supported chips:
  4. Avago APDS990X
  5. Data sheet:
  6. Not freely available
  7. Author:
  8. Samu Onkalo <samu.p.onkalo@nokia.com>
  9. Description
  10. -----------
  11. APDS990x is a combined ambient light and proximity sensor. ALS and proximity
  12. functionality are highly connected. ALS measurement path must be running
  13. while the proximity functionality is enabled.
  14. ALS produces raw measurement values for two channels: Clear channel
  15. (infrared + visible light) and IR only. However, threshold comparisons happen
  16. using clear channel only. Lux value and the threshold level on the HW
  17. might vary quite much depending the spectrum of the light source.
  18. Driver makes necessary conversions to both directions so that user handles
  19. only lux values. Lux value is calculated using information from the both
  20. channels. HW threshold level is calculated from the given lux value to match
  21. with current type of the lightning. Sometimes inaccuracy of the estimations
  22. lead to false interrupt, but that doesn't harm.
  23. ALS contains 4 different gain steps. Driver automatically
  24. selects suitable gain step. After each measurement, reliability of the results
  25. is estimated and new measurement is triggered if necessary.
  26. Platform data can provide tuned values to the conversion formulas if
  27. values are known. Otherwise plain sensor default values are used.
  28. Proximity side is little bit simpler. There is no need for complex conversions.
  29. It produces directly usable values.
  30. Driver controls chip operational state using pm_runtime framework.
  31. Voltage regulators are controlled based on chip operational state.
  32. SYSFS
  33. -----
  34. chip_id
  35. RO - shows detected chip type and version
  36. power_state
  37. RW - enable / disable chip. Uses counting logic
  38. 1 enables the chip
  39. 0 disables the chip
  40. lux0_input
  41. RO - measured lux value
  42. sysfs_notify called when threshold interrupt occurs
  43. lux0_sensor_range
  44. RO - lux0_input max value. Actually never reaches since sensor tends
  45. to saturate much before that. Real max value varies depending
  46. on the light spectrum etc.
  47. lux0_rate
  48. RW - measurement rate in Hz
  49. lux0_rate_avail
  50. RO - supported measurement rates
  51. lux0_calibscale
  52. RW - calibration value. Set to neutral value by default.
  53. Output results are multiplied with calibscale / calibscale_default
  54. value.
  55. lux0_calibscale_default
  56. RO - neutral calibration value
  57. lux0_thresh_above_value
  58. RW - HI level threshold value. All results above the value
  59. trigs an interrupt. 65535 (i.e. sensor_range) disables the above
  60. interrupt.
  61. lux0_thresh_below_value
  62. RW - LO level threshold value. All results below the value
  63. trigs an interrupt. 0 disables the below interrupt.
  64. prox0_raw
  65. RO - measured proximity value
  66. sysfs_notify called when threshold interrupt occurs
  67. prox0_sensor_range
  68. RO - prox0_raw max value (1023)
  69. prox0_raw_en
  70. RW - enable / disable proximity - uses counting logic
  71. 1 enables the proximity
  72. 0 disables the proximity
  73. prox0_reporting_mode
  74. RW - trigger / periodic. In "trigger" mode the driver tells two possible
  75. values: 0 or prox0_sensor_range value. 0 means no proximity,
  76. 1023 means proximity. This causes minimal number of interrupts.
  77. In "periodic" mode the driver reports all values above
  78. prox0_thresh_above. This causes more interrupts, but it can give
  79. _rough_ estimate about the distance.
  80. prox0_reporting_mode_avail
  81. RO - accepted values to prox0_reporting_mode (trigger, periodic)
  82. prox0_thresh_above_value
  83. RW - threshold level which trigs proximity events.