xref: /freebsd/sys/contrib/device-tree/Bindings/pinctrl/loongson,ls2k-pinctrl.yaml (revision a90b9d0159070121c221b966469c3e36d912bf82)
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/pinctrl/loongson,ls2k-pinctrl.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Loongson-2 SoC Pinctrl Controller
8
9maintainers:
10  - zhanghongchen <zhanghongchen@loongson.cn>
11  - Yinbo Zhu <zhuyinbo@loongson.cn>
12
13allOf:
14  - $ref: pinctrl.yaml#
15
16properties:
17  compatible:
18    const: loongson,ls2k-pinctrl
19
20  reg:
21    maxItems: 1
22
23patternProperties:
24  '-pins$':
25    type: object
26
27    additionalProperties: false
28
29    patternProperties:
30      'pinmux$':
31        type: object
32        description: node for pinctrl.
33        $ref: pinmux-node.yaml#
34
35        unevaluatedProperties: false
36
37        properties:
38          groups:
39            description:
40              One or more groups of pins to mux to a certain function
41            items:
42              enum: [gpio, sdio, can1, can0, pwm3, pwm2, pwm1, pwm0, i2c1, i2c0,
43                     nand, sata_led, i2s, hda]
44          function:
45            description:
46              The function that a group of pins is muxed to
47            enum: [gpio, sdio, can1, can0, pwm3, pwm2, pwm1, pwm0, i2c1, i2c0,
48                   nand, sata_led, i2s, hda]
49
50        required:
51          - groups
52          - function
53
54required:
55  - compatible
56  - reg
57
58additionalProperties: false
59
60examples:
61  - |
62    pctrl: pinctrl@1fe00420 {
63        compatible = "loongson,ls2k-pinctrl";
64        reg = <0x1fe00420 0x18>;
65        sdio_pins_default: sdio-pins {
66            sdio-pinmux {
67                groups = "sdio";
68                function = "sdio";
69            };
70
71            sdio-det-pinmux {
72                groups = "pwm2";
73                function = "gpio";
74            };
75        };
76
77        pwm1_pins_default: pwm1-pins {
78            pinmux {
79                groups = "pwm1";
80                function = "pwm1";
81            };
82        };
83
84        pwm0_pins_default: pwm0-pins {
85            pinmux {
86                groups = "pwm0";
87                function = "pwm0";
88            };
89        };
90
91        i2c1_pins_default: i2c1-pins {
92            pinmux {
93                groups = "i2c1";
94                function = "i2c1";
95            };
96        };
97
98        i2c0_pins_default: i2c0-pins {
99            pinmux {
100                groups = "i2c0";
101                function = "i2c0";
102            };
103        };
104
105        nand_pins_default: nand-pins {
106            pinmux {
107                groups = "nand";
108                function = "nand";
109            };
110        };
111
112        hda_pins_default: hda-pins {
113            grp0-pinmux {
114                groups = "hda";
115                function = "hda";
116            };
117
118            grp1-pinmux {
119                groups = "i2s";
120                function = "gpio";
121            };
122        };
123    };
124