From patchwork Tue May 31 22:19:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= X-Patchwork-Id: 12866230 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 7C971C433F5 for ; Tue, 31 May 2022 22:20:33 +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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=p3QxA2ECJJK9wyrWeSweWzuzriuRotereIjxZOactZM=; b=pNsUSvCQsGuAew IFX0aMs9LQ590Qa4J43BOubdwquIlv5L4RirEZI71CeEuQR4jqNm6ZJHduaksxHG2xGa44UJbL0fS tAB8jC6QgS8vDzzUS3SdV/owmpR0Hem+tZJtjvupGdxkyQC5CIxzpQJKFmFaTF9yh2bXxVG+6hnp+ aWX2JjUUPAbkdRoh4kDrv5pGO3vBEU/QWbFdDtozy7EToezwXzyXloagOEiiCwNjHM1qXOFijBErw n0F9+v9OqhoMduYnmGks6vV5i4V7bpbjp13LYbOdU9RK2njRo7B/DZMijHL5iMAx59gShucN+qfQm NrXwI7DzSMa/orCqI3hA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwADw-00Cpag-1h; Tue, 31 May 2022 22:20:24 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwADb-00CpWH-G7; Tue, 31 May 2022 22:20:05 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: nfraprado) with ESMTPSA id 90A671F43F1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1654035601; bh=dqvPbD0+LyE8BrCyvcj4tkNdD3HuNjmZ6QAi2jlf4lY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KUux18MMXlb51shdebtxX+3nedmXE19+HQ65ny3FB5b7mvKStmQbMrQrhnRE6giNC /EMiebD2qDDTbz1uEfP9PCMOJXrSyMrTSIAEJT7i/paBPNcZRTtQxKlPl8G8FjsNAb ytuWmbomZTbqlPaqDBdFow89+M6nIrqE1cRPhnftfQ6jWYO7Ch9jue4Gu1P57Y9091 8TLKZ6Ph4C3kZw/UDE2Sc/StNoAY+0oCu/YiiqK4BFgWZyvAX1ETJ8+YV9OBkksNFz kZx8duSUqP7ZGjSPdSrocuIGABHGsAwWktMdgZG7Pxyl+ElW8UKdsASUU6scbTxBxF gXyofvy9WtO6g== From: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= To: Linus Walleij Cc: AngeloGioacchino Del Regno , kernel@collabora.com, =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= , Krzysztof Kozlowski , Matthias Brugger , Rob Herring , Sean Wang , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH v2 1/2] dt-bindings: pinctrl: mt8192: Switch drive-strength-adv for -microamp Date: Tue, 31 May 2022 18:19:53 -0400 Message-Id: <20220531221954.160036-2-nfraprado@collabora.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220531221954.160036-1-nfraprado@collabora.com> References: <20220531221954.160036-1-nfraprado@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220531_152003_797729_108E566E X-CRM114-Status: GOOD ( 13.99 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Commit e5fabbe43f3f ("pinctrl: mediatek: paris: Support generic PIN_CONFIG_DRIVE_STRENGTH_UA") added support for using drive-strength-microamp instead of mediatek,drive-strength-adv. Since there aren't any users of mediatek,drive-strength-adv on mt8192 yet, remove this property and add drive-strength-microamp in its place, which has a clearer meaning. While at it, add a new 'if' block to validate that drive-strength and drive-strength-microamp aren't used together, since they're mutually exclusive. Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: Rob Herring Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: Rob Herring Reviewed-by: AngeloGioacchino Del Regno < --- Changes in v2: - Added 'if' block to make drive-strength and drive-strength-microamp mutually exclusive - Changed commit title to be more precise - Dropped Fixes tag .../bindings/pinctrl/pinctrl-mt8192.yaml | 35 ++++++------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-mt8192.yaml b/Documentation/devicetree/bindings/pinctrl/pinctrl-mt8192.yaml index c90a132fbc79..c8092b218f2f 100644 --- a/Documentation/devicetree/bindings/pinctrl/pinctrl-mt8192.yaml +++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-mt8192.yaml @@ -80,31 +80,8 @@ patternProperties: dt-bindings/pinctrl/mt65xx.h. It can only support 2/4/6/8/10/12/14/16mA in mt8192. enum: [2, 4, 6, 8, 10, 12, 14, 16] - mediatek,drive-strength-adv: - description: | - Describe the specific driving setup property. - For I2C pins, the existing generic driving setup can only support - 2/4/6/8/10/12/14/16mA driving. But in specific driving setup, they - can support 0.125/0.25/0.5/1mA adjustment. If we enable specific - driving setup, the existing generic setup will be disabled. - The specific driving setup is controlled by E1E0EN. - When E1=0/E0=0, the strength is 0.125mA. - When E1=0/E0=1, the strength is 0.25mA. - When E1=1/E0=0, the strength is 0.5mA. - When E1=1/E0=1, the strength is 1mA. - EN is used to enable or disable the specific driving setup. - Valid arguments are described as below: - 0: (E1, E0, EN) = (0, 0, 0) - 1: (E1, E0, EN) = (0, 0, 1) - 2: (E1, E0, EN) = (0, 1, 0) - 3: (E1, E0, EN) = (0, 1, 1) - 4: (E1, E0, EN) = (1, 0, 0) - 5: (E1, E0, EN) = (1, 0, 1) - 6: (E1, E0, EN) = (1, 1, 0) - 7: (E1, E0, EN) = (1, 1, 1) - So the valid arguments are from 0 to 7. - $ref: /schemas/types.yaml#/definitions/uint32 - enum: [0, 1, 2, 3, 4, 5, 6, 7] + drive-strength-microamp: + enum: [125, 250, 500, 1000] mediatek,pull-up-adv: description: | @@ -138,6 +115,14 @@ patternProperties: required: - pinmux + allOf: + - if: + required: + - drive-strength-microamp + then: + properties: + drive-strength: false + additionalProperties: false allOf: From patchwork Tue May 31 22:19:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= X-Patchwork-Id: 12866229 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 3C210C433EF for ; Tue, 31 May 2022 22:20:32 +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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=eZ6eLbhPZPAfidB5rD9+Q1xz8+jW9LS8d56JUDnx1f8=; b=N9L5YMxEISgnL5 LWW4ELqykEbcFF+8yqdZeLcEv2FCXTbI8MFWezTXR62rnyZHZ0AJvq3M43B0XzIxkVp4PR1eAsRRv yQ6KtLupR8LORJr+HBCiluxnAsZjO1S2Ocb+obmJ9JiLjh+eUDHwhHarfpmGuWloLp0IrA4+PIa8y /rmM/zo6kWOTte5q3/1/A7XcbpyaRU54HAHhSezc2TljuR/6uFtDThm562RP3lV6CecE1UN5px77M gBpII/0qcaAQbBB4lkegFToVwyXOV3dOBYhmI8Oe0Kz4MjFghBfekJSmLpZrHQgZOPDzhkdQ5rGBs 6Xd4zSD1M16KCrwY+xZw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwADx-00CpbR-Jl; Tue, 31 May 2022 22:20:25 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwADb-00CpWS-VU; Tue, 31 May 2022 22:20:07 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: nfraprado) with ESMTPSA id 5F16E1F43F21 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1654035602; bh=L1LFzcY2SS+Xz1rYP87W08WXZ151oxr1ApyX6lLzl/U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IAn59devWIMazgWA7WDdvX0I0LbRSMtm0nt30y1Udmz5jAZFslhBo9e5n7YK7fr4W IggvPxKYDtv/URk7XK+WQAN4SqG4qSi25nc7+qGTMaj++sWApmbJg1su2ka8Sjpn3m OG6eJnctPu5ooxqe+axl14PPOjy0vt7vd9JTOeJjo5mSV8gSyexL0yRWNnX/Xds+2M krTSzkWItWuGBkyIicZAvO+trl/anG7Wp/mJtZg9t9X/GC3/kHlhX08jFhhV6tBwqJ rGgb3SsajXHC1uAJvTXPGzsaBfDtCbB8OaUf5jBuxeeStzOzDno/l3e+z9Ql+GbHNt NxsgkrV/mPEpQ== From: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= To: Linus Walleij Cc: AngeloGioacchino Del Regno , kernel@collabora.com, =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= , Krzysztof Kozlowski , Matthias Brugger , Rob Herring , Sean Wang , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH v2 2/2] dt-bindings: pinctrl: mt8192: Use generic bias instead of pull-*-adv Date: Tue, 31 May 2022 18:19:54 -0400 Message-Id: <20220531221954.160036-3-nfraprado@collabora.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220531221954.160036-1-nfraprado@collabora.com> References: <20220531221954.160036-1-nfraprado@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220531_152004_205194_FBDAEF32 X-CRM114-Status: GOOD ( 12.82 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Commit cafe19db7751 ("pinctrl: mediatek: Backward compatible to previous Mediatek's bias-pull usage") allowed the bias-pull-up and bias-pull-down properties to be used for setting PUPD/R1/R0 type bias on mtk-paris based SoC's, which was previously only supported by the custom mediatek,pull-up-adv and mediatek,pull-down-adv properties. Since the bias-pull-{up,down} properties already have defines associated thus being more descriptive and is more universal on MediaTek platforms, and given that there are no mediatek,pull-{up,down}-adv users on mt8192 yet, remove the custom adv properties in favor of the generic ones. Note that only mediatek,pull-up-adv was merged in the binding, but not its down counterpart. While at it, also add 'if' blocks to prevent bias-disable, bias-pull-up and bias-pull-down to be used together, since they're mutually exclusive. Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: Rob Herring Reviewed-by: AngeloGioacchino Del Regno --- Changes in v2: - Dropped Fixes tag - Added 'if' blocks to make bias-disable, bias-pull-up and bias-pull-down mutually exclusive .../bindings/pinctrl/pinctrl-mt8192.yaml | 44 +++++++++++++------ 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-mt8192.yaml b/Documentation/devicetree/bindings/pinctrl/pinctrl-mt8192.yaml index c8092b218f2f..6ce7e458d6fe 100644 --- a/Documentation/devicetree/bindings/pinctrl/pinctrl-mt8192.yaml +++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-mt8192.yaml @@ -83,20 +83,21 @@ patternProperties: drive-strength-microamp: enum: [125, 250, 500, 1000] - mediatek,pull-up-adv: - description: | - Pull up settings for 2 pull resistors, R0 and R1. User can - configure those special pins. Valid arguments are described as below: - 0: (R1, R0) = (0, 0) which means R1 disabled and R0 disabled. - 1: (R1, R0) = (0, 1) which means R1 disabled and R0 enabled. - 2: (R1, R0) = (1, 0) which means R1 enabled and R0 disabled. - 3: (R1, R0) = (1, 1) which means R1 enabled and R0 enabled. - $ref: /schemas/types.yaml#/definitions/uint32 - enum: [0, 1, 2, 3] - - bias-pull-down: true - - bias-pull-up: true + bias-pull-down: + oneOf: + - type: boolean + description: normal pull down. + - enum: [100, 101, 102, 103] + description: PUPD/R1/R0 pull down type. See MTK_PUPD_SET_R1R0_ + defines in dt-bindings/pinctrl/mt65xx.h. + + bias-pull-up: + oneOf: + - type: boolean + description: normal pull up. + - enum: [100, 101, 102, 103] + description: PUPD/R1/R0 pull up type. See MTK_PUPD_SET_R1R0_ + defines in dt-bindings/pinctrl/mt65xx.h. bias-disable: true @@ -123,6 +124,21 @@ patternProperties: properties: drive-strength: false + - if: + required: + - bias-disable + then: + properties: + bias-pull-up: false + bias-pull-down: false + + - if: + required: + - bias-pull-up + then: + properties: + bias-pull-down: false + additionalProperties: false allOf: