From patchwork Thu Feb 29 11:39:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balakrishnan Sambath X-Patchwork-Id: 13576994 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 38A4EC48BF6 for ; Thu, 29 Feb 2024 11:42:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:CC:To:In-Reply-To:References:Message-ID :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ttqDF0wPQblpzJtmErg8rk3aLoUodabIB2h0WT26NwQ=; b=XHUbCE0asEHewM EC7YIZrms8KfezVlspoeE6/HZtngo/k8eakgigVT5JDIO2cyD9icuOxwf/DqEA/Pa5klmCDiqH+Ha LEhVihRpxUvsBlkOV7z0+R6rNDFiGp2ims2k4NMgKMUi0drN7tb6O3MtD6G+Iz+k+ep9IqoQvKBDH q944SNLgYWGSrBbrEFtmyexSoyyTZQXRHlxJOWjQZCum6Z1xRVcZzVw8SWvB0eRQ3az5f9/2avSDu BorWAgV84TnjnJrIHYsRx1/U3IRsvtRk+7VBjjAeWbJqU70Qe/HVWKzTaqY0PN2MABO5LYv40Y7Vl QPI+P8LpA1NF50B2kM+w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfens-0000000DNYp-2qMf; Thu, 29 Feb 2024 11:42:20 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfeno-0000000DNX1-37KV for linux-arm-kernel@lists.infradead.org; Thu, 29 Feb 2024 11:42:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1709206936; x=1740742936; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=88/nCfzcv/0mBvz7vctQH4WqIZwLFpdPUBRZoFLWORs=; b=PyBQEDXvezec43kPq1LceCHIHt7nDHNDrH2ZgGnTU/5iUz6q/Uzn83x1 1/3ZyIUb4KSg+EYB1e1IlyOmjhQEn4WW6U6F74qraD93p3hAmzRDfR6tM kIEGWQ+0+wDvVYySyivJNmUlGps6poMFpz7/42G5/A1IUFiJ8vONQ/qvy YdWYRpaGbtALJ2Bpg9KsD/2YJ7/jstFwuzdJgR3HFXdfY5RnC+gN4VbQO eIRngVOzVd1wZfqmJdpzJ0Ls+OerNHD9evWZyJ1ok+i4/kX+SSsBQxPib LKOTBUIeyV8z2uDafWH2TDRakqVtQdbiF3vkoLsC+Fp3PfunRCmxkEyeJ A==; X-CSE-ConnectionGUID: d8+oGP1LQdGqNaTtcEJPXQ== X-CSE-MsgGUID: q8U8MYpsRv2FsgSctH5nmA== X-IronPort-AV: E=Sophos;i="6.06,194,1705388400"; d="scan'208";a="247759793" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 29 Feb 2024 04:42:16 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.87.72) by chn-vm-ex02.mchp-main.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 29 Feb 2024 04:41:45 -0700 Received: from [127.0.1.1] (10.10.85.11) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Thu, 29 Feb 2024 04:41:42 -0700 From: Balakrishnan Sambath Date: Thu, 29 Feb 2024 17:09:32 +0530 Subject: [PATCH 3/3] dt-bindings: pinctrl: at91-pio4: convert Atmel's PIO4 bindings to json-schema MIME-Version: 1.0 Message-ID: <20240229-pio4-pinctrl-yaml-v1-3-c4d8279c083f@microchip.com> References: <20240229-pio4-pinctrl-yaml-v1-0-c4d8279c083f@microchip.com> In-Reply-To: <20240229-pio4-pinctrl-yaml-v1-0-c4d8279c083f@microchip.com> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Linus Walleij CC: , , , , "Balakrishnan Sambath" X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240229_034216_882899_81C1BBF2 X-CRM114-Status: GOOD ( 17.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Convert the existing text DT bindings of Atmel's PIO4 pincontroller to yaml based DT schema. Signed-off-by: Balakrishnan Sambath --- .../bindings/pinctrl/atmel,at91-pio4-pinctrl.txt | 98 --------------- .../bindings/pinctrl/atmel,sama5d2-pinctrl.yaml | 140 +++++++++++++++++++++ 2 files changed, 140 insertions(+), 98 deletions(-) diff --git a/Documentation/devicetree/bindings/pinctrl/atmel,at91-pio4-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/atmel,at91-pio4-pinctrl.txt deleted file mode 100644 index 774c3c269c40..000000000000 --- a/Documentation/devicetree/bindings/pinctrl/atmel,at91-pio4-pinctrl.txt +++ /dev/null @@ -1,98 +0,0 @@ -* Atmel PIO4 Controller - -The Atmel PIO4 controller is used to select the function of a pin and to -configure it. - -Required properties: -- compatible: - "atmel,sama5d2-pinctrl" - "microchip,sama7g5-pinctrl" -- reg: base address and length of the PIO controller. -- interrupts: interrupt outputs from the controller, one for each bank. -- interrupt-controller: mark the device node as an interrupt controller. -- #interrupt-cells: should be two. -- gpio-controller: mark the device node as a gpio controller. -- #gpio-cells: should be two. - -Please refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for -a general description of GPIO and interrupt bindings. - -Please refer to pinctrl-bindings.txt in this directory for details of the -common pinctrl bindings used by client devices. - -Subnode format -Each node (or subnode) will list the pins it needs and how to configured these -pins. - - node { - pinmux = ; - GENERIC_PINCONFIG; - }; - -Required properties: -- pinmux: integer array. Each integer represents a pin number plus mux and -ioset settings. Use the macros from boot/dts/-pinfunc.h file to get the -right representation of the pin. - -Optional properties: -- GENERIC_PINCONFIG: generic pinconfig options to use: - - bias-disable, bias-pull-down, bias-pull-up, drive-open-drain, - drive-push-pull input-schmitt-enable, input-debounce, output-low, - output-high. - - for microchip,sama7g5-pinctrl only: - - slew-rate: 0 - disabled, 1 - enabled (default) -- atmel,drive-strength: 0 or 1 for low drive, 2 for medium drive and 3 for -high drive. The default value is low drive. - -Example: - -#include - -... -{ - pioA: pinctrl@fc038000 { - compatible = "atmel,sama5d2-pinctrl"; - reg = <0xfc038000 0x600>; - interrupts = <18 IRQ_TYPE_LEVEL_HIGH 7>, - <68 IRQ_TYPE_LEVEL_HIGH 7>, - <69 IRQ_TYPE_LEVEL_HIGH 7>, - <70 IRQ_TYPE_LEVEL_HIGH 7>; - interrupt-controller; - #interrupt-cells = <2>; - gpio-controller; - #gpio-cells = <2>; - clocks = <&pioA_clk>; - - pinctrl_i2c0_default: i2c0_default { - pinmux = , - ; - bias-disable; - }; - - pinctrl_led_gpio_default: led_gpio_default { - pinmux = , - ; - bias-pull-up; - atmel,drive-strength = ; - }; - - pinctrl_sdmmc1_default: sdmmc1_default { - cmd_data { - pinmux = , - , - , - , - ; - bias-pull-up; - }; - - ck_cd { - pinmux = , - ; - bias-disable; - }; - }; - ... - }; -}; -... diff --git a/Documentation/devicetree/bindings/pinctrl/atmel,sama5d2-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/atmel,sama5d2-pinctrl.yaml new file mode 100644 index 000000000000..8a2dee1d6dd3 --- /dev/null +++ b/Documentation/devicetree/bindings/pinctrl/atmel,sama5d2-pinctrl.yaml @@ -0,0 +1,140 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/pinctrl/atmel,sama5d2-pinctrl.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Microchip PIO4 Controller + +maintainers: + - Balakrishnan Sambath + +description: + The Microchip PIO4 controller is used to select the function of a pin and to + configure it. + + +properties: + compatible: + enum: + - microchip,sama7g5-pinctrl + - atmel,sama5d2-pinctrl + + reg: + minItems: 1 + maxItems: 2 + + interrupts: + description: + Interrupt outputs from the controller, one for each bank. + + interrupt-controller: true + + '#interrupt-cells': + const: 2 + + gpio-controller: true + + '#gpio-cells': + const: 2 + + clocks: + maxItems: 1 +if: + properties: + compatible: + contains: + const: microchip,sama7g5-pinctrl +then: + patternProperties: + '^.*([-_]default)?$': + anyOf: + - $ref: "#/$defs/mchp-pio4-pincfg-node-1" + - patternProperties: + '^[a-z_-][a-z_-]*$': + $ref: "#/$defs/mchp-pio4-pincfg-node-1" +else: + patternProperties: + '^.*([-_]default)?$': + anyOf: + - $ref: "#/$defs/mchp-pio4-pincfg-node-2" + - patternProperties: + '^[a-z_-][a-z_-]*$': + $ref: "#/$defs/mchp-pio4-pincfg-node-2" + +$defs: + mchp-pio4-pincfg-node-1: + $ref: pincfg-node.yaml#properties + properties: + pinmux: + $ref: pinmux-node.yaml#/properties/pinmux + atmel,drive-strength: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [0, 1, 2, 3] + default: 0 + required: + - pinmux + + mchp-pio4-pincfg-node-2: + $ref: pincfg-node.yaml#properties + properties: + pinmux: + $ref: pinmux-node.yaml#/properties/pinmux + required: + - pinmux + +required: + - compatible + - reg + - interrupts + - interrupt-controller + - '#interrupt-cells' + - gpio-controller + - '#gpio-cells' + +unevaluatedProperties: false + +examples: + - | + #include + #include + #include + #include + + pinctrl@fc038000 { + compatible = "atmel,sama5d2-pinctrl"; + reg = <0xfc038000 0x600>; + interrupts = <18 IRQ_TYPE_LEVEL_HIGH 7>, + <68 IRQ_TYPE_LEVEL_HIGH 7>, + <69 IRQ_TYPE_LEVEL_HIGH 7>, + <70 IRQ_TYPE_LEVEL_HIGH 7>; + interrupt-controller; + #interrupt-cells = <2>; + gpio-controller; + #gpio-cells = <2>; + clocks = <&pioA_clk>; + + pinctrl_i2c0_default: i2c0_default { + pinmux = , + ; + bias-disable; + }; + + pinctrl_sdmmc1_default: sdmmc1_default { + cmd_data { + pinmux = , + , + , + , + ; + bias-pull-up; + }; + + ck_cd { + pinmux = , + ; + bias-disable; + }; + }; + }; +...