Sean Anderson | 985c567 | 2021-04-20 10:50:57 -0400 | [diff] [blame] | 1 | GPIO-based Sysinfo device |
| 2 | |
| 3 | This binding describes several GPIOs which specify a board revision. Each GPIO |
| 4 | forms a digit in a ternary revision number. This revision is then mapped to a |
| 5 | name using the revisions and names properties. |
| 6 | |
| 7 | Each GPIO may be floating, pulled-up, or pulled-down, mapping to digits 2, 1, |
| 8 | and 0, respectively. The first GPIO forms the least-significant digit of the |
| 9 | revision. For example, consider the property |
| 10 | |
| 11 | gpios = <&gpio 0>, <&gpio 1>, <&gpio 2>; |
| 12 | |
| 13 | If GPIO 0 is pulled-up, GPIO 1 is pulled-down, and GPIO 2 is floating, then the |
| 14 | revision would be |
| 15 | |
| 16 | 0t201 = 2*9 + 0*3 + 1*3 = 19 |
| 17 | |
| 18 | If instead GPIO 0 is floating, GPIO 1 is pulled-up, and GPIO 2 is pulled-down, |
| 19 | then the revision would be |
| 20 | |
| 21 | 0t012 = 0*9 + 1*3 + 2*1 = 5 |
| 22 | |
| 23 | Required properties: |
| 24 | - compatible: should be "gpio-sysinfo". |
| 25 | - gpios: should be a list of gpios forming the revision number, |
| 26 | least-significant-digit first |
| 27 | - revisions: a list of known revisions; any revisions not present will have the |
| 28 | name "unknown" |
| 29 | - names: the name of each revision in revisions |
| 30 | |
| 31 | Example: |
| 32 | sysinfo { |
| 33 | compatible = "gpio-sysinfo"; |
| 34 | gpios = <&gpio_a 15>, <&gpio_a 16>, <&gpio_a 17>; |
| 35 | revisions = <19>, <5>; |
| 36 | names = "rev_a", "foo"; |
| 37 | }; |