From patchwork Tue Nov 8 18:43:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Mergnat X-Patchwork-Id: 13036728 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4460C4167B for ; Tue, 8 Nov 2022 18:44:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232775AbiKHSoh (ORCPT ); Tue, 8 Nov 2022 13:44:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232243AbiKHSoV (ORCPT ); Tue, 8 Nov 2022 13:44:21 -0500 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 548D91F606 for ; Tue, 8 Nov 2022 10:44:18 -0800 (PST) Received: by mail-wr1-x42e.google.com with SMTP id bs21so22439697wrb.4 for ; Tue, 08 Nov 2022 10:44:18 -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=U4S2wIE6tyE7Z7qbLSq9JMEZ2ArGmgl84IUzu0C5hxo=; b=Y18ug5W0xJ8M2ZFE/O6Dml7V2y527QV4+8AI560P/BOLhBwON5i0Tw/UMHtkCbl2nP Xe5PsLzdW5Qvg08vLvDU3C3XoSuvti5dZy2kWVEjEQqr1c6hJ/mzKvXE49LTiYnWl53d KY7FpivWfmO47FbSByagIKOeEy1qklqwB9lzCzzg66oJeb5MX+TMKQfrB+4S2s3NdLfM tLBVh6xDA2/STz36yzH8SgtliR4TiekMByVoHtCWDF9O+4Ao9aRAb8RGL/CkLBD2QPYH kF2BnyIy9128m0WtWDR5K2nXao38GXXT6fsJvas3c2QsvTqUnApeNS5fZIWsm6/wYTnd p8mg== 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=U4S2wIE6tyE7Z7qbLSq9JMEZ2ArGmgl84IUzu0C5hxo=; b=MPg4TWOt5/FjoTGm1t9u+dr5SMLZljZSzNH4rZqquVpJGX+hEQSS7bHVvkYcQ0TAo9 RDwmPsX2A1LpxAXbcsQG1U7ONnQIerODRlwR/2f2b/LoX3/ieKR9J5ytEYnzMpcEF0f/ fI47nCtCZeLYIPsKKRuAg72ScZ26nt7VKXK6klYU3t01IzGD0auSpi+N4QgJ7RbnL2i5 Dp7rCX7pMFTjMBtT1i+ZUJ5tQ1a0LJvu4kmbOhjb8drMHXMcROP56AzovB7LydZMDunR nWUOh5JBcebvgM8QVwAc7Wu4p1tsHiS64vdw3e9HFJZ0fcKlrh9omVHJlg2qWN50Qlmd UkSw== X-Gm-Message-State: ACrzQf27XHnzntRbH6wchofkV0DqFNr74L9n9uLhNyuMwiGf89FfrMAn Vu9mJJbe2ZQ07LCbjH4Uns8qOQ== X-Google-Smtp-Source: AMsMyM5Ccq1UQUqi9rNjGygn/pMbp/xasjQS+U+T8va1YRV/PnQrpGPJoYqD4qXFi+5S/YCMWmNHOg== X-Received: by 2002:adf:f701:0:b0:236:e2b2:3b69 with SMTP id r1-20020adff701000000b00236e2b23b69mr27104551wrp.532.1667933056836; Tue, 08 Nov 2022 10:44:16 -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 m6-20020a05600c3b0600b003cf6c2f9513sm13564009wms.2.2022.11.08.10.44.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Nov 2022 10:44:16 -0800 (PST) From: Alexandre Mergnat Date: Tue, 08 Nov 2022 19:43:39 +0100 Subject: [PATCH v4 4/9] dt-bindings: mfd: mediatek: Add bindings for MT6357 PMIC MIME-Version: 1.0 Message-Id: <20221005-mt6357-support-v4-4-5d2bb58e6087@baylibre.com> References: <20221005-mt6357-support-v4-0-5d2bb58e6087@baylibre.com> In-Reply-To: <20221005-mt6357-support-v4-0-5d2bb58e6087@baylibre.com> To: Fabien Parent , Alexandre Belloni , Krzysztof Kozlowski , Sean Wang , Mark Brown , Matthias Brugger , Lee Jones , Chen Zhong , Alessandro Zummo , Pavel Machek , Rob Herring , Liam Girdwood , Dmitry Torokhov Cc: linux-leds@vger.kernel.org, Alexandre Mergnat , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-input@vger.kernel.org, AngeloGioacchino Del Regno , Fabien Parent , linux-rtc@vger.kernel.org, Rob Herring , linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, Mattijs Korpershoek X-Mailer: b4 0.10.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=3744; i=amergnat@baylibre.com; h=from:subject:message-id; bh=MbwBHR/2mMa0XKDOyJjMyD4H+RezYnxtaWTa6yRYsv8=; b=owEBbQKS/ZANAwAKAStGSZ1+MdRFAcsmYgBjaqN6aU0sSWGEnsfMfHfVFyHyKDwvQ8KraqhxKnN6 R4u3soWJAjMEAAEKAB0WIQQjG17X8+qqcA5g/osrRkmdfjHURQUCY2qjegAKCRArRkmdfjHURYtbEA C7GlgDFkDrcsYCJ5KKJkexnAlem/nnnMTjuS7nXgDPhq1edcxjZdL0TxW/XaCExibNMtC6/gajNxxB gxws2eBOERFMjzVOHjUdh2xNklErHnuBEWqjh7FKRCsUVkQ9ydVNMbYwwmyA1tC3CU5HxQwQ7J8M4L VTQczexFohJ0+y0oG3OdKpx8qkyEDUtyhqb+urR5doCEaq/Ath0NAPwzukDiL04cg2UHpE8GJgoe+Q x/iXkZfw9gsCmAh9xnTH2uqO5mPjQXhTzIM5AmlvcJGAS9wVf8O1fZkDuHr+nGFeNKewCjxnzFXl/e BHn7VgUt6dBadMK7YHm3E2DXETA0badpK7r4LdHkNFCA+8K/751FS8TulQv8QDmh57WOm1wRA/HqPu 8RI74f1on4ucyZMQ7LS9GBlheWd4DQtFTgZtgfGoppwECLoDVAUM5+ptWLbcKcbqb8seDGxvEF08Cx EO2SI1Ev56nfBRRYZA0st/yVFto2P1HPRmhFewfzDRqoyQQQIpo+F1XTQWHaq/kGN1GMH8QkMy3bIC gPMpBfhhjX3RlL3H2pdRZPR/BYjodJoqQwg6NR72MxjnNd5GD7O6mHVhKjYjj/uue5MvLw2/sOlc/H TquTcrWAtBHpk7+1n//WvF6rwlY5O5NvVxHMNgYRNh89PK1ltQ0+Gi+wufmA== X-Developer-Key: i=amergnat@baylibre.com; a=openpgp; fpr=231B5ED7F3EAAA700E60FE8B2B46499D7E31D445 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.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 Signed-off-by: Alexandre Mergnat --- .../devicetree/bindings/mfd/mediatek,mt6357.yaml | 102 +++++++++++++++++++++ 1 file changed, 102 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..7b421f21d3f5 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/mediatek,mt6357.yaml @@ -0,0 +1,102 @@ +# 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 Multifunction Device Driver + +maintainers: + - 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: + ../soc/mediatek/mediatek,pwrap.yaml + +properties: + compatible: + const: mediatek,mt6357 + + interrupts: + maxItems: 1 + + interrupt-controller: true + + "#interrupt-cells": + const: 2 + + regulators: + type: object + $ref: ../regulator/mediatek,mt6357-regulator.yaml + description: + Child node that specify the regulator. + + rtc: + type: object + $ref: ../rtc/mediatek,mt6397-rtc.yaml + description: + Child node that specify the RTC. + + keys: + type: object + $ref: ../input/mediatek,pmic-keys.yaml + description: + Child node that specify the keys. + +required: + - compatible + - regulators + +additionalProperties: false + +examples: + - | + 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"; + }; + }; + };