~funderscore blog cgit wiki get in touch
aboutsummaryrefslogtreecommitdiff
blob: b5739d94e9e2df7afafc3a23a3746206cb4087ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
GPIO-based Sysinfo device

This binding describes several GPIOs which specify a board revision. Each GPIO
forms a digit in a ternary revision number. This revision is then mapped to a
name using the revisions and names properties.

Each GPIO may be floating, pulled-up, or pulled-down, mapping to digits 2, 1,
and 0, respectively. The first GPIO forms the least-significant digit of the
revision. For example, consider the property

	gpios = <&gpio 0>, <&gpio 1>, <&gpio 2>;

If GPIO 0 is pulled-up, GPIO 1 is pulled-down, and GPIO 2 is floating, then the
revision would be

	0t201 = 2*9 + 0*3 + 1*3 = 19

If instead GPIO 0 is floating, GPIO 1 is pulled-up, and GPIO 2 is pulled-down,
then the revision would be

	0t012 = 0*9 + 1*3 + 2*1 = 5

Required properties:
- compatible: should be "gpio-sysinfo".
- gpios: should be a list of gpios forming the revision number,
  least-significant-digit first
- revisions: a list of known revisions; any revisions not present will have the
  name "unknown"
- names: the name of each revision in revisions

Example:
sysinfo {
	compatible = "gpio-sysinfo";
	gpios = <&gpio_a 15>, <&gpio_a 16>, <&gpio_a 17>;
	revisions = <19>, <5>;
	names = "rev_a", "foo";
};