1# Copyright (c) 2021 IoT.bzh
2# SPDX-License-Identifier: Apache-2.0
3
4description: |
5    Renesas R-Car Pin Function Controller node
6    This binding gives a base representation of the R-Car pins configuration.
7    The R-Car pin controller is a singleton node responsible for controlling
8    pin function selection and pin properties. For example, you can use this
9    node to route CAN0 TX A to pin 'RD', and enable pull-up resistor as well
10    as driving ability.
11
12    The node has the 'pfc' node label set in your SoC's devicetree, so you can
13    modify it like this:
14
15    &pfc {
16         /* your modifications go here */
17    };
18
19    All device pin configurations should be placed in child nodes of the
20    'pfc' node, as shown in this example:
21      /* You can put this in places like a board-pinctrl.dtsi file in
22       * your board directory, or a devicetree overlay in your application.
23       */
24
25      /* include pre-defined pins and functions for the SoC used by the board */
26      #include <dt-bindings/pinctrl/renesas/pinctrl-r8a77951.h>
27
28      &pfc {
29        /* configuration for can0 data a tx default state */
30        can0_data_a_tx_default: can0_data_a_tx_default {
31          /* configure PIN_RD as FUNC_CAN0_TX_A */
32          pin = <PIN_RD FUNC_CAN0_TX_A>;
33        };
34        /* configuration for can0 data a rx default state */
35        can0_data_a_rx_default: can0_data_a_rx_default {
36          /* configure PIN_RD_WR as FUNC_CAN0_RX_A */
37          pin = <PIN_RD_WR FUNC_CAN0_RX_A>;
38        };
39      };
40
41    The 'can0_data_a_tx_default' child node encodes the pin configurations
42    for a particular state of a device; in this case, the default
43    (that is, active) state. You would specify the low-power configuration for
44    the same device in a separate child node.
45
46    A pin configuration can also specify pin properties such as the
47    'bias-pull-up' property. Here is a list of supported standard pin
48    properties:
49
50    - bias-disable
51    - bias-pull-down
52    - bias-pull-up
53    - drive-strength
54    - power-source
55
56    To link pin configurations with a device, use a pinctrl-N property for some
57    number N, like this example you could place in your board's DTS file:
58
59      #include "board-pinctrl.dtsi"
60
61      &can0 {
62        pinctrl-0 = <&can0_data_a_tx_default &can0_data_a_rx_default>;
63        pinctrl-1 = <&can0_data_a_tx_sleep &can0_data_a_rx_sleep>;
64        pinctrl-names = "default", "sleep";
65      };
66
67compatible: "renesas,rcar-pfc"
68
69include: base.yaml
70
71properties:
72  reg:
73    required: true
74
75child-binding:
76  description: |
77     This binding gives a base representation of the R-Car pins configuration.
78
79  include:
80    - name: pincfg-node.yaml
81      property-allowlist:
82        - bias-disable
83        - bias-pull-down
84        - bias-pull-up
85        - drive-strength
86        - power-source
87
88  properties:
89    pin:
90      type: array
91      required: true
92      description: |
93        The array is expected to have up to two elements. The first element is
94        the pin the second optional element is the pin function.
95    drive-strength:
96      enum: [3, 6, 9, 12, 15, 18, 21, 24]
97