summaryrefslogtreecommitdiff
path: root/Documentation/devicetree/bindings/pinctrl/loongson,ls2k-pinctrl.yaml
blob: bd8a458435666bbea743a63d774e9dbd168eeb2a (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/loongson,ls2k-pinctrl.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Loongson-2 SoC Pinctrl Controller

maintainers:
  - zhanghongchen <zhanghongchen@loongson.cn>
  - Yinbo Zhu <zhuyinbo@loongson.cn>

allOf:
  - $ref: pinctrl.yaml#

properties:
  compatible:
    const: loongson,ls2k-pinctrl

  reg:
    maxItems: 1

patternProperties:
  '-pins$':
    type: object

    additionalProperties: false

    patternProperties:
      'pinmux$':
        type: object
        description: node for pinctrl.
        $ref: pinmux-node.yaml#

        unevaluatedProperties: false

        properties:
          groups:
            description:
              One or more groups of pins to mux to a certain function
            items:
              enum: [gpio, sdio, can1, can0, pwm3, pwm2, pwm1, pwm0, i2c1, i2c0,
                     nand, sata_led, i2s, hda]
          function:
            description:
              The function that a group of pins is muxed to
            enum: [gpio, sdio, can1, can0, pwm3, pwm2, pwm1, pwm0, i2c1, i2c0,
                   nand, sata_led, i2s, hda]

        required:
          - groups
          - function

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    pctrl: pinctrl@1fe00420 {
        compatible = "loongson,ls2k-pinctrl";
        reg = <0x1fe00420 0x18>;
        sdio_pins_default: sdio-pins {
            sdio-pinmux {
                groups = "sdio";
                function = "sdio";
            };

            sdio-det-pinmux {
                groups = "pwm2";
                function = "gpio";
            };
        };

        pwm1_pins_default: pwm1-pins {
            pinmux {
                groups = "pwm1";
                function = "pwm1";
            };
        };

        pwm0_pins_default: pwm0-pins {
            pinmux {
                groups = "pwm0";
                function = "pwm0";
            };
        };

        i2c1_pins_default: i2c1-pins {
            pinmux {
                groups = "i2c1";
                function = "i2c1";
            };
        };

        i2c0_pins_default: i2c0-pins {
            pinmux {
                groups = "i2c0";
                function = "i2c0";
            };
        };

        nand_pins_default: nand-pins {
            pinmux {
                groups = "nand";
                function = "nand";
            };
        };

        hda_pins_default: hda-pins {
            grp0-pinmux {
                groups = "hda";
                function = "hda";
            };

            grp1-pinmux {
                groups = "i2s";
                function = "gpio";
            };
        };
    };