1# Copyright (c) 2024 Renesas Electronics Corporation
2# SPDX-License-Identifier: Apache-2.0
3
4description: |
5    The Renesas RA pin controller is a node responsible for controlling
6    pin function selection and pin properties, such as routing a SCI0 RXD
7    to P610.
8
9    The node has the 'pinctrl' node label set in your SoC's devicetree,
10    so you can modify it like this:
11
12      &pinctrl {
13              /* your modifications go here */
14      };
15
16    All device pin configurations should be placed in child nodes of the
17    'pinctrl' node, as shown in this example:
18
19      /* You can put this in places like a board-pinctrl.dtsi file in
20       * your board directory, or a devicetree overlay in your application.
21       */
22
23      /* include pre-defined combinations for the SoC variant used by the board */
24      #include <dt-bindings/pinctrl/renesas/pinctrl-ra.h>
25
26      &pinctrl {
27        /* configuration for the sci0 "default" state */
28          sci0_default: sci0_default {
29          group1 {
30            /* tx */
31            psels = <RA_PSEL(RA_PSEL_SCI_0, 6, 9)>;
32            drive-strength = "medium";
33          };
34          group2 {
35            /* rx */
36            psels = <RA_PSEL(RA_PSEL_SCI_0, 6, 10)>;
37          };
38        };
39      };
40
41    The 'sci0_default' child node encodes the pin configurations for a
42    particular state of a device; in this case, the default (that is, active)
43    state.
44
45    As shown, pin configurations are organized in groups within each child node.
46    Each group can specify a list of pin function selections in the 'psels'
47    property.
48
49    A group can also specify shared pin properties common to all the specified
50    pins, such as the 'input-enable' property in group 2. Here is a list of
51    supported standard pin properties:
52
53    - bias-disable: Disable pull-up/down (default, not required).
54    - bias-pull-up: Enable pull-up resistor.
55    - input-enable: Enable input from the pin.
56    - drive-strength: Set the drive strength of the pin. Possible
57      values are: low, medium, highspeed-high, high.
58
59    To link pin configurations with a device, use a pinctrl-N property for some
60    number N, like this example you could place in your board's DTS file:
61
62       #include "board-pinctrl.dtsi"
63
64       &sci0 {
65             pinctrl-0 = <&uart0_default>;
66             pinctrl-1 = <&uart0_sleep>;
67             pinctrl-names = "default", "sleep";
68       };
69
70compatible: "renesas,ra-pinctrl-pfs"
71
72include: base.yaml
73
74child-binding:
75  description: |
76    Definitions for a pinctrl state.
77  child-binding:
78
79    include:
80      - name: pincfg-node.yaml
81        property-allowlist:
82          - bias-disable
83          - bias-pull-up
84          - input-enable
85          - drive-open-drain
86
87    properties:
88      psels:
89        required: true
90        type: array
91        description: |
92          An array of pins sharing the same group properties. Each
93          element of the array is an integer constructed from the
94          pin number and the alternative function of the pin.
95      drive-strength:
96        type: string
97        enum:
98          - "low"
99          - "medium"
100          - "highspeed-high"
101          - "high"
102        default: "low"
103        description: |
104          The drive strength of a pin. The default value is low, as this
105          is the power on reset value.
106      renesas,analog-enable:
107        type: boolean
108        description: enable analog input
109