bh1770glc.txt 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. Kernel driver bh1770glc
  2. =======================
  3. Supported chips:
  4. ROHM BH1770GLC
  5. OSRAM SFH7770
  6. Data sheet:
  7. Not freely available
  8. Author:
  9. Samu Onkalo <samu.p.onkalo@nokia.com>
  10. Description
  11. -----------
  12. BH1770GLC and SFH7770 are combined ambient light and proximity sensors.
  13. ALS and proximity parts operates on their own, but they shares common I2C
  14. interface and interrupt logic. In principle they can run on their own,
  15. but ALS side results are used to estimate reliability of the proximity sensor.
  16. ALS produces 16 bit lux values. The chip contains interrupt logic to produce
  17. low and high threshold interrupts.
  18. Proximity part contains IR-led driver up to 3 IR leds. The chip measures
  19. amount of reflected IR light and produces proximity result. Resolution is
  20. 8 bit. Driver supports only one channel. Driver uses ALS results to estimate
  21. reliability of the proximity results. Thus ALS is always running while
  22. proximity detection is needed.
  23. Driver uses threshold interrupts to avoid need for polling the values.
  24. Proximity low interrupt doesn't exists in the chip. This is simulated
  25. by using a delayed work. As long as there is proximity threshold above
  26. interrupts the delayed work is pushed forward. So, when proximity level goes
  27. below the threshold value, there is no interrupt and the delayed work will
  28. finally run. This is handled as no proximity indication.
  29. Chip state is controlled via runtime pm framework when enabled in config.
  30. Calibscale factor is used to hide differences between the chips. By default
  31. value set to neutral state meaning factor of 1.00. To get proper values,
  32. calibrated source of light is needed as a reference. Calibscale factor is set
  33. so that measurement produces about the expected lux value.
  34. SYSFS
  35. -----
  36. chip_id
  37. RO - shows detected chip type and version
  38. power_state
  39. RW - enable / disable chip. Uses counting logic
  40. 1 enables the chip
  41. 0 disables the chip
  42. lux0_input
  43. RO - measured lux value
  44. sysfs_notify called when threshold interrupt occurs
  45. lux0_sensor_range
  46. RO - lux0_input max value
  47. lux0_rate
  48. RW - measurement rate in Hz
  49. lux0_rate_avail
  50. RO - supported measurement rates
  51. lux0_thresh_above_value
  52. RW - HI level threshold value. All results above the value
  53. trigs an interrupt. 65535 (i.e. sensor_range) disables the above
  54. interrupt.
  55. lux0_thresh_below_value
  56. RW - LO level threshold value. All results below the value
  57. trigs an interrupt. 0 disables the below interrupt.
  58. lux0_calibscale
  59. RW - calibration value. Set to neutral value by default.
  60. Output results are multiplied with calibscale / calibscale_default
  61. value.
  62. lux0_calibscale_default
  63. RO - neutral calibration value
  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
  69. prox0_raw_en
  70. RW - enable / disable proximity - uses counting logic
  71. 1 enables the proximity
  72. 0 disables the proximity
  73. prox0_thresh_above_count
  74. RW - number of proximity interrupts needed before triggering the event
  75. prox0_rate_above
  76. RW - Measurement rate (in Hz) when the level is above threshold
  77. i.e. when proximity on has been reported.
  78. prox0_rate_below
  79. RW - Measurement rate (in Hz) when the level is below threshold
  80. i.e. when proximity off has been reported.
  81. prox0_rate_avail
  82. RO - Supported proximity measurement rates in Hz
  83. prox0_thresh_above0_value
  84. RW - threshold level which trigs proximity events.
  85. Filtered by persistence filter (prox0_thresh_above_count)
  86. prox0_thresh_above1_value
  87. RW - threshold level which trigs event immediately