From patchwork Mon Jan 2 16:06:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Mergnat X-Patchwork-Id: 13086818 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 7F849C4708E for ; Mon, 2 Jan 2023 16:07:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type: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=Z1Ejzbo8UmM+RRLtZtfr7EYdzzjCFq6z/B+dE9yYQdY=; b=gTb5FfelSe6tfZL3tDZsfpLPsN e9t8l5thKsHtVlbs3vRIfvphOGQyjhEJOHlaQxbiwYe3KyOI4p3DwQEPR78Z3INH/bFCfXlcXPtLB BPvKMa+y4ssJPyBZig5smZ50yF3aXhM1rjOR1tpu5CHELYJz4PGW/ShBAw/mbKx6IqYUnLqxzIi6J gbCiydzsbZsuxUOP8YNTkNMeecwwsgGP3mEARxHUHMQaaWPFVqTnq5m8zuHx/kZIAELGKVztJA1yk k4xaghjmDnuXzaAhDBrlOeEwCk8WyXnX2dS5H/Qx1Prsg/bq06MJ0uiNLxON+Fy9EaNpJIdk44mLX keRqYXdw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pCNLT-00CbPh-PB; Mon, 02 Jan 2023 16:07:27 +0000 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pCNKW-00Cb9N-8k for linux-mediatek@lists.infradead.org; Mon, 02 Jan 2023 16:06:33 +0000 Received: by mail-wr1-x430.google.com with SMTP id t15so17845245wro.9 for ; Mon, 02 Jan 2023 08:06:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Z1Ejzbo8UmM+RRLtZtfr7EYdzzjCFq6z/B+dE9yYQdY=; b=No9JDSz+Y49OM+b6tPmLzj2QweOdpcoFFSzCmvawoXirshFsqUnD1Xu4WetS/yw4+g duj9CTGizU20+ntjuDQkwl9Xn4j96loXaC/TAlUl6Bly7RTMhnJDJhr3AJXPPt0b2Mbd Kd9lWtgV1tEDU5itqxUBpEctnnJuFA9/2bhn3Xs/iT0f9E2y9e2Mf+Tpx/iOUDpF/eCL lxXjKSGGGmaqoCwNxUhLpSsGyPZc+1MjUM/WxcInVIqBnBNLnYqfNRnqs4VeQZWKv9Ee d4+lyppNlCY6L16djDwk9DkuIg5a3lE3LZwgTEpWayFrwEkbhjoAPCJazAJuI5bgiIbO VCuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Z1Ejzbo8UmM+RRLtZtfr7EYdzzjCFq6z/B+dE9yYQdY=; b=NjswPRA9yyq7Z4orPAiA2WDDTnTzaMULIq0qrvcyvUwWiQHbq0PPey/ThEdde5eA8G lWOG9q878qvvWvOIYF/OyB/EOUtnIAKN0qddrztRZ3ivZGomffueQVxQnftBUopXsjnc IRvlLwN/MJ/eJvaaRhuZWQtks8ffNQf6DidVGvEk6K2/s8tRLi4zFuuVYhodWfq1n+uk 9uIFhuKNGy2A7EakxQ4685oRFHpel04PKfQaFzsTjhUziWrmlIa2Sinso0mprbiVhgVg +DR1MSlopokSQhfhXS7GiGegoNs5Ow7hCUghpdNwDMMO//GCUEoROMrtyRsZN5DC+Foi QZog== X-Gm-Message-State: AFqh2kq20J2B5Jt2jzWghFqQlqvGwizLGEuKjoTtYoulwCwlBFXNCWRX sbSoFqq9+8OfZF21XjjQ+xTgMg== X-Google-Smtp-Source: AMrXdXuxEvrUSXbBFM0DyHm6IYRAtChmYU0RMMViNTKnBuUwtbB5s46VQ+dmEa+IfKBdMhWFXw+0SA== X-Received: by 2002:adf:f305:0:b0:277:2e27:61f6 with SMTP id i5-20020adff305000000b002772e2761f6mr20644263wro.31.1672675586952; Mon, 02 Jan 2023 08:06:26 -0800 (PST) Received: from [127.0.1.1] (158.22.5.93.rev.sfr.net. [93.5.22.158]) by smtp.googlemail.com with ESMTPSA id t5-20020a5d49c5000000b0028cf987d944sm11868020wrs.33.2023.01.02.08.06.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Jan 2023 08:06:26 -0800 (PST) From: Alexandre Mergnat Date: Mon, 02 Jan 2023 17:06:04 +0100 Subject: [PATCH v8 3/6] dt-bindings: mfd: mediatek: Add bindings for MT6357 PMIC MIME-Version: 1.0 Message-Id: <20221005-mt6357-support-v8-3-560caaafee53@baylibre.com> References: <20221005-mt6357-support-v8-0-560caaafee53@baylibre.com> In-Reply-To: <20221005-mt6357-support-v8-0-560caaafee53@baylibre.com> To: Mark Brown , Tianping Fang , Alessandro Zummo , Dmitry Torokhov , Alexandre Belloni , Fabien Parent , Lee Jones , Krzysztof Kozlowski , Chen Zhong , Pavel Machek , Matthias Brugger , Rob Herring , Sean Wang , Flora Fu , Liam Girdwood Cc: Alexandre Mergnat , Mattijs Korpershoek , Krzysztof Kozlowski , linux-rtc@vger.kernel.org, linux-leds@vger.kernel.org, Rob Herring , devicetree@vger.kernel.org, Fabien Parent , linux-input@vger.kernel.org, linux-mediatek@lists.infradead.org, AngeloGioacchino Del Regno , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.10.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=4087; i=amergnat@baylibre.com; h=from:subject:message-id; bh=d4JaAPJCZ37xGAgh27tDIjEpQgF1gETvJTYcId5mtXE=; b=owEBbQKS/ZANAwAKAStGSZ1+MdRFAcsmYgBjswD8YULwl172j+umCObsG7xMOMV26WGae1CSKyuG mG3nsiSJAjMEAAEKAB0WIQQjG17X8+qqcA5g/osrRkmdfjHURQUCY7MA/AAKCRArRkmdfjHURWG8D/ 9p0CKHuKHFaz7McPKXm+lMJvfiKhELANAsYvy8A/CfqbGy5zVWoSFAm0kPcBizvBpwYTeNSPkYXvOo WIgzAGQRqKx5yRSSb81myBTEBUdkXzCb7e3E5/LxPD1kveOhw1+fiZxXT8mJcNUvSB5I6QeVFbHX+J AqDhu6ttct0LnBHJe7lGVzstSCqQ31I1Bp9uFmIu0wlLfWE1yBURQtYAMXOvEZsO8paa2/yJMYsdqR 1U1g9CgelKCUvk0tZ9wXOuN8xq9tSNETwLGG70dHRZU3DNMgFoKvAzaipbq+Yi3B8/qoq4oR8UEbeF kp1O9YBdC5CFiwmtQr/NArGnEWohv0JS7VO74QPLRVm7XU2uIW6hCjuFgBiU7kbHuUG7m7CVcnYx5v oBAt4cs0XnyYIQOum6fmF5J0hvMMqIPVRVnstbKpWobLM4ww2L2pIOz9P1jfHTfzAXLdtQpIrcCWIy aaiuGPgCfezwOcMfWOkD/5AYiv1ZgdB2gyv5NHd8WtIgSmnl/eRnqahbyR1czWqqhwVBHBtU+Ixtgi Vwjh7osViGU3dys/o1FXnR7LuBZIO4aKU3rc1U5kFBYc4Rz4SFmv2UgzLO6AW18rxfP5a/MjGwiK9e vT6ycqVXSuHGo4lLZZnEp0bs7GJl07i2yjOdZs9W/pNJUHFFgYkGHvnlToiA== X-Developer-Key: i=amergnat@baylibre.com; a=openpgp; fpr=231B5ED7F3EAAA700E60FE8B2B46499D7E31D445 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230102_080628_388130_76B3E697 X-CRM114-Status: GOOD ( 15.81 ) 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 Currently, almost all MT63XX PMIC are documented mfd/mt6397.txt. Unfortunately, the PMICs haven't always similar HW sub-features. To have a better human readable schema, I chose to make one PMIC schema to match the exact HW capabilities instead of convert mt6397.txt to mediatek,mt63xx.yaml and put a bunch of properties behind "if contain ... then ..." - add interrupt property - change property refs to match with new yaml documentation Reviewed-by: Krzysztof Kozlowski Acked-by: Lee Jones Signed-off-by: Alexandre Mergnat --- .../devicetree/bindings/mfd/mediatek,mt6357.yaml | 111 +++++++++++++++++++++ 1 file changed, 111 insertions(+) diff --git a/Documentation/devicetree/bindings/mfd/mediatek,mt6357.yaml b/Documentation/devicetree/bindings/mfd/mediatek,mt6357.yaml new file mode 100644 index 000000000000..837a77013d57 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/mediatek,mt6357.yaml @@ -0,0 +1,111 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mfd/mediatek,mt6357.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MediaTek MT6357 PMIC + +maintainers: + - Flora Fu + - Alexandre Mergnat + +description: | + MT6357 is a power management system chip containing 5 buck + converters and 29 LDOs. Supported features are audio codec, + USB battery charging, fuel gauge, RTC + + This is a multifunction device with the following sub modules: + - Regulator + - RTC + - Keys + + It is interfaced to host controller using SPI interface by a proprietary hardware + called PMIC wrapper or pwrap. This MFD is a child device of pwrap. + See the following for pwrap node definitions: + Documentation/devicetree/bindings/soc/mediatek/mediatek,pwrap.yaml + +properties: + compatible: + const: mediatek,mt6357 + + interrupts: + maxItems: 1 + + interrupt-controller: true + + "#interrupt-cells": + const: 2 + + regulators: + type: object + $ref: /schemas/regulator/mediatek,mt6357-regulator.yaml + description: + List of MT6357 BUCKs and LDOs regulators. + + rtc: + type: object + $ref: /schemas/rtc/rtc.yaml# + description: + MT6357 Real Time Clock. + properties: + compatible: + const: mediatek,mt6357-rtc + start-year: true + required: + - compatible + + keys: + type: object + $ref: /schemas/input/mediatek,pmic-keys.yaml + description: + MT6357 power and home keys. + +required: + - compatible + - regulators + +additionalProperties: false + +examples: + - | + #include + + pwrap { + pmic { + compatible = "mediatek,mt6357"; + + interrupt-parent = <&pio>; + interrupts = <145 IRQ_TYPE_LEVEL_HIGH>; + interrupt-controller; + #interrupt-cells = <2>; + + regulators { + mt6357_vproc_reg: buck-vproc { + regulator-name = "vproc"; + regulator-min-microvolt = <518750>; + regulator-max-microvolt = <1312500>; + regulator-ramp-delay = <6250>; + regulator-enable-ramp-delay = <220>; + regulator-always-on; + }; + + // ... + + mt6357_vusb33_reg: ldo-vusb33 { + regulator-name = "vusb33"; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3100000>; + regulator-enable-ramp-delay = <264>; + }; + }; + + rtc { + compatible = "mediatek,mt6357-rtc"; + }; + + keys { + compatible = "mediatek,mt6357-keys"; + }; + }; + };