···11+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)22+%YAML 1.233+---44+$id: http://devicetree.org/schemas/pinctrl/renesas,rzg2l-pinctrl.yaml#55+$schema: http://devicetree.org/meta-schemas/core.yaml#66+77+title: Renesas RZ/G2L combined Pin and GPIO controller88+99+maintainers:1010+ - Geert Uytterhoeven <geert+renesas@glider.be>1111+ - Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>1212+1313+description:1414+ The Renesas SoCs of the RZ/G2L series feature a combined Pin and GPIO1515+ controller.1616+ Pin multiplexing and GPIO configuration is performed on a per-pin basis.1717+ Each port features up to 8 pins, each of them configurable for GPIO function1818+ (port mode) or in alternate function mode.1919+ Up to 8 different alternate function modes exist for each single pin.2020+2121+properties:2222+ compatible:2323+ enum:2424+ - renesas,r9a07g044-pinctrl # RZ/G2{L,LC}2525+2626+ reg:2727+ maxItems: 12828+2929+ gpio-controller: true3030+3131+ '#gpio-cells':3232+ const: 23333+ description:3434+ The first cell contains the global GPIO port index, constructed using the3535+ RZG2L_GPIO() helper macro in <dt-bindings/pinctrl/rzg2l-pinctrl.h> and the3636+ second cell represents consumer flag as mentioned in ../gpio/gpio.txt3737+ E.g. "RZG2L_GPIO(39, 1)" for P39_1.3838+3939+ gpio-ranges:4040+ maxItems: 14141+4242+ clocks:4343+ maxItems: 14444+4545+ power-domains:4646+ maxItems: 14747+4848+ resets:4949+ items:5050+ - description: GPIO_RSTN signal5151+ - description: GPIO_PORT_RESETN signal5252+ - description: GPIO_SPARE_RESETN signal5353+5454+additionalProperties:5555+ anyOf:5656+ - type: object5757+ allOf:5858+ - $ref: pincfg-node.yaml#5959+ - $ref: pinmux-node.yaml#6060+6161+ description:6262+ Pin controller client devices use pin configuration subnodes (children6363+ and grandchildren) for desired pin configuration.6464+ Client device subnodes use below standard properties.6565+6666+ properties:6767+ phandle: true6868+ pinmux:6969+ description:7070+ Values are constructed from GPIO port number, pin number, and7171+ alternate function configuration number using the RZG2L_PORT_PINMUX()7272+ helper macro in <dt-bindings/pinctrl/rzg2l-pinctrl.h>.7373+ pins: true7474+ drive-strength:7575+ enum: [ 2, 4, 8, 12 ]7676+ power-source:7777+ enum: [ 1800, 2500, 3300 ]7878+ slew-rate: true7979+ gpio-hog: true8080+ gpios: true8181+ input-enable: true8282+ output-high: true8383+ output-low: true8484+ line-name: true8585+8686+ - type: object8787+ properties:8888+ phandle: true8989+9090+ additionalProperties:9191+ $ref: "#/additionalProperties/anyOf/0"9292+9393+required:9494+ - compatible9595+ - reg9696+ - gpio-controller9797+ - '#gpio-cells'9898+ - gpio-ranges9999+ - clocks100100+ - power-domains101101+ - resets102102+103103+examples:104104+ - |105105+ #include <dt-bindings/pinctrl/rzg2l-pinctrl.h>106106+ #include <dt-bindings/clock/r9a07g044-cpg.h>107107+108108+ pinctrl: pinctrl@11030000 {109109+ compatible = "renesas,r9a07g044-pinctrl";110110+ reg = <0x11030000 0x10000>;111111+112112+ gpio-controller;113113+ #gpio-cells = <2>;114114+ gpio-ranges = <&pinctrl 0 0 392>;115115+ clocks = <&cpg CPG_MOD R9A07G044_GPIO_HCLK>;116116+ resets = <&cpg R9A07G044_GPIO_RSTN>,117117+ <&cpg R9A07G044_GPIO_PORT_RESETN>,118118+ <&cpg R9A07G044_GPIO_SPARE_RESETN>;119119+ power-domains = <&cpg>;120120+121121+ scif0_pins: serial0 {122122+ pinmux = <RZG2L_PORT_PINMUX(38, 0, 1)>, /* Tx */123123+ <RZG2L_PORT_PINMUX(38, 1, 1)>; /* Rx */124124+ };125125+126126+ i2c1_pins: i2c1 {127127+ pins = "RIIC1_SDA", "RIIC1_SCL";128128+ input-enable;129129+ };130130+131131+ sd1-pwr-en-hog {132132+ gpio-hog;133133+ gpios = <RZG2L_GPIO(39, 2) 0>;134134+ output-high;135135+ line-name = "sd1_pwr_en";136136+ };137137+138138+ sdhi1_pins: sd1 {139139+ sd1_mux {140140+ pinmux = <RZG2L_PORT_PINMUX(19, 0, 1)>, /* CD */141141+ <RZG2L_PORT_PINMUX(19, 1, 1)>; /* WP */142142+ power-source = <3300>;143143+ };144144+145145+ sd1_data {146146+ pins = "SD1_DATA0", "SD1_DATA1", "SD1_DATA2", "SD1_DATA3";147147+ power-source = <3300>;148148+ };149149+150150+ sd1_ctrl {151151+ pins = "SD1_CLK", "SD1_CMD";152152+ power-source = <3300>;153153+ };154154+ };155155+ };
+11
drivers/pinctrl/renesas/Kconfig
···3737 select PINCTRL_PFC_R8A77990 if ARCH_R8A779903838 select PINCTRL_PFC_R8A77995 if ARCH_R8A779953939 select PINCTRL_PFC_R8A779A0 if ARCH_R8A779A04040+ select PINCTRL_RZG2L if ARCH_R9A07G0444041 select PINCTRL_PFC_SH7203 if CPU_SUBTYPE_SH72034142 select PINCTRL_PFC_SH7264 if CPU_SUBTYPE_SH72644243 select PINCTRL_PFC_SH7269 if CPU_SUBTYPE_SH7269···176175 select GPIOLIB177176 help178177 This selects GPIO and pinctrl driver for Renesas RZ/A2 platforms.178178+179179+config PINCTRL_RZG2L180180+ bool "pin control support for RZ/G2L" if COMPILE_TEST181181+ depends on OF182182+ select GPIOLIB183183+ select GENERIC_PINCTRL_GROUPS184184+ select GENERIC_PINMUX_FUNCTIONS185185+ select GENERIC_PINCONF186186+ help187187+ This selects GPIO and pinctrl driver for Renesas RZ/G2L platforms.179188180189config PINCTRL_PFC_R8A77470181190 bool "pin control support for RZ/G1C" if COMPILE_TEST
···11+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */22+/*33+ * This header provides constants for Renesas RZ/G2L family pinctrl bindings.44+ *55+ * Copyright (C) 2021 Renesas Electronics Corp.66+ *77+ */88+99+#ifndef __DT_BINDINGS_RZG2L_PINCTRL_H1010+#define __DT_BINDINGS_RZG2L_PINCTRL_H1111+1212+#define RZG2L_PINS_PER_PORT 81313+1414+/*1515+ * Create the pin index from its bank and position numbers and store in1616+ * the upper 16 bits the alternate function identifier1717+ */1818+#define RZG2L_PORT_PINMUX(b, p, f) ((b) * RZG2L_PINS_PER_PORT + (p) | ((f) << 16))1919+2020+/* Convert a port and pin label to its global pin index */2121+ #define RZG2L_GPIO(port, pin) ((port) * RZG2L_PINS_PER_PORT + (pin))2222+2323+#endif /* __DT_BINDINGS_RZG2L_PINCTRL_H */