diff options
author | Samu Onkalo <samu.p.onkalo@nokia.com> | 2010-10-26 17:22:39 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-26 19:52:14 -0400 |
commit | 3f0f4a3f2008613c601e97f773dbd80ac400e459 (patch) | |
tree | 07f06e655135542680300e5c8248561dfaef53e6 /Documentation/misc-devices | |
parent | 92b1f84d46b24675493d95a239eea2b07e5f13f8 (diff) |
Documentation: short descriptions for bh1770glc and apds990x drivers
Add short documentation for two ALS / proximity chip drivers.
Signed-off-by: Samu Onkalo <samu.p.onkalo@nokia.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation/misc-devices')
-rw-r--r-- | Documentation/misc-devices/apds990x.txt | 111 | ||||
-rw-r--r-- | Documentation/misc-devices/bh1770glc.txt | 116 |
2 files changed, 227 insertions, 0 deletions
diff --git a/Documentation/misc-devices/apds990x.txt b/Documentation/misc-devices/apds990x.txt new file mode 100644 index 000000000000..d5408cade32f --- /dev/null +++ b/Documentation/misc-devices/apds990x.txt | |||
@@ -0,0 +1,111 @@ | |||
1 | Kernel driver apds990x | ||
2 | ====================== | ||
3 | |||
4 | Supported chips: | ||
5 | Avago APDS990X | ||
6 | |||
7 | Data sheet: | ||
8 | Not freely available | ||
9 | |||
10 | Author: | ||
11 | Samu Onkalo <samu.p.onkalo@nokia.com> | ||
12 | |||
13 | Description | ||
14 | ----------- | ||
15 | |||
16 | APDS990x is a combined ambient light and proximity sensor. ALS and proximity | ||
17 | functionality are highly connected. ALS measurement path must be running | ||
18 | while the proximity functionality is enabled. | ||
19 | |||
20 | ALS produces raw measurement values for two channels: Clear channel | ||
21 | (infrared + visible light) and IR only. However, threshold comparisons happen | ||
22 | using clear channel only. Lux value and the threshold level on the HW | ||
23 | might vary quite much depending the spectrum of the light source. | ||
24 | |||
25 | Driver makes necessary conversions to both directions so that user handles | ||
26 | only lux values. Lux value is calculated using information from the both | ||
27 | channels. HW threshold level is calculated from the given lux value to match | ||
28 | with current type of the lightning. Sometimes inaccuracy of the estimations | ||
29 | lead to false interrupt, but that doesn't harm. | ||
30 | |||
31 | ALS contains 4 different gain steps. Driver automatically | ||
32 | selects suitable gain step. After each measurement, reliability of the results | ||
33 | is estimated and new measurement is trigged if necessary. | ||
34 | |||
35 | Platform data can provide tuned values to the conversion formulas if | ||
36 | values are known. Otherwise plain sensor default values are used. | ||
37 | |||
38 | Proximity side is little bit simpler. There is no need for complex conversions. | ||
39 | It produces directly usable values. | ||
40 | |||
41 | Driver controls chip operational state using pm_runtime framework. | ||
42 | Voltage regulators are controlled based on chip operational state. | ||
43 | |||
44 | SYSFS | ||
45 | ----- | ||
46 | |||
47 | |||
48 | chip_id | ||
49 | RO - shows detected chip type and version | ||
50 | |||
51 | power_state | ||
52 | RW - enable / disable chip. Uses counting logic | ||
53 | 1 enables the chip | ||
54 | 0 disables the chip | ||
55 | lux0_input | ||
56 | RO - measured lux value | ||
57 | sysfs_notify called when threshold interrupt occurs | ||
58 | |||
59 | lux0_sensor_range | ||
60 | RO - lux0_input max value. Actually never reaches since sensor tends | ||
61 | to saturate much before that. Real max value varies depending | ||
62 | on the light spectrum etc. | ||
63 | |||
64 | lux0_rate | ||
65 | RW - measurement rate in Hz | ||
66 | |||
67 | lux0_rate_avail | ||
68 | RO - supported measurement rates | ||
69 | |||
70 | lux0_calibscale | ||
71 | RW - calibration value. Set to neutral value by default. | ||
72 | Output results are multiplied with calibscale / calibscale_default | ||
73 | value. | ||
74 | |||
75 | lux0_calibscale_default | ||
76 | RO - neutral calibration value | ||
77 | |||
78 | lux0_thresh_above_value | ||
79 | RW - HI level threshold value. All results above the value | ||
80 | trigs an interrupt. 65535 (i.e. sensor_range) disables the above | ||
81 | interrupt. | ||
82 | |||
83 | lux0_thresh_below_value | ||
84 | RW - LO level threshold value. All results below the value | ||
85 | trigs an interrupt. 0 disables the below interrupt. | ||
86 | |||
87 | prox0_raw | ||
88 | RO - measured proximity value | ||
89 | sysfs_notify called when threshold interrupt occurs | ||
90 | |||
91 | prox0_sensor_range | ||
92 | RO - prox0_raw max value (1023) | ||
93 | |||
94 | prox0_raw_en | ||
95 | RW - enable / disable proximity - uses counting logic | ||
96 | 1 enables the proximity | ||
97 | 0 disables the proximity | ||
98 | |||
99 | prox0_reporting_mode | ||
100 | RW - trigger / periodic. In "trigger" mode the driver tells two possible | ||
101 | values: 0 or prox0_sensor_range value. 0 means no proximity, | ||
102 | 1023 means proximity. This causes minimal number of interrupts. | ||
103 | In "periodic" mode the driver reports all values above | ||
104 | prox0_thresh_above. This causes more interrupts, but it can give | ||
105 | _rough_ estimate about the distance. | ||
106 | |||
107 | prox0_reporting_mode_avail | ||
108 | RO - accepted values to prox0_reporting_mode (trigger, periodic) | ||
109 | |||
110 | prox0_thresh_above_value | ||
111 | RW - threshold level which trigs proximity events. | ||
diff --git a/Documentation/misc-devices/bh1770glc.txt b/Documentation/misc-devices/bh1770glc.txt new file mode 100644 index 000000000000..7d64c014dc70 --- /dev/null +++ b/Documentation/misc-devices/bh1770glc.txt | |||
@@ -0,0 +1,116 @@ | |||
1 | Kernel driver bh1770glc | ||
2 | ======================= | ||
3 | |||
4 | Supported chips: | ||
5 | ROHM BH1770GLC | ||
6 | OSRAM SFH7770 | ||
7 | |||
8 | Data sheet: | ||
9 | Not freely available | ||
10 | |||
11 | Author: | ||
12 | Samu Onkalo <samu.p.onkalo@nokia.com> | ||
13 | |||
14 | Description | ||
15 | ----------- | ||
16 | BH1770GLC and SFH7770 are combined ambient light and proximity sensors. | ||
17 | ALS and proximity parts operates on their own, but they shares common I2C | ||
18 | interface and interrupt logic. In principle they can run on their own, | ||
19 | but ALS side results are used to estimate reliability of the proximity sensor. | ||
20 | |||
21 | ALS produces 16 bit lux values. The chip contains interrupt logic to produce | ||
22 | low and high threshold interrupts. | ||
23 | |||
24 | Proximity part contains IR-led driver up to 3 IR leds. The chip measures | ||
25 | amount of reflected IR light and produces proximity result. Resolution is | ||
26 | 8 bit. Driver supports only one channel. Driver uses ALS results to estimate | ||
27 | reliability of the proximity results. Thus ALS is always running while | ||
28 | proximity detection is needed. | ||
29 | |||
30 | Driver uses threshold interrupts to avoid need for polling the values. | ||
31 | Proximity low interrupt doesn't exists in the chip. This is simulated | ||
32 | by using a delayed work. As long as there is proximity threshold above | ||
33 | interrupts the delayed work is pushed forward. So, when proximity level goes | ||
34 | below the threshold value, there is no interrupt and the delayed work will | ||
35 | finally run. This is handled as no proximity indication. | ||
36 | |||
37 | Chip state is controlled via runtime pm framework when enabled in config. | ||
38 | |||
39 | Calibscale factor is used to hide differences between the chips. By default | ||
40 | value set to neutral state meaning factor of 1.00. To get proper values, | ||
41 | calibrated source of light is needed as a reference. Calibscale factor is set | ||
42 | so that measurement produces about the expected lux value. | ||
43 | |||
44 | SYSFS | ||
45 | ----- | ||
46 | |||
47 | chip_id | ||
48 | RO - shows detected chip type and version | ||
49 | |||
50 | power_state | ||
51 | RW - enable / disable chip. Uses counting logic | ||
52 | 1 enables the chip | ||
53 | 0 disables the chip | ||
54 | |||
55 | lux0_input | ||
56 | RO - measured lux value | ||
57 | sysfs_notify called when threshold interrupt occurs | ||
58 | |||
59 | lux0_sensor_range | ||
60 | RO - lux0_input max value | ||
61 | |||
62 | lux0_rate | ||
63 | RW - measurement rate in Hz | ||
64 | |||
65 | lux0_rate_avail | ||
66 | RO - supported measurement rates | ||
67 | |||
68 | lux0_thresh_above_value | ||
69 | RW - HI level threshold value. All results above the value | ||
70 | trigs an interrupt. 65535 (i.e. sensor_range) disables the above | ||
71 | interrupt. | ||
72 | |||
73 | lux0_thresh_below_value | ||
74 | RW - LO level threshold value. All results below the value | ||
75 | trigs an interrupt. 0 disables the below interrupt. | ||
76 | |||
77 | lux0_calibscale | ||
78 | RW - calibration value. Set to neutral value by default. | ||
79 | Output results are multiplied with calibscale / calibscale_default | ||
80 | value. | ||
81 | |||
82 | lux0_calibscale_default | ||
83 | RO - neutral calibration value | ||
84 | |||
85 | prox0_raw | ||
86 | RO - measured proximity value | ||
87 | sysfs_notify called when threshold interrupt occurs | ||
88 | |||
89 | prox0_sensor_range | ||
90 | RO - prox0_raw max value | ||
91 | |||
92 | prox0_raw_en | ||
93 | RW - enable / disable proximity - uses counting logic | ||
94 | 1 enables the proximity | ||
95 | 0 disables the proximity | ||
96 | |||
97 | prox0_thresh_above_count | ||
98 | RW - number of proximity interrupts needed before triggering the event | ||
99 | |||
100 | prox0_rate_above | ||
101 | RW - Measurement rate (in Hz) when the level is above threshold | ||
102 | i.e. when proximity on has been reported. | ||
103 | |||
104 | prox0_rate_below | ||
105 | RW - Measurement rate (in Hz) when the level is below threshold | ||
106 | i.e. when proximity off has been reported. | ||
107 | |||
108 | prox0_rate_avail | ||
109 | RO - Supported proximity measurement rates in Hz | ||
110 | |||
111 | prox0_thresh_above0_value | ||
112 | RW - threshold level which trigs proximity events. | ||
113 | Filtered by persistence filter (prox0_thresh_above_count) | ||
114 | |||
115 | prox0_thresh_above1_value | ||
116 | RW - threshold level which trigs event immediately | ||