Skip to content

Commit bd6e844

Browse files
mchehabgregkh
authored andcommitted
docs: ABI: sysfs-class-backlight: unify ABI documentation
Both adp8860 and adp8870 define some extensions to the backlight class. This causes warnings: Warning: /sys/class/backlight/<backlight>/ambient_light_level is defined 2 times: /sys/class/backlight/<backlight>/ambient_light_level:8 /sys/class/backlight/<backlight>/ambient_light_level:30 Warning: /sys/class/backlight/<backlight>/ambient_light_zone is defined 2 times: /sys/class/backlight/<backlight>/ambient_light_zone:18 /sys/class/backlight/<backlight>/ambient_light_zone:40 As ABI definitions shouldn't be duplicated. Unfortunately, the ABI is dependent on the specific device features. As such, ambient_light_level range is somewhat different among the supported devices. The ambient_light_zone is even worse: the meanings of each preset are different, and there's no ABI to retrieve the supported types nor their meanins. Unfortunately, it is too late to fix it without causing regressions, as this has been used since Kernel v2.6.35. Rewrite those ABI documentation using the current documentation as a reference, and double-checking at the datasheets: https://www.analog.com/media/en/technical-documentation/data-sheets/ADP8870.pdf https://www.analog.com/media/en/technical-documentation/data-sheets/ADP8860.pdf in order to properly document the differences between those two drivers. Acked-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Link: https://lore.kernel.org/r/342195ad5a819d9bcfcebc133c77ab69b4211672.1604042072.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 1b3023e commit bd6e844

3 files changed

Lines changed: 65 additions & 46 deletions

File tree

Documentation/ABI/testing/sysfs-class-backlight

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,63 @@ Description:
2424
non-linear
2525
The brightness changes non-linearly with each step. Brightness
2626
controls should use a linear mapping for a linear perception.
27+
28+
What: /sys/class/backlight/<backlight>/ambient_light_level
29+
Date: Apr, 2010
30+
KernelVersion: v2.6.35
31+
Contact: Michael Hennerich <michael.hennerich@analog.com>
32+
Description:
33+
(RO) Get conversion value of the light sensor.
34+
35+
The value is automatically updated every 80 ms when the
36+
light sensor is enabled.
37+
38+
The value range is device-driver specific:
39+
40+
For ADP8870:
41+
42+
It returns integer between 0 (dark) and 8000 (max ambient
43+
brightness).
44+
45+
For ADP8860:
46+
47+
It returns a 13-bits integer.
48+
49+
What: /sys/class/backlight/<backlight>/ambient_light_zone
50+
Date: Apr, 2010
51+
KernelVersion: v2.6.35
52+
Contact: Michael Hennerich <michael.hennerich@analog.com>,
53+
device-drivers-devel@blackfin.uclinux.org
54+
55+
Description:
56+
(RW) Read or write the specific brightness level at which the
57+
backlight operates.
58+
59+
The value meaning is device-driver specific:
60+
61+
For ADP8860:
62+
63+
== ==========================
64+
0 Off: Backlight set to 0 mA
65+
1 Level 1: daylight
66+
2 Level 2: bright
67+
3 Level 3: dark
68+
== ==========================
69+
70+
For ADP8870:
71+
72+
== ==========================
73+
0 Off: Backlight set to 0 mA
74+
1 Level 1: daylight
75+
2 Level 2: bright
76+
3 Level 3: office
77+
4 Level 4: indoor
78+
5 Level 5: dark
79+
== ==========================
80+
81+
Writing 0 returns to normal/automatic ambient light level
82+
operation.
83+
84+
It can be enabled by writing the value stored in
85+
/sys/class/backlight/<backlight>/max_brightness to
86+
/sys/class/backlight/<backlight>/brightness.

Documentation/ABI/testing/sysfs-class-backlight-adp8860

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,8 @@ adp8860, adp8861 and adp8863 devices: daylight (level 1), office (level 2) and
66
dark (level 3). By default the brightness operates at the daylight brightness
77
level.
88

9-
What: /sys/class/backlight/<backlight>/ambient_light_level
10-
Date: Apr, 2010
11-
KernelVersion: v2.6.35
12-
Contact: Michael Hennerich <michael.hennerich@analog.com>
13-
Description:
14-
(RO) 13-bit conversion value for the first light sensor—high
15-
byte (Bit 12 to Bit 8). The value is updated every 80 ms (when
16-
the light sensor is enabled).
17-
18-
19-
What: /sys/class/backlight/<backlight>/ambient_light_zone
20-
Date: Apr, 2010
21-
KernelVersion: v2.6.35
22-
Contact: Michael Hennerich <michael.hennerich@analog.com>
23-
Description:
24-
(RW) Read or write the specific level at which the backlight
25-
operates. Value "0" enables automatic ambient light sensing, and
26-
values "1", "2" or "3" set the control to daylight, office or
27-
dark respectively.
9+
See also /sys/class/backlight/<backlight>/ambient_light_level and
10+
/sys/class/backlight/<backlight>/ambient_light_zone.
2811

2912

3013
What: /sys/class/backlight/<backlight>/l1_daylight_max
Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
See also /sys/class/backlight/<backlight>/ambient_light_level and
2+
/sys/class/backlight/<backlight>/ambient_light_zone.
3+
14
What: /sys/class/backlight/<backlight>/<ambient light zone>_max
25
What: /sys/class/backlight/<backlight>/l1_daylight_max
36
What: /sys/class/backlight/<backlight>/l2_bright_max
@@ -27,30 +30,3 @@ Description:
2730
set to 0. Full off when the backlight is disabled.
2831
This file will also show the dim brightness level stored for
2932
this <ambient light zone>.
30-
31-
What: /sys/class/backlight/<backlight>/ambient_light_level
32-
Date: May 2011
33-
KernelVersion: 3.0
34-
Contact: device-drivers-devel@blackfin.uclinux.org
35-
Description:
36-
Get conversion value of the light sensor.
37-
This value is updated every 80 ms (when the light sensor
38-
is enabled). Returns integer between 0 (dark) and
39-
8000 (max ambient brightness)
40-
41-
What: /sys/class/backlight/<backlight>/ambient_light_zone
42-
Date: May 2011
43-
KernelVersion: 3.0
44-
Contact: device-drivers-devel@blackfin.uclinux.org
45-
Description:
46-
Get/Set current ambient light zone. Reading returns
47-
integer between 1..5 (1 = daylight, 2 = bright, ..., 5 = dark).
48-
Writing a value between 1..5 forces the backlight controller
49-
to enter the corresponding ambient light zone.
50-
Writing 0 returns to normal/automatic ambient light level
51-
operation. The ambient light sensing feature on these devices
52-
is an extension to the API documented in
53-
Documentation/ABI/stable/sysfs-class-backlight.
54-
It can be enabled by writing the value stored in
55-
/sys/class/backlight/<backlight>/max_brightness to
56-
/sys/class/backlight/<backlight>/brightness.

0 commit comments

Comments
 (0)