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) sate. 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 55 To link pin configurations with a device, use a pinctrl-N property for some 56 number N, like this example you could place in your board's DTS file: 57 58 #include "board-pinctrl.dtsi" 59 60 &can0 { 61 pinctrl-0 = <&can0_data_a_tx_default &can0_data_a_rx_default>; 62 pinctrl-1 = <&can0_data_a_tx_sleep &can0_data_a_rx_sleep>; 63 pinctrl-names = "default", "sleep"; 64 }; 65 66compatible: "renesas,rcar-pfc" 67 68include: base.yaml 69 70properties: 71 reg: 72 required: true 73 74child-binding: 75 description: | 76 This binding gives a base representation of the R-Car pins configuration. 77 78 include: 79 - name: pincfg-node.yaml 80 property-allowlist: 81 - bias-disable 82 - bias-pull-down 83 - bias-pull-up 84 - drive-strength 85 86 properties: 87 pin: 88 type: array 89 required: true 90 description: | 91 The array is expected to have up to two elements. The first element is 92 the pin the second optional element is the pin function. 93 drive-strength: 94 enum: [3, 6, 9, 12, 15, 18, 21, 24] 95