Skip to content

Commit 4449529

Browse files
Johan Jonkerbrgl
authored andcommitted
dt-bindings: gpio: add YAML description for rockchip,gpio-bank
Current dts files with "rockchip,gpio-bank" subnodes are manually verified. In order to automate this process the text that describes the compatible in rockchip,pinctrl.txt is removed and converted to YAML in rockchip,gpio-bank.yaml. Signed-off-by: Johan Jonker <[email protected]> Reviewed-by: Rob Herring <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent e29eaf1 commit 4449529

File tree

2 files changed

+83
-57
lines changed

2 files changed

+83
-57
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/gpio/rockchip,gpio-bank.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Rockchip GPIO bank
8+
9+
maintainers:
10+
- Heiko Stuebner <[email protected]>
11+
12+
properties:
13+
compatible:
14+
enum:
15+
- rockchip,gpio-bank
16+
- rockchip,rk3188-gpio-bank0
17+
18+
reg:
19+
maxItems: 1
20+
21+
interrupts:
22+
maxItems: 1
23+
24+
clocks:
25+
maxItems: 1
26+
27+
gpio-controller: true
28+
29+
"#gpio-cells":
30+
const: 2
31+
32+
interrupt-controller: true
33+
34+
"#interrupt-cells":
35+
const: 2
36+
37+
required:
38+
- compatible
39+
- reg
40+
- interrupts
41+
- clocks
42+
- gpio-controller
43+
- "#gpio-cells"
44+
- interrupt-controller
45+
- "#interrupt-cells"
46+
47+
additionalProperties: false
48+
49+
examples:
50+
- |
51+
#include <dt-bindings/interrupt-controller/arm-gic.h>
52+
pinctrl: pinctrl {
53+
#address-cells = <1>;
54+
#size-cells = <1>;
55+
ranges;
56+
57+
gpio0: gpio@2000a000 {
58+
compatible = "rockchip,rk3188-gpio-bank0";
59+
reg = <0x2000a000 0x100>;
60+
interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>;
61+
clocks = <&clk_gates8 9>;
62+
63+
gpio-controller;
64+
#gpio-cells = <2>;
65+
66+
interrupt-controller;
67+
#interrupt-cells = <2>;
68+
};
69+
70+
gpio1: gpio@2003c000 {
71+
compatible = "rockchip,gpio-bank";
72+
reg = <0x2003c000 0x100>;
73+
interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>;
74+
clocks = <&clk_gates8 10>;
75+
76+
gpio-controller;
77+
#gpio-cells = <2>;
78+
79+
interrupt-controller;
80+
#interrupt-cells = <2>;
81+
};
82+
};

Documentation/devicetree/bindings/pinctrl/rockchip,pinctrl.txt

Lines changed: 1 addition & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -50,23 +50,7 @@ Deprecated properties for iomux controller:
5050
Use rockchip,grf and rockchip,pmu described above instead.
5151

5252
Required properties for gpio sub nodes:
53-
- compatible: "rockchip,gpio-bank"
54-
- reg: register of the gpio bank (different than the iomux registerset)
55-
- interrupts: base interrupt of the gpio bank in the interrupt controller
56-
- clocks: clock that drives this bank
57-
- gpio-controller: identifies the node as a gpio controller and pin bank.
58-
- #gpio-cells: number of cells in GPIO specifier. Since the generic GPIO
59-
binding is used, the amount of cells must be specified as 2. See generic
60-
GPIO binding documentation for description of particular cells.
61-
- interrupt-controller: identifies the controller node as interrupt-parent.
62-
- #interrupt-cells: the value of this property should be 2 and the interrupt
63-
cells should use the standard two-cell scheme described in
64-
bindings/interrupt-controller/interrupts.txt
65-
66-
Deprecated properties for gpio sub nodes:
67-
- compatible: "rockchip,rk3188-gpio-bank0"
68-
- reg: second element: separate pull register for rk3188 bank0, use
69-
rockchip,pmu described above instead
53+
See rockchip,gpio-bank.yaml
7054

7155
Required properties for pin configuration node:
7256
- rockchip,pins: 3 integers array, represents a group of pins mux and config
@@ -127,43 +111,3 @@ uart2: serial@20064000 {
127111
pinctrl-names = "default";
128112
pinctrl-0 = <&uart2_xfer>;
129113
};
130-
131-
Example for rk3188:
132-
133-
pinctrl@20008000 {
134-
compatible = "rockchip,rk3188-pinctrl";
135-
rockchip,grf = <&grf>;
136-
rockchip,pmu = <&pmu>;
137-
#address-cells = <1>;
138-
#size-cells = <1>;
139-
ranges;
140-
141-
gpio0: gpio0@2000a000 {
142-
compatible = "rockchip,rk3188-gpio-bank0";
143-
reg = <0x2000a000 0x100>;
144-
interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>;
145-
clocks = <&clk_gates8 9>;
146-
147-
gpio-controller;
148-
#gpio-cells = <2>;
149-
150-
interrupt-controller;
151-
#interrupt-cells = <2>;
152-
};
153-
154-
gpio1: gpio1@2003c000 {
155-
compatible = "rockchip,gpio-bank";
156-
reg = <0x2003c000 0x100>;
157-
interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>;
158-
clocks = <&clk_gates8 10>;
159-
160-
gpio-controller;
161-
#gpio-cells = <2>;
162-
163-
interrupt-controller;
164-
#interrupt-cells = <2>;
165-
};
166-
167-
...
168-
169-
};

0 commit comments

Comments
 (0)