From patchwork Wed Nov 16 12:32:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Mergnat X-Patchwork-Id: 625952 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 22DB1C43219 for ; Wed, 16 Nov 2022 12:33:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232760AbiKPMdn (ORCPT ); Wed, 16 Nov 2022 07:33:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229716AbiKPMdk (ORCPT ); Wed, 16 Nov 2022 07:33:40 -0500 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97F1862CA for ; Wed, 16 Nov 2022 04:33:38 -0800 (PST) Received: by mail-wr1-x42b.google.com with SMTP id k8so29707613wrh.1 for ; Wed, 16 Nov 2022 04:33:38 -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=vlDqIjsLXTsLOVaB8vd3OkA5S2UoaPdLtsIDpj43x2c=; b=N5Qau5w1q+ta61PU32aq1W73jjurOXJ7QB6mrINGYz8JGlm7YiHbNptMvdBvqyRHpX x2aQGDSwWKSmQfRP+1rZuZihXc+ctqJZjh7TRzPAuFMQUXGwBBHIZpXe+daPtxGGBQD7 auWFcoNf2jUTB/SKk1melaNMZbVvhAFxmtq/3Y/uVeCUQ2t+HI/0LbrsRZPtmB4PcP82 O95MxLH8nqchV2YlDgvWs0sHxoA3P+xTWRFvuLV5uZQbahhF1huH9GoOu3R/0szwDmu7 l9fY17ZUursXayRKgsiRVc8NzZJzgfQ+NL+zXgPzv3c3zJ7cYeDn1Wt7TZ26AGyD7lyD 7MzQ== 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=vlDqIjsLXTsLOVaB8vd3OkA5S2UoaPdLtsIDpj43x2c=; b=qs0LLkghAj+A8HTutO+4vQ3seJ73nHHKEejx7uVIAMw8GCLPezqjDwgesMBw2p4bIo LrZkyiNvIhmJSe41XEhAb9/WPJoJgL3nAUj4qeHVaGImkjMsLZXpT3Cj3Z5dWNN4nU4S SBtkPXliilkfOelTbLYKDfvRoqsIVxyIi4Ngq4CgPPYjBMo5L2X8/yugvjM/MEzBH599 hVF81ZoGrg3bewv/asHxeSxPGWQh6OHjd810Zyb0s/dhwVuRWgF+grV9kp7e+R9tL3MI ojrAbYfdiE95GoPYthELxfUIJAnA0rofRsZSCW+zQ4SN5ZAgLB483kRTlYz0aqKeyCrN 7+SA== X-Gm-Message-State: ANoB5pluCE96rnTfC4Or0jg9sg6W8JTT42zkcgsHYFk3HI0NCKQhxh/1 V7hzQ6Q27HX8T2NV8qBM20aYZQ== X-Google-Smtp-Source: AA0mqf6y5ltxqD503f540II09FLjpO4HvSCV9W2mYXH6FjVOTyPqmzQUiAKRkAHEnyXIdbgVMduGZA== X-Received: by 2002:a5d:6885:0:b0:22e:3460:5e28 with SMTP id h5-20020a5d6885000000b0022e34605e28mr13894652wru.211.1668602017069; Wed, 16 Nov 2022 04:33:37 -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 z13-20020adff1cd000000b0024166413a4fsm15051607wro.37.2022.11.16.04.33.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 04:33:36 -0800 (PST) From: Alexandre Mergnat Date: Wed, 16 Nov 2022 13:32:55 +0100 Subject: [PATCH v5 01/10] dt-bindings: input: mtk-pmic-keys: add binding for MT6357 PMIC MIME-Version: 1.0 Message-Id: <20221005-mt6357-support-v5-1-8210d955dd3d@baylibre.com> References: <20221005-mt6357-support-v5-0-8210d955dd3d@baylibre.com> In-Reply-To: <20221005-mt6357-support-v5-0-8210d955dd3d@baylibre.com> To: Flora Fu , Matthias Brugger , Dmitry Torokhov , Tianping Fang , Fabien Parent , Krzysztof Kozlowski , Liam Girdwood , Alexandre Belloni , Mark Brown , Sean Wang , Chen Zhong , Pavel Machek , Lee Jones , Alessandro Zummo , Rob Herring Cc: Krzysztof Kozlowski , Rob Herring , Mattijs Korpershoek , linux-mediatek@lists.infradead.org, Alexandre Mergnat , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-leds@vger.kernel.org, Fabien Parent , AngeloGioacchino Del Regno , linux-rtc@vger.kernel.org, linux-input@vger.kernel.org X-Mailer: b4 0.10.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1006; i=amergnat@baylibre.com; h=from:subject:message-id; bh=acIU37N8P1oQiEeAFVfuuIgjK7XT7A/zFtqy1fGJDhM=; b=owEBbQKS/ZANAwAKAStGSZ1+MdRFAcsmYgBjdNieji5otehDDxz/kRWwqw1b5mYJLkZ5CQYL7Two eWQWJrCJAjMEAAEKAB0WIQQjG17X8+qqcA5g/osrRkmdfjHURQUCY3TYngAKCRArRkmdfjHURXutD/ 0X4V7TScc9d20t+Fd8nUv2ogeANV+FtdcuYX3ygHTbNVDlJTe7pA+APbUcmqoNUrEkq82GPT5o3XsE 9lAwSf/zWJv+7/Rb21k9ivYWGnwlIbvg53nx1ScopyptvXvNICPnjEwluUvQ524y7JPkfglAM85i5i yJZ2jg4sUW7wzXgLt+IoDRDaHHk8rI8BBZMg8xsTzsZbtkBrC10fP5rytGzX0YIDkl0mtwpZRvaozo 3CN4Z6RnNgbcDQR9NY4wgG5hzAwx9DyDfci0Onyd9tpr+9racXGv0XwDnlUepG4yaoOfrJNJAfGs3U Qqnzc4gN9Tc1Dcis9kdovEunAT6Sx92AcuEbHa1R55+ZdaIPNk2P0qfRbSgCHldzjdq9DhHq+91E8A UfnNCdyFALC+4bbTYijjJmO2u8w8rLXu5F65ZPm0J2YCpvgOGnS6X+kYEcAjYsZ0x3TBajjW2nm1K4 yVEA413D3P5++OsviP3XWL429+udy5OQJujDRs27/KMwzinzP16v85ALwRDWf4sryDFoD+/eiJuYsp ZhLU4xNvFgdUKk418lWwjbFq1gtehDgeCsh0fy7DIseVgqo2CVcWRvZ2Uafyd2U5evgT7s6Xv9c3zq yH/Faki6mlcheo9kDT3+GNZX2iA8qru0VdIiRxCf9Idy1wmL5ui1lKwYO9Jg== X-Developer-Key: i=amergnat@baylibre.com; a=openpgp; fpr=231B5ED7F3EAAA700E60FE8B2B46499D7E31D445 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org From: Fabien Parent Add binding documentation for the PMIC keys on MT6357. Signed-off-by: Fabien Parent Acked-by: Rob Herring Acked-by: Dmitry Torokhov Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Alexandre Mergnat --- Documentation/devicetree/bindings/input/mediatek,pmic-keys.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/input/mediatek,pmic-keys.yaml b/Documentation/devicetree/bindings/input/mediatek,pmic-keys.yaml index 2f72ec418415..037c3ae9f1c3 100644 --- a/Documentation/devicetree/bindings/input/mediatek,pmic-keys.yaml +++ b/Documentation/devicetree/bindings/input/mediatek,pmic-keys.yaml @@ -26,6 +26,7 @@ properties: enum: - mediatek,mt6323-keys - mediatek,mt6331-keys + - mediatek,mt6357-keys - mediatek,mt6358-keys - mediatek,mt6397-keys From patchwork Wed Nov 16 12:32:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Mergnat X-Patchwork-Id: 625951 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 DFAEFC4332F for ; Wed, 16 Nov 2022 12:33:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233379AbiKPMdp (ORCPT ); Wed, 16 Nov 2022 07:33:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229702AbiKPMdm (ORCPT ); Wed, 16 Nov 2022 07:33:42 -0500 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B690662F7 for ; Wed, 16 Nov 2022 04:33:39 -0800 (PST) Received: by mail-wr1-x430.google.com with SMTP id k8so29707701wrh.1 for ; Wed, 16 Nov 2022 04:33:39 -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=oNAGHgKQfdNYz52YrL6tIozDgteaJnMtrOIqvPNzMhg=; b=FV/HSHXNcrRrqBJmHz+FqbLbCK1BkffXtZM77vZX9eDe6p7siNq5B8nQcLLmNDS5w7 Xn4j656GAMQcICkOZaoB6Dl+gIFBSJeVMgM/VagVTIwiAYTJCCkc+SrtKAwlOmz0RSHi wPzMZqpVlejCHYtkv2LVPB1KX8ywyFXORrL/BWqL5DUiTAz+B27hZA+JSNEMG1bbuGLT 15qMsONxjxVyp3znSvgS9ViDjxL8wHcSRtUzGQ7ghvuvbF1cO1EE3hqhjg4yr51bplur EY0YSZDUMA6UhrfMLeKqGJVWyheA0mJxrd0hLYbyHLPHXzPv/mDhtp0sM+25PQxxJxbK MsJw== 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=oNAGHgKQfdNYz52YrL6tIozDgteaJnMtrOIqvPNzMhg=; b=lFHJ2TYmS5pqhmoHM4xpCw3cGknyaYkDtuob9QqUgU0ZQxEiwW/nc+gd2V3jGmlJVq Mby6S7wv2gvmyRs6xsrsM8WC/mnNlI4pSUEMySgZAlVyNg5Ea+EjaPI2/yYhn9B6qKJn 0zIT02RvQlIrhF0FZEk1z5BM3SN/aHHcyYJuMjZLwQpWjGql/Dwd8zQZXO7zTKvmFA0G uB7StXj1Wu11Ih8OI9EC/gflpWQwrFrZtrGcM8874CTfeMP8Tjr/ZVbHsmHr10LCj7Il acoXOXtXjGmAYwnES4KITJAcFHkyus10kfRNzBYlor+MAlQsoYNEQayyYPaL19lSluwK oezQ== X-Gm-Message-State: ANoB5pm+Pm+/KgI+Em38quxbvGLe0MDB415t/QPXeoSaw1dQx9plHcbJ +KHZlLQtPKrcmU3yJFrk+5pq5Q== X-Google-Smtp-Source: AA0mqf5fnCwQJSP0dEEGd0P6GY8cmjlR2j/Lo9/ly8wQoWpPbijkVoom+8SCPVlCzBPLmFgLQ6Nclw== X-Received: by 2002:a5d:6252:0:b0:235:25b7:5084 with SMTP id m18-20020a5d6252000000b0023525b75084mr13597976wrv.135.1668602018230; Wed, 16 Nov 2022 04:33:38 -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 z13-20020adff1cd000000b0024166413a4fsm15051607wro.37.2022.11.16.04.33.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 04:33:37 -0800 (PST) From: Alexandre Mergnat Date: Wed, 16 Nov 2022 13:32:56 +0100 Subject: [PATCH v5 02/10] dt-bindings: rtc: mediatek: convert MT6397 rtc documentation MIME-Version: 1.0 Message-Id: <20221005-mt6357-support-v5-2-8210d955dd3d@baylibre.com> References: <20221005-mt6357-support-v5-0-8210d955dd3d@baylibre.com> In-Reply-To: <20221005-mt6357-support-v5-0-8210d955dd3d@baylibre.com> To: Flora Fu , Matthias Brugger , Dmitry Torokhov , Tianping Fang , Fabien Parent , Krzysztof Kozlowski , Liam Girdwood , Alexandre Belloni , Mark Brown , Sean Wang , Chen Zhong , Pavel Machek , Lee Jones , Alessandro Zummo , Rob Herring Cc: Krzysztof Kozlowski , Rob Herring , Mattijs Korpershoek , linux-mediatek@lists.infradead.org, Alexandre Mergnat , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-leds@vger.kernel.org, Fabien Parent , AngeloGioacchino Del Regno , linux-rtc@vger.kernel.org, linux-input@vger.kernel.org X-Mailer: b4 0.10.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=3687; i=amergnat@baylibre.com; h=from:subject:message-id; bh=bgTXwPzyd6FKEaUqDbIPVK0cW0K3Wt2nexsVI0k4GvA=; b=owEBbQKS/ZANAwAKAStGSZ1+MdRFAcsmYgBjdNie/0nfbIeSBs2767maC3sOK+AOvXWyp3zfFzK8 aHPdjmyJAjMEAAEKAB0WIQQjG17X8+qqcA5g/osrRkmdfjHURQUCY3TYngAKCRArRkmdfjHURXobD/ 4w4dIX0ZyQIB72yfVZW5deAwSwyPwWxUftc8sKFy6nPu+/Pkulo1OPj0Py4nKAnJXp2EJz0l1NMR0A L4GEiZqTQ7I82pvPIoGMe6rP2G3KAPSlAs7ftXUg0DiQrO1UDZVptQKl4wKC7TLzQFFdD+41Rv4fwQ 5QM/d45Z+cPsOBXhQN4ULawAXCJXXc9W73n+lL19eFRr+doETI22gAFQ3IIQKbrtJFg/wZM3TxElOr McJ2Fmys7SO+WtNMtUYhJ0bT10ICTFUyD9bcniRZ9oVXG1CKN5KdUvE//cD3lWO6yoiEfcXHmM8yaC TX6mWkiaX1tFxkDEpBQ21p9YSKTT8Z36OFtUBrM21rk4WLEDCR4k1QnhSomSmPFibq9JZ63b/GVNf6 xABd9E2K5meLOCmCLTsT2Y+mTXAIIxVUxkHAR2pAUVF9bF2cGS/HZ4kGc8ev+FPLwsM/CJJcbVLZuN eXqMRBDDI5/PcMFPgG166G4RfQM26WNrvzh+5PMAa0Ct91zLt++GVQPHNLDmr6CZAmW02lhpIVrXwv r7I5s3ghydWK3uKNPpqeqTEa3KPfv6iJOUY6TL6BQP9wKERlVnTGSBBv4I9owvbBf00YbyMXwvYlHd Ocvx9OesU/VfqlhCwDPiiLnRCwnChrq6rRdUqmU7wc69Z7o+xbCPMiJHMo1Q== X-Developer-Key: i=amergnat@baylibre.com; a=openpgp; fpr=231B5ED7F3EAAA700E60FE8B2B46499D7E31D445 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org - Convert rtc/rtc-mt6397.txt to rtc/mt6397-rtc.yaml - Add maintainer - Remove the .txt binding file Signed-off-by: Alexandre Mergnat --- Documentation/devicetree/bindings/mfd/mt6397.txt | 2 +- .../bindings/rtc/mediatek,mt6397-rtc.yaml | 43 ++++++++++++++++++++++ .../devicetree/bindings/rtc/rtc-mt6397.txt | 31 ---------------- 3 files changed, 44 insertions(+), 32 deletions(-) diff --git a/Documentation/devicetree/bindings/mfd/mt6397.txt b/Documentation/devicetree/bindings/mfd/mt6397.txt index 0088442efca1..79aaf21af8e9 100644 --- a/Documentation/devicetree/bindings/mfd/mt6397.txt +++ b/Documentation/devicetree/bindings/mfd/mt6397.txt @@ -33,7 +33,7 @@ Optional subnodes: - compatible: "mediatek,mt6331-rtc" - compatible: "mediatek,mt6358-rtc" - compatible: "mediatek,mt6397-rtc" - For details, see ../rtc/rtc-mt6397.txt + For details, see ../rtc/mediatek,mt6397-rtc.yaml - regulators Required properties: - compatible: "mediatek,mt6323-regulator" diff --git a/Documentation/devicetree/bindings/rtc/mediatek,mt6397-rtc.yaml b/Documentation/devicetree/bindings/rtc/mediatek,mt6397-rtc.yaml new file mode 100644 index 000000000000..f5a323597f1d --- /dev/null +++ b/Documentation/devicetree/bindings/rtc/mediatek,mt6397-rtc.yaml @@ -0,0 +1,43 @@ + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/rtc/mediatek,mt6397-rtc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MediaTek MT6397/MT6366/MT6358/MT6323 RTC + +maintainers: + - Tianping Fang + - Alexandre Mergnat + +description: | + MediaTek PMIC based RTC is an independent function of MediaTek PMIC that works + as a type of multi-function device (MFD). The RTC can be configured and set up + with PMIC wrapper bus which is a common resource shared with the other + functions found on the same PMIC. + +allOf: + - $ref: rtc.yaml# + +properties: + compatible: + enum: + - mediatek,mt6323-rtc + - mediatek,mt6358-rtc + - mediatek,mt6366-rtc + - mediatek,mt6397-rtc + + start-year: true + +additionalProperties: false + +required: + - compatible + +examples: + - | + pmic { + rtc { + compatible = "mediatek,mt6397-rtc"; + }; + }; diff --git a/Documentation/devicetree/bindings/rtc/rtc-mt6397.txt b/Documentation/devicetree/bindings/rtc/rtc-mt6397.txt deleted file mode 100644 index 7212076a8f1b..000000000000 --- a/Documentation/devicetree/bindings/rtc/rtc-mt6397.txt +++ /dev/null @@ -1,31 +0,0 @@ -Device-Tree bindings for MediaTek PMIC based RTC - -MediaTek PMIC based RTC is an independent function of MediaTek PMIC that works -as a type of multi-function device (MFD). The RTC can be configured and set up -with PMIC wrapper bus which is a common resource shared with the other -functions found on the same PMIC. - -For MediaTek PMIC MFD bindings, see: -../mfd/mt6397.txt - -For MediaTek PMIC wrapper bus bindings, see: -../soc/mediatek/pwrap.txt - -Required properties: -- compatible: Should be one of follows - "mediatek,mt6323-rtc": for MT6323 PMIC - "mediatek,mt6358-rtc": for MT6358 PMIC - "mediatek,mt6366-rtc", "mediatek,mt6358-rtc": for MT6366 PMIC - "mediatek,mt6397-rtc": for MT6397 PMIC - -Example: - - pmic { - compatible = "mediatek,mt6323"; - - ... - - rtc { - compatible = "mediatek,mt6323-rtc"; - }; - }; From patchwork Wed Nov 16 12:32:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Mergnat X-Patchwork-Id: 625347 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 22123C4321E for ; Wed, 16 Nov 2022 12:33:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232397AbiKPMdr (ORCPT ); Wed, 16 Nov 2022 07:33:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229463AbiKPMdn (ORCPT ); Wed, 16 Nov 2022 07:33:43 -0500 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC7F3638F for ; Wed, 16 Nov 2022 04:33:40 -0800 (PST) Received: by mail-wr1-x434.google.com with SMTP id j15so29713006wrq.3 for ; Wed, 16 Nov 2022 04:33:40 -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=ByXWD0lCc2CI3sIWiOYpDZxY7pYbUTZWMwJ3VN18Hi0=; b=kLtCA6b4Gwx5KFILMSNS+Ogl0kqgvx0G2tZkgvanHcqxG8eSNPKtf+/cvwF5V/bUZi E5q/jgrvhlHeTyunIUTJkZL9qSL85zcjqiFp7CRENaHhUK2OF5kEgHqQo75h7ZyB2aT5 kLUbUHDt025aUm4Adxe9b1l1kyHkDxiMDfn09WhwLk/dw68VCHCC564TP6Xzbz+7mnnm +w/PZeWQp7zbuCDOpc4zix4TvVAqmqhbCQ+M/A3BZme9/ESuq8YfrOV2Zlwb0cEQONYq F0RNdix0mC+9YRVCuo+kxchZ2SBk1dQO2qFHSkQVL4zfJfI3E+eCn24aD40W3N/CDS4Z NjKQ== 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=ByXWD0lCc2CI3sIWiOYpDZxY7pYbUTZWMwJ3VN18Hi0=; b=6Mwxc9/MZTHkJaiYtNP68cCjMBx5CL+vZ+tWk+ZdOm+j0u0+nzHguwITaw7HUhxLJ0 cumGBzHN/6KLrEcvWJInFUA5sQ/FWWNQhK2PjpBRlYZvhNRR9EsGQsBltw9FC4RKQHTe 0GvgejAKxgFQBrZNIRiAJUUToKBo7JKV8MajcpoyGg522/sGs9FTNHiwOxtcf5kB5OCi KpqjyOhLWDD5I8DEUiyoeSIVKoIQu3AbEQfLHOdlcbPNxM4vq8yq6b14+01jyJjy7TrH p1UYop31dloQi9DImpBVr7WLJ6uefZ9wmNnHvz/aDtrhfL4ENwDoyMG8VHkeU38R612q 41mg== X-Gm-Message-State: ANoB5pmAM2/alHXCyXL4urPISD2E5Qtg9DBfy7ZZnCu7MbvpKqWUUIdT IsvXXAeChS9hWTzghGFMQ3z7Nw== X-Google-Smtp-Source: AA0mqf7e0C2iFw5u+lBPjnnR0+qOl8YEMf9M6usMvRVDVDUgRnm7mjNz6NQVZUhWvBs3NYxWsoGanw== X-Received: by 2002:a5d:6909:0:b0:23a:5a31:29eb with SMTP id t9-20020a5d6909000000b0023a5a3129ebmr13417655wru.679.1668602019299; Wed, 16 Nov 2022 04:33:39 -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 z13-20020adff1cd000000b0024166413a4fsm15051607wro.37.2022.11.16.04.33.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 04:33:38 -0800 (PST) From: Alexandre Mergnat Date: Wed, 16 Nov 2022 13:32:57 +0100 Subject: [PATCH v5 03/10] dt-bindings: rtc: mediatek: add MT6357 support MIME-Version: 1.0 Message-Id: <20221005-mt6357-support-v5-3-8210d955dd3d@baylibre.com> References: <20221005-mt6357-support-v5-0-8210d955dd3d@baylibre.com> In-Reply-To: <20221005-mt6357-support-v5-0-8210d955dd3d@baylibre.com> To: Flora Fu , Matthias Brugger , Dmitry Torokhov , Tianping Fang , Fabien Parent , Krzysztof Kozlowski , Liam Girdwood , Alexandre Belloni , Mark Brown , Sean Wang , Chen Zhong , Pavel Machek , Lee Jones , Alessandro Zummo , Rob Herring Cc: Krzysztof Kozlowski , Rob Herring , Mattijs Korpershoek , linux-mediatek@lists.infradead.org, Alexandre Mergnat , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-leds@vger.kernel.org, Fabien Parent , AngeloGioacchino Del Regno , linux-rtc@vger.kernel.org, linux-input@vger.kernel.org X-Mailer: b4 0.10.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1123; i=amergnat@baylibre.com; h=from:subject:message-id; bh=1tXoH1HVwX4fN3Wncu6gs0AgFNOfACwfkAOrtJSJ/W4=; b=owEBbQKS/ZANAwAKAStGSZ1+MdRFAcsmYgBjdNieDlBAVIL+/YAoYamy6vY7S/jXwIimB1VbYYQ8 bCBYwGSJAjMEAAEKAB0WIQQjG17X8+qqcA5g/osrRkmdfjHURQUCY3TYngAKCRArRkmdfjHURQXdD/ 97gSKBpj/3J42WdqW7VkrkKAALxndbe+269SUwn37e6CzavlmF5PYXMN3WT5/xGn7pDOEeAbqC6Alm PtjLQ1jIlhkSyIWHpVrDKEIlgIKkwifgLoOLuu0o6R9cD2ydWbdHE8huQoQC8B1ofwB3SCDEqPmWvl Dm/s5u5BpCobk3kM7W4ED9NIXxNn4a9mkmTUcoEWT8vwsIXrdZvfGSjWQtW640PU5dqa5TzwbYUnRx TZmcTM67PRUeYlSKJOzy5S4hX7hMLIFmI38Jc0Qz+RSQl0aO9XaVTXv6OhezkbaNVDoG2gE+eOy9ql MwOdcgSNIJI0MHVh0MpuBvQurwKcMU8g+by7h7ayPrFifWDkW746XzprARQeUtt80FnYf7oBkBwGfe mUp9NLFrkz+ALMum0XpH1NSRW7NB0V0M422FlJyMl5I+nC8QerthOcixVRLC/lZKhddKNgLe/dG5ze KlKoHYuhW3L3M7ljbjkQBii1Uw1/vA9vR3sfyWUScmvokSQfrcLXgVWtasZasmeuw5dlCt0hbnp5eB UfWaVlnsSPr7bKWXx0HEI7inGVgICm5XAHk4xXT+yyEGXnJ3+jTIS15+2iCrpOM1N8DOjxJGlZ587e ci/8nWIg0l4udv4NKZu1rfwhtdnork73njIbaGf8uZ8MbXLLvmOtE0Lzraiw== X-Developer-Key: i=amergnat@baylibre.com; a=openpgp; fpr=231B5ED7F3EAAA700E60FE8B2B46499D7E31D445 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org Add binding documentation of mediatek,mt6397-rtc for mt6357 SoC. Signed-off-by: Alexandre Mergnat Acked-by: Rob Herring --- Documentation/devicetree/bindings/rtc/mediatek,mt6397-rtc.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/rtc/mediatek,mt6397-rtc.yaml b/Documentation/devicetree/bindings/rtc/mediatek,mt6397-rtc.yaml index f5a323597f1d..f4e861789d00 100644 --- a/Documentation/devicetree/bindings/rtc/mediatek,mt6397-rtc.yaml +++ b/Documentation/devicetree/bindings/rtc/mediatek,mt6397-rtc.yaml @@ -4,7 +4,7 @@ $id: http://devicetree.org/schemas/rtc/mediatek,mt6397-rtc.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# -title: MediaTek MT6397/MT6366/MT6358/MT6323 RTC +title: MediaTek MT6397/MT6366/MT6358/MT6357/MT6323 RTC maintainers: - Tianping Fang @@ -23,6 +23,7 @@ properties: compatible: enum: - mediatek,mt6323-rtc + - mediatek,mt6357-rtc - mediatek,mt6358-rtc - mediatek,mt6366-rtc - mediatek,mt6397-rtc From patchwork Wed Nov 16 12:32:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Mergnat X-Patchwork-Id: 625949 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 8C3E8C43217 for ; Wed, 16 Nov 2022 12:33:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233216AbiKPMdu (ORCPT ); Wed, 16 Nov 2022 07:33:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229826AbiKPMdo (ORCPT ); Wed, 16 Nov 2022 07:33:44 -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 1A0A2639C for ; Wed, 16 Nov 2022 04:33:41 -0800 (PST) Received: by mail-wr1-x42e.google.com with SMTP id g12so29457244wrs.10 for ; Wed, 16 Nov 2022 04:33:40 -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=HATzFcKyNJNLHGShh4QYR7TLWgba746X9u+EhN4svqk=; b=qW+UYumOo0IeZysDt62lV2NdZjLKnGnlxSpR+5Yi7sdmP/Ascf3x33VtFCoUy1Xtlr y2Bt4LiBSxlG92M+yOxsBZHmlS7GFw5nG7LoUp86ioaLO1C3Z13kb14WB3laQlkJ9JuN UCgz8XlixciAqbNfT8TvzgM1EAnXBusFdj59gCskY7bcWIksDPxq7WcvwBdLaf2Shfx+ XTadC3fGIoE6ZmsGokVVsC9UoSERNWngSM+aloLO18pMp9hELotLq1pfczahVaxNkjGo AwwHwEABBkxt2veTIdKjePclUKJp46MmUc1QLrvNolnOGuGdxaPJk5d73CSWpp9w/46h XgGA== 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=HATzFcKyNJNLHGShh4QYR7TLWgba746X9u+EhN4svqk=; b=i7Wj/p5NW8p2QmXTkjbBX949jqfbF1k1CsWp6tNHFXwfOaDNzUvS2ctVQjUhFocmAX F2/seykUkZduTPqBjVZPIeXer38Mt/pu72cPIx281gpoQOgsL/4H8vOSpHIrGQrKXNoA /ccDBEvw+WvqdXWNg1wD5YcrP2UeSOIKnWJ7987ipnbexSI77V/x/rttt41vG+eSAHdo qFc50Qz3ijcnWw5Fh9BFA3KzfVUWZZRLJGQL25hcEBx/QNZbP8VM4vcSS3mhaCLMkwOr 1AxGEb//66i9dk24cZ7A1b7zF1akuOfmVmIefBxO4YreQw5t1/WcE4THJ5R8KtQiHwDr tYzg== X-Gm-Message-State: ANoB5pntiSSzxuOWPHEr+BdRidz2TrmLw0BWdjy2B0P/rDO6ebrSFpel Fc6lYJzGH6j5GXZrM+i53iu7tA== X-Google-Smtp-Source: AA0mqf5lT+Bg5bZ4UHXq/23WChK96o76jj4mVkZRF8ElFGvgaFprzVhxURsY27RTWJZZNi7Rw8PVjg== X-Received: by 2002:a5d:6086:0:b0:22e:71db:47ba with SMTP id w6-20020a5d6086000000b0022e71db47bamr14223316wrt.359.1668602020488; Wed, 16 Nov 2022 04:33:40 -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 z13-20020adff1cd000000b0024166413a4fsm15051607wro.37.2022.11.16.04.33.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 04:33:40 -0800 (PST) From: Alexandre Mergnat Date: Wed, 16 Nov 2022 13:32:58 +0100 Subject: [PATCH v5 04/10] regulator: dt-bindings: Add binding schema for mt6357 regulators MIME-Version: 1.0 Message-Id: <20221005-mt6357-support-v5-4-8210d955dd3d@baylibre.com> References: <20221005-mt6357-support-v5-0-8210d955dd3d@baylibre.com> In-Reply-To: <20221005-mt6357-support-v5-0-8210d955dd3d@baylibre.com> To: Flora Fu , Matthias Brugger , Dmitry Torokhov , Tianping Fang , Fabien Parent , Krzysztof Kozlowski , Liam Girdwood , Alexandre Belloni , Mark Brown , Sean Wang , Chen Zhong , Pavel Machek , Lee Jones , Alessandro Zummo , Rob Herring Cc: Krzysztof Kozlowski , Rob Herring , Mattijs Korpershoek , linux-mediatek@lists.infradead.org, Alexandre Mergnat , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-leds@vger.kernel.org, Fabien Parent , AngeloGioacchino Del Regno , linux-rtc@vger.kernel.org, linux-input@vger.kernel.org X-Mailer: b4 0.10.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=11436; i=amergnat@baylibre.com; h=from:subject:message-id; bh=oN1mPz7HLBv6qktF6GkCn4WCRTLtCt2bqJ71/SAMGkw=; b=owEBbQKS/ZANAwAKAStGSZ1+MdRFAcsmYgBjdNiemYeIS6GPViPY65ESxG4uUG9xhxdeWKz90Nnl wXjsQnuJAjMEAAEKAB0WIQQjG17X8+qqcA5g/osrRkmdfjHURQUCY3TYngAKCRArRkmdfjHURSL3EA C8k6M3XB6y9c4iWfJZiY5qm7aziRuCS6BAqyIpyykFzkVL1vA4U0U7ZTYXI666QYfrA0D7ZOO56eM6 TLMiV/KuNRi17LM1rDBjJwdHChxb8ZjNZx2ZvMG+bF8De67WlgHECCVC1BuucjdyiN9Fx/VjAvBwrF CsJa8pUcDslP1VVRFfrBDtJXgBWl6E/8k2exvrfaj6HsaJYg0/3hhOb6RczwqlMqkJ+VnYxPUU+atB /VWDgFKtylb/huxIujdHE++KGehv9N/iM8fUZnhaA+GMfjVVOyYyh3Il9mybuV01tvv5sjkXK+S7xs S2bIZ4KK+jWe/b7pw/Y6YoIlH4f/Pc9PiRDh4RO3kOaGjDo/WQyMSEzcieFTqWJXA5W8BFbN3AWE/A VCmdg6MEM4+eILw5qskceU1FvTYCqBqh7fxJMMd3I7gaOIQI77nhDSMK1y2fMVnc/ExRlW6vraKt2q 3VASxJS1V4EBNYCxqQs4pHi+rmtC7V4K4kDO62VosEgUpjgTHeaorDyMbUrIIhT8m/Jc/MwLysk0ET dDNs0Y3kIsUDtOaDBp2rKXrK5vv1Bz3snbQHskt60GyeMl2dHPmSW2F3HlZcdbkYOgJgZqctuRYql2 SEGdiTi85xs4MxCpsEikvmVSIGVYUYmG/RClz/ARctz76/wWy++Cb615sJig== X-Developer-Key: i=amergnat@baylibre.com; a=openpgp; fpr=231B5ED7F3EAAA700E60FE8B2B46499D7E31D445 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org From: Fabien Parent Add YAML schema for the MediaTek MT6357 regulators. Signed-off-by: Fabien Parent Reviewed-by: Krzysztof Kozlowski Signed-off-by: Alexandre Mergnat --- .../regulator/mediatek,mt6357-regulator.yaml | 293 +++++++++++++++++++++ 1 file changed, 293 insertions(+) diff --git a/Documentation/devicetree/bindings/regulator/mediatek,mt6357-regulator.yaml b/Documentation/devicetree/bindings/regulator/mediatek,mt6357-regulator.yaml new file mode 100644 index 000000000000..2c5f3f53a86f --- /dev/null +++ b/Documentation/devicetree/bindings/regulator/mediatek,mt6357-regulator.yaml @@ -0,0 +1,293 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/regulator/mediatek,mt6357-regulator.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MediaTek MT6357 Regulators + +maintainers: + - Chen Zhong + - Fabien Parent + - Alexandre Mergnat + +description: | + The MT6357 PMIC provides 5 BUCK and 29 LDO. + Regulators and nodes are named according to the regulator type: + buck- and ldo-. + MT6357 regulators node should be sub node of the MT6397 MFD node. + +patternProperties: + "^buck-v(core|modem|pa|proc|s1)$": + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + description: + Properties for single BUCK regulator. + + required: + - regulator-name + - regulator-min-microvolt + - regulator-max-microvolt + + "^ldo-v(camio18|aud28|aux18|io18|io28|rf12|rf18|cn18|cn28|fe28)$": + type: object + $ref: fixed-regulator.yaml# + unevaluatedProperties: false + description: + Properties for single fixed LDO regulator. + + required: + - regulator-name + - regulator-min-microvolt + - regulator-max-microvolt + + "^ldo-v(efuse|ibr|ldo28|mch|cama|camd|cn33-bt|cn33-wifi)$": + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + description: + Properties for single LDO regulator. + + required: + - regulator-name + - regulator-min-microvolt + - regulator-max-microvolt + + "^ldo-v(xo22|emc|mc|sim1|sim2|sram-others|sram-proc|dram|usb33)$": + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + description: + Properties for single LDO regulator. + + required: + - regulator-name + - regulator-min-microvolt + - regulator-max-microvolt + +additionalProperties: false + +examples: + - | + pmic { + 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_vcore_reg: buck-vcore { + regulator-name = "vcore"; + regulator-min-microvolt = <518750>; + regulator-max-microvolt = <1312500>; + regulator-ramp-delay = <6250>; + regulator-enable-ramp-delay = <220>; + regulator-always-on; + }; + mt6357_vmodem_reg: buck-vmodem { + regulator-name = "vmodem"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <1193750>; + regulator-ramp-delay = <6250>; + regulator-enable-ramp-delay = <220>; + }; + mt6357_vs1_reg: buck-vs1 { + regulator-name = "vs1"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <2200000>; + regulator-ramp-delay = <12500>; + regulator-enable-ramp-delay = <220>; + regulator-always-on; + }; + mt6357_vpa_reg: buck-vpa { + regulator-name = "vpa"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <3650000>; + regulator-ramp-delay = <50000>; + regulator-enable-ramp-delay = <220>; + }; + mt6357_vfe28_reg: ldo-vfe28 { + compatible = "regulator-fixed"; + regulator-name = "vfe28"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + regulator-enable-ramp-delay = <264>; + }; + mt6357_vxo22_reg: ldo-vxo22 { + regulator-name = "vxo22"; + regulator-min-microvolt = <2200000>; + regulator-max-microvolt = <2400000>; + regulator-enable-ramp-delay = <110>; + }; + mt6357_vrf18_reg: ldo-vrf18 { + compatible = "regulator-fixed"; + regulator-name = "vrf18"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-enable-ramp-delay = <110>; + }; + mt6357_vrf12_reg: ldo-vrf12 { + compatible = "regulator-fixed"; + regulator-name = "vrf12"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-enable-ramp-delay = <110>; + }; + mt6357_vefuse_reg: ldo-vefuse { + regulator-name = "vefuse"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <3300000>; + regulator-enable-ramp-delay = <264>; + }; + mt6357_vcn33_bt_reg: ldo-vcn33-bt { + regulator-name = "vcn33-bt"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3500000>; + regulator-enable-ramp-delay = <264>; + }; + mt6357_vcn33_wifi_reg: ldo-vcn33-wifi { + regulator-name = "vcn33-wifi"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3500000>; + regulator-enable-ramp-delay = <264>; + }; + mt6357_vcn28_reg: ldo-vcn28 { + compatible = "regulator-fixed"; + regulator-name = "vcn28"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + regulator-enable-ramp-delay = <264>; + }; + mt6357_vcn18_reg: ldo-vcn18 { + compatible = "regulator-fixed"; + regulator-name = "vcn18"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-enable-ramp-delay = <264>; + }; + mt6357_vcama_reg: ldo-vcama { + regulator-name = "vcama"; + regulator-min-microvolt = <2500000>; + regulator-max-microvolt = <2800000>; + regulator-enable-ramp-delay = <264>; + }; + mt6357_vcamd_reg: ldo-vcamd { + regulator-name = "vcamd"; + regulator-min-microvolt = <1000000>; + regulator-max-microvolt = <1800000>; + regulator-enable-ramp-delay = <264>; + }; + mt6357_vcamio_reg: ldo-vcamio18 { + compatible = "regulator-fixed"; + regulator-name = "vcamio"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-enable-ramp-delay = <264>; + }; + mt6357_vldo28_reg: ldo-vldo28 { + regulator-name = "vldo28"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <3000000>; + regulator-enable-ramp-delay = <264>; + }; + mt6357_vsram_others_reg: ldo-vsram-others { + regulator-name = "vsram-others"; + regulator-min-microvolt = <518750>; + regulator-max-microvolt = <1312500>; + regulator-ramp-delay = <6250>; + regulator-enable-ramp-delay = <110>; + regulator-always-on; + }; + mt6357_vsram_proc_reg: ldo-vsram-proc { + regulator-name = "vsram-proc"; + regulator-min-microvolt = <518750>; + regulator-max-microvolt = <1312500>; + regulator-ramp-delay = <6250>; + regulator-enable-ramp-delay = <110>; + regulator-always-on; + }; + mt6357_vaux18_reg: ldo-vaux18 { + compatible = "regulator-fixed"; + regulator-name = "vaux18"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-enable-ramp-delay = <264>; + }; + mt6357_vaud28_reg: ldo-vaud28 { + compatible = "regulator-fixed"; + regulator-name = "vaud28"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + regulator-enable-ramp-delay = <264>; + }; + mt6357_vio28_reg: ldo-vio28 { + compatible = "regulator-fixed"; + regulator-name = "vio28"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + regulator-enable-ramp-delay = <264>; + }; + mt6357_vio18_reg: ldo-vio18 { + compatible = "regulator-fixed"; + regulator-name = "vio18"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-enable-ramp-delay = <264>; + regulator-always-on; + }; + mt6357_vdram_reg: ldo-vdram { + regulator-name = "vdram"; + regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <1200000>; + regulator-enable-ramp-delay = <3300>; + }; + mt6357_vmc_reg: ldo-vmc { + regulator-name = "vmc"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + regulator-enable-ramp-delay = <44>; + }; + mt6357_vmch_reg: ldo-vmch { + regulator-name = "vmch"; + regulator-min-microvolt = <2900000>; + regulator-max-microvolt = <3300000>; + regulator-enable-ramp-delay = <44>; + }; + mt6357_vemc_reg: ldo-vemc { + regulator-name = "vemc"; + regulator-min-microvolt = <2900000>; + regulator-max-microvolt = <3300000>; + regulator-enable-ramp-delay = <44>; + regulator-always-on; + }; + mt6357_vsim1_reg: ldo-vsim1 { + regulator-name = "vsim1"; + regulator-min-microvolt = <1700000>; + regulator-max-microvolt = <3100000>; + regulator-enable-ramp-delay = <264>; + }; + mt6357_vsim2_reg: ldo-vsim2 { + regulator-name = "vsim2"; + regulator-min-microvolt = <1700000>; + regulator-max-microvolt = <3100000>; + regulator-enable-ramp-delay = <264>; + }; + mt6357_vibr_reg: ldo-vibr { + regulator-name = "vibr"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <3300000>; + regulator-enable-ramp-delay = <44>; + }; + mt6357_vusb33_reg: ldo-vusb33 { + regulator-name = "vusb33"; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3100000>; + regulator-enable-ramp-delay = <264>; + }; + }; + }; +... From patchwork Wed Nov 16 12:32:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Mergnat X-Patchwork-Id: 625950 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 CC756C433FE for ; Wed, 16 Nov 2022 12:33:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238698AbiKPMdt (ORCPT ); Wed, 16 Nov 2022 07:33:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233216AbiKPMdo (ORCPT ); Wed, 16 Nov 2022 07:33:44 -0500 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A4DB63A7 for ; Wed, 16 Nov 2022 04:33:42 -0800 (PST) Received: by mail-wr1-x432.google.com with SMTP id d9so24965451wrm.13 for ; Wed, 16 Nov 2022 04:33:42 -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=/WfPFIvXQkUy4+HZsCcjoOy5HXh/OR2xwCOtqD43AE4=; b=anNTidUNH1tj7TSR3clk5+n+38GOcvy75BhyNV4cdzvdYCHO+HjxLuMWpobowQTKl7 5hn8Kc80R4O41z4pkcIFDTyT/Xe5TywiKOyyVYG7dYSAmqltXZMm8MkZn/xaE0QTJoUh MmF26D9T/EllHHu5S1HHlvKkCf0UMqC0KLHgePQ5mBG+AfP21jaE/Ujzo6Qg6zE9HD6l MUU1HdXrBre0hKK6DKi5EXvfTU1Qftnn0XOG/snntBrLtRwNf8V+yFDy1/8oPRL7Vv+m B8IhSsZqb51dMoEjFvy+TJKlkoT+3ToyB0es21BKO7LpQsKa9VmDpKzDlKnGpLbM6RRG g24A== 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=/WfPFIvXQkUy4+HZsCcjoOy5HXh/OR2xwCOtqD43AE4=; b=U4SoLzvM4hDR+Tk0f157QKMxaDmhBJFkrNhZhZEHSYIBBvCh1rKT1Jqw4L6qj1ujw9 rQpiNm0EuB52z/ie5bpQInxMwDtUDj+YqRw4QV5cilSKKWYgyK7tCTl6KGT6XpX4I7tT vgUVEH38gG+lus1HO9BlDd4J6AYhGkdx4D2HxweQlxWUeiO+ysGw7QQmIi7efoFF2VC4 2l+W/+NY8rPg0xUZaMQi2NguYu+/Ogt7eKoI1IcgytGf08vSKa2hM2zpgN50pixtzh+L V/PeRWpMlg5Hzs+GDrwMwe/QuTZfs8958CwZ51qatALt6iYsvMZV2ApLTpuTKxmbFU9D 8/zA== X-Gm-Message-State: ANoB5pnxIKnCXXQOuebTkRsYGXkupRZXSfEKINVcppUWVaPmfs4J93CK guVGZglVqQpAO4A8ybpkvlhI0Q== X-Google-Smtp-Source: AA0mqf4n12wK9CCjIppl1FRYfRcSBS8fD+DvVYKOSREQwCcJOaNYMr8B9PHKzuyxxGfSFSxyAEYNeg== X-Received: by 2002:a5d:4531:0:b0:22d:6ad5:bc0f with SMTP id j17-20020a5d4531000000b0022d6ad5bc0fmr14196682wra.115.1668602021629; Wed, 16 Nov 2022 04:33:41 -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 z13-20020adff1cd000000b0024166413a4fsm15051607wro.37.2022.11.16.04.33.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 04:33:41 -0800 (PST) From: Alexandre Mergnat Date: Wed, 16 Nov 2022 13:32:59 +0100 Subject: [PATCH v5 05/10] dt-bindings: mfd: mediatek: Add bindings for MT6357 PMIC MIME-Version: 1.0 Message-Id: <20221005-mt6357-support-v5-5-8210d955dd3d@baylibre.com> References: <20221005-mt6357-support-v5-0-8210d955dd3d@baylibre.com> In-Reply-To: <20221005-mt6357-support-v5-0-8210d955dd3d@baylibre.com> To: Flora Fu , Matthias Brugger , Dmitry Torokhov , Tianping Fang , Fabien Parent , Krzysztof Kozlowski , Liam Girdwood , Alexandre Belloni , Mark Brown , Sean Wang , Chen Zhong , Pavel Machek , Lee Jones , Alessandro Zummo , Rob Herring Cc: Krzysztof Kozlowski , Rob Herring , Mattijs Korpershoek , linux-mediatek@lists.infradead.org, Alexandre Mergnat , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-leds@vger.kernel.org, Fabien Parent , AngeloGioacchino Del Regno , linux-rtc@vger.kernel.org, linux-input@vger.kernel.org X-Mailer: b4 0.10.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=3860; i=amergnat@baylibre.com; h=from:subject:message-id; bh=hsHJv7tXwGtDI1+UamHOo/TefFAouJ5xvx7nyDsqMfU=; b=owEBbQKS/ZANAwAKAStGSZ1+MdRFAcsmYgBjdNieQ9Fl8OeMeICUpSLnSuM0BD70OdMnojNX0qWc u07fbgGJAjMEAAEKAB0WIQQjG17X8+qqcA5g/osrRkmdfjHURQUCY3TYngAKCRArRkmdfjHURRraEA CEv/D0minFKV62jMF/0IbHr5ntv/eeMRm66nA1uv3+YuR42+mewSDq4Vo0dy7QQCNQGbV0QwPhi2/S nTd3BnqZoW377jskDvs+ot8b3jttwmF5cGW2TxYwbI472zCPrQgLgT7s+JfIxThZTX6zUxV0D8d9Sk K3kDc0ICCh0Maqo6afqLLQqyEWbTSigEibrsb2WlITYLLNLFXPj9Q/7dMmbv9MKnu8M3jSvslMP4j7 CbWnpV2AQY8RHd0ccoE5QC4cbtGyJbAnRWudzqVeL+KiRnYJ9PPD7Mrbh4ckGExA8e0D3LzaCPm0Mc WgMpSgnfjh0W9vUopCM0PyDrX5ggfZUNPSNGUjO2vmn2leQDzGYWGVu56pIYr1U6sjRv17qiYnrpa3 Ozfrk01f3yyhAXwncQkaRgTl/g+G/djr9oii5HeZIOuT9dxY/UBGSma9W482wfBsBQZqnFizBigdNa nWgOV+lc5i5nwbv6AzeVr1TKGXAA83EHEV+E33OKfy/Ap1pZupTvTxrPhTfBa0Lao93vbQrZyWGUIr XeI9FRzmHBDftKRuoJRpBDyt1BIgpVahsa0bw/ET3HnG1FlskktWvtzDSeUlnhWFim+zObQnfPlz1I DFfmhMEwubzKjwUW0afVN5dWVKt8xvb7B705IWg0AU2F3yLbYmrEIYF2pXtQ== X-Developer-Key: i=amergnat@baylibre.com; a=openpgp; fpr=231B5ED7F3EAAA700E60FE8B2B46499D7E31D445 Precedence: bulk List-ID: X-Mailing-List: linux-leds@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 | 105 +++++++++++++++++++++ 1 file changed, 105 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..2aa8025d1e24 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/mediatek,mt6357.yaml @@ -0,0 +1,105 @@ +# 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/mediatek,mt6397-rtc.yaml + description: + MT6357 Real Time Clock. + + 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"; + }; + }; + }; From patchwork Wed Nov 16 12:33:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Mergnat X-Patchwork-Id: 625346 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 C01D6C41535 for ; Wed, 16 Nov 2022 12:33:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232471AbiKPMdx (ORCPT ); Wed, 16 Nov 2022 07:33:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232974AbiKPMdo (ORCPT ); Wed, 16 Nov 2022 07:33:44 -0500 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56F4162CF for ; Wed, 16 Nov 2022 04:33:43 -0800 (PST) Received: by mail-wr1-x42a.google.com with SMTP id g12so29457389wrs.10 for ; Wed, 16 Nov 2022 04:33:43 -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=HqzG2A95Qy+V3Js2YnmOMMsM4ZOPDZrJYMVeOn8QJBg=; b=ro4TmpgCVdz80BIyEcjyKYx3/q3Fh2lMHd5yg0cfc+IQQ9nkQp9E7oUfsMKOw9lXS5 29WPeNsFh04WfEnCW3OMqQD5uXXDEvqiqB1Vi3jW5y7LrvrZX2aFQnzPAkmU19Dkaz0j QmbtmZEQDaYALd4oigi9bcTPfpMRc2AZcE6J/PY18lFRHg1iKZrdfKIcI7SoypFYT451 V+nDe4LaNMxFKIKMvBRhq8N5KpccohpYfatmqsic+afv56X5NdzJiKRzgMimEhiXOyci ZaKCd7vzPJh6519WFDrb09YJO3drGg7gkDJNrmhL/tSq0iOpY4TCs6efQunpBapRi6ae XtCw== 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=HqzG2A95Qy+V3Js2YnmOMMsM4ZOPDZrJYMVeOn8QJBg=; b=AkBVMa6k/hfxmSGSPicxiMT5wPVmjJ6eaT9xlVc3PxCR7b9OAV3qgCJdwmDHTuhaYW 6/wsk8PDo7H1kgN1AoX0TBGMSDfR0gN83D5qp+/7IvLwWMg0IG7yyBqFy+1hpSppo72s gW5XK7anhAoujYjON10CiuZPV4TBpIv0oB+/M7Q8Zi9XAqm8FJgnuViOdWSjd6Ov9bwQ exh75b3SgEJ+e4S+4Y94gDexZnFYx7j5ZsqCSA9IYl93DqohGJzJKT777nTgKv8MEndS DgETDoMNf7VI4XB/T4apeWlNBO3Y7fWI3P8IU3jmBq1RDfYiRZvmBv6+2sqloV22E/Ct LDgw== X-Gm-Message-State: ANoB5pk4pqBpOReOH5mA8nNgi6oCSXOsKT2GZM+gIerPuscZmSLGfgFa GByHP1r6xi6IUP+YcEVFr1rWAw== X-Google-Smtp-Source: AA0mqf4Gf1d8+Mg7JaqjbiGsjzK0ncUV/1NsBkYcA5A3zj6l0F8LqWTru42dSXB16t2YLWrXG7mcBA== X-Received: by 2002:a5d:54ce:0:b0:22a:f477:7bb6 with SMTP id x14-20020a5d54ce000000b0022af4777bb6mr13604734wrv.390.1668602022752; Wed, 16 Nov 2022 04:33:42 -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 z13-20020adff1cd000000b0024166413a4fsm15051607wro.37.2022.11.16.04.33.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 04:33:42 -0800 (PST) From: Alexandre Mergnat Date: Wed, 16 Nov 2022 13:33:00 +0100 Subject: [PATCH v5 06/10] dt-bindings: soc: mediatek: convert pwrap documentation MIME-Version: 1.0 Message-Id: <20221005-mt6357-support-v5-6-8210d955dd3d@baylibre.com> References: <20221005-mt6357-support-v5-0-8210d955dd3d@baylibre.com> In-Reply-To: <20221005-mt6357-support-v5-0-8210d955dd3d@baylibre.com> To: Flora Fu , Matthias Brugger , Dmitry Torokhov , Tianping Fang , Fabien Parent , Krzysztof Kozlowski , Liam Girdwood , Alexandre Belloni , Mark Brown , Sean Wang , Chen Zhong , Pavel Machek , Lee Jones , Alessandro Zummo , Rob Herring Cc: Krzysztof Kozlowski , Rob Herring , Mattijs Korpershoek , linux-mediatek@lists.infradead.org, Alexandre Mergnat , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-leds@vger.kernel.org, Fabien Parent , AngeloGioacchino Del Regno , linux-rtc@vger.kernel.org, linux-input@vger.kernel.org X-Mailer: b4 0.10.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=9532; i=amergnat@baylibre.com; h=from:subject:message-id; bh=SMS90aPuou5R7V3BK3qz6aBqSZLNv+XB8Kxtsil5lQg=; b=owEBbQKS/ZANAwAKAStGSZ1+MdRFAcsmYgBjdNieknsUQIZhu4ijNtJfoIpGY+YhKWdfNsi0yfUU GTKWKMWJAjMEAAEKAB0WIQQjG17X8+qqcA5g/osrRkmdfjHURQUCY3TYngAKCRArRkmdfjHURXa/D/ 934ndpfb7WCeZvO5b3VbwywwyoJ8jVY22dSeCJw7fqzEhos/pPAE3ir3vn2HRiCkJL/yhE8PIdDkgW Nhs5oqc+0zmf5Qub33HXltPb6yhp3iUZ9kM2M1Vm7N59oqAIz2nQmxpbIqeIkXUFVmAu30bsNjujYN keIq6sLN/bHvYcFDYLlIaIj9GDQQ/IP0SYn1I3dNFRAfh4HttBHaWKEomfWppiHpcTozsrPZJfZ9RF BaCc/Fd50I2Q60pM8NUWQXhOhDIXW4YquWnSKwuAbmIKxDTch4ceFcVPeV4NU9+qgIrlKCiMUW6dmD cLcMdR/UXXTuhRHMaYsKcYc/VfDBPk5bjU4+g6dS7Kzik/NQZxikuu5EyZoQsZtqlAWusiDdK2tyr/ YDosIsmb8qkforsnUrfdhTeBVBHbKwfDHsNMG+o6z+eWhLD/Ez/u74bmDASX27oy1u9uWL6WJoTZRh qlOuENaOsTJPPIdvE5Ds3fBAZMJpSHde1ITQEi2o28a489/J9hA6fRf/KtDhlcw2h5/IGjsZAL8v+F 0z+zKJrJZEkdgkZRADyvFZiZnPKCqvvRvIjcdiTxnLRelVRWY3czWLxUpMkN+Hqp0XrDuHQ0AdylQQ aKKhnKd+kZvtlawqLJ20qQoqSxqsv8Mlk3dYTdbcg85IvPKklDxZh8+gkhBA== X-Developer-Key: i=amergnat@baylibre.com; a=openpgp; fpr=231B5ED7F3EAAA700E60FE8B2B46499D7E31D445 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org - Convert soc/mediatek/pwrap.txt to soc/mediatek/mediatek,pwrap.yaml - MT8365 SoC has 2 additional clock items and a yaml schema for its PMIC - Remove pwrap.txt file Signed-off-by: Alexandre Mergnat --- .../devicetree/bindings/leds/leds-mt6323.txt | 2 +- Documentation/devicetree/bindings/mfd/mt6397.txt | 2 +- .../bindings/soc/mediatek/mediatek,pwrap.yaml | 145 +++++++++++++++++++++ .../devicetree/bindings/soc/mediatek/pwrap.txt | 75 ----------- 4 files changed, 147 insertions(+), 77 deletions(-) diff --git a/Documentation/devicetree/bindings/leds/leds-mt6323.txt b/Documentation/devicetree/bindings/leds/leds-mt6323.txt index 45bf9f7d85f3..73353692efa1 100644 --- a/Documentation/devicetree/bindings/leds/leds-mt6323.txt +++ b/Documentation/devicetree/bindings/leds/leds-mt6323.txt @@ -9,7 +9,7 @@ MT6323 PMIC hardware. For MT6323 MFD bindings see: Documentation/devicetree/bindings/mfd/mt6397.txt For MediaTek PMIC wrapper bindings see: -Documentation/devicetree/bindings/soc/mediatek/pwrap.txt +Documentation/devicetree/bindings/soc/mediatek/mediatek,pwrap.yaml Required properties: - compatible : Must be "mediatek,mt6323-led" diff --git a/Documentation/devicetree/bindings/mfd/mt6397.txt b/Documentation/devicetree/bindings/mfd/mt6397.txt index 79aaf21af8e9..3bee4a42555d 100644 --- a/Documentation/devicetree/bindings/mfd/mt6397.txt +++ b/Documentation/devicetree/bindings/mfd/mt6397.txt @@ -13,7 +13,7 @@ MT6397/MT6323 is a multifunction device with the following sub modules: It is interfaced to host controller using SPI interface by a proprietary hardware called PMIC wrapper or pwrap. MT6397/MT6323 MFD is a child device of pwrap. See the following for pwarp node definitions: -../soc/mediatek/pwrap.txt +../soc/mediatek/mediatek,pwrap.yaml This document describes the binding for MFD device and its sub module. diff --git a/Documentation/devicetree/bindings/soc/mediatek/mediatek,pwrap.yaml b/Documentation/devicetree/bindings/soc/mediatek/mediatek,pwrap.yaml new file mode 100644 index 000000000000..6d19f534e994 --- /dev/null +++ b/Documentation/devicetree/bindings/soc/mediatek/mediatek,pwrap.yaml @@ -0,0 +1,145 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/mediatek/mediatek,pwrap.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Mediatek PMIC Wrapper + +maintainers: + - Flora Fu + - Alexandre Mergnat + +description: | + On MediaTek SoCs the PMIC is connected via SPI. The SPI master interface + is not directly visible to the CPU, but only through the PMIC wrapper + inside the SoC. The communication between the SoC and the PMIC can + optionally be encrypted. Also a non standard Dual IO SPI mode can be + used to increase speed. + + IP Pairing + + On MT8135 the pins of some SoC internal peripherals can be on the PMIC. + The signals of these pins are routed over the SPI bus using the pwrap + bridge. In the binding description below the properties needed for bridging + are marked with "IP Pairing". These are optional on SoCs which do not support + IP Pairing + +properties: + compatible: + oneOf: + - items: + - enum: + - mediatek,mt2701-pwrap + - mediatek,mt6765-pwrap + - mediatek,mt6779-pwrap + - mediatek,mt6797-pwrap + - mediatek,mt6873-pwrap + - mediatek,mt7622-pwrap + - mediatek,mt8135-pwrap + - mediatek,mt8173-pwrap + - mediatek,mt8183-pwrap + - mediatek,mt8188-pwrap + - mediatek,mt8365-pwrap + - mediatek,mt8516-pwrap + - items: + - enum: + - mediatek,mt8186-pwrap + - mediatek,mt8195-pwrap + - const: syscon + + reg: + minItems: 1 + items: + - description: PMIC wrapper registers + - description: IP pairing registers + + reg-names: + minItems: 1 + items: + - const: pwrap + - const: pwrap-bridge + + interrupts: + maxItems: 1 + + clocks: + minItems: 2 + items: + - description: SPI bus clock + - description: Main module clock + - description: System module clock + - description: Timer module clock + + clock-names: + minItems: 2 + items: + - const: spi + - const: wrap + - const: sys + - const: tmr + + resets: + minItems: 1 + items: + - description: PMIC wrapper reset + - description: IP pairing reset + + reset-names: + minItems: 1 + items: + - const: pwrap + - const: pwrap-bridge + + pmic: + type: object + $ref: /schemas/regulator/mediatek,mt6357-regulator.yaml + +required: + - compatible + - reg + - reg-names + - interrupts + - clocks + - clock-names + +dependentRequired: + resets: [reset-names] + +allOf: + - if: + properties: + compatible: + contains: + const: mediatek,mt8365-pwrap + then: + properties: + clocks: + minItems: 4 + + clock-names: + minItems: 4 + +additionalProperties: false + +examples: + - | + #include + #include + #include + + soc { + #address-cells = <2>; + #size-cells = <2>; + pwrap: pwrap@1000d000 { + compatible = "mediatek,mt8365-pwrap"; + reg = <0 0x1000d000 0 0x1000>; + reg-names = "pwrap"; + interrupts = ; + clocks = <&infracfg CLK_IFR_PWRAP_SPI>, + <&infracfg CLK_IFR_PMIC_AP>, + <&infracfg CLK_IFR_PWRAP_SYS>, + <&infracfg CLK_IFR_PWRAP_TMR>; + clock-names = "spi", "wrap", "sys", "tmr"; + }; + }; diff --git a/Documentation/devicetree/bindings/soc/mediatek/pwrap.txt b/Documentation/devicetree/bindings/soc/mediatek/pwrap.txt deleted file mode 100644 index 8424b93c432e..000000000000 --- a/Documentation/devicetree/bindings/soc/mediatek/pwrap.txt +++ /dev/null @@ -1,75 +0,0 @@ -MediaTek PMIC Wrapper Driver - -This document describes the binding for the MediaTek PMIC wrapper. - -On MediaTek SoCs the PMIC is connected via SPI. The SPI master interface -is not directly visible to the CPU, but only through the PMIC wrapper -inside the SoC. The communication between the SoC and the PMIC can -optionally be encrypted. Also a non standard Dual IO SPI mode can be -used to increase speed. - -IP Pairing - -on MT8135 the pins of some SoC internal peripherals can be on the PMIC. -The signals of these pins are routed over the SPI bus using the pwrap -bridge. In the binding description below the properties needed for bridging -are marked with "IP Pairing". These are optional on SoCs which do not support -IP Pairing - -Required properties in pwrap device node. -- compatible: - "mediatek,mt2701-pwrap" for MT2701/7623 SoCs - "mediatek,mt6765-pwrap" for MT6765 SoCs - "mediatek,mt6779-pwrap" for MT6779 SoCs - "mediatek,mt6797-pwrap" for MT6797 SoCs - "mediatek,mt6873-pwrap" for MT6873/8192 SoCs - "mediatek,mt7622-pwrap" for MT7622 SoCs - "mediatek,mt8135-pwrap" for MT8135 SoCs - "mediatek,mt8173-pwrap" for MT8173 SoCs - "mediatek,mt8183-pwrap" for MT8183 SoCs - "mediatek,mt8186-pwrap" for MT8186 SoCs - "mediatek,mt8188-pwrap", "mediatek,mt8195-pwrap" for MT8188 SoCs - "mediatek,mt8195-pwrap" for MT8195 SoCs - "mediatek,mt8365-pwrap" for MT8365 SoCs - "mediatek,mt8516-pwrap" for MT8516 SoCs -- interrupts: IRQ for pwrap in SOC -- reg-names: "pwrap" is required; "pwrap-bridge" is optional. - "pwrap": Main registers base - "pwrap-bridge": bridge base (IP Pairing) -- reg: Must contain an entry for each entry in reg-names. -- clock-names: Must include the following entries: - "spi": SPI bus clock - "wrap": Main module clock - "sys": System module clock (for MT8365 SoC) - "tmr": Timer module clock (for MT8365 SoC) -- clocks: Must contain an entry for each entry in clock-names. - -Optional properities: -- reset-names: Some SoCs include the following entries: - "pwrap" - "pwrap-bridge" (IP Pairing) -- resets: Must contain an entry for each entry in reset-names. -- pmic: Using either MediaTek PMIC MFD as the child device of pwrap - See the following for child node definitions: - Documentation/devicetree/bindings/mfd/mt6397.txt - or the regulator-only device as the child device of pwrap, such as MT6380. - See the following definitions for such kinds of devices. - Documentation/devicetree/bindings/regulator/mt6380-regulator.txt - -Example: - pwrap: pwrap@1000f000 { - compatible = "mediatek,mt8135-pwrap"; - reg = <0 0x1000f000 0 0x1000>, - <0 0x11017000 0 0x1000>; - reg-names = "pwrap", "pwrap-bridge"; - interrupts = ; - resets = <&infracfg MT8135_INFRA_PMIC_WRAP_RST>, - <&pericfg MT8135_PERI_PWRAP_BRIDGE_SW_RST>; - reset-names = "pwrap", "pwrap-bridge"; - clocks = <&clk26m>, <&clk26m>; - clock-names = "spi", "wrap"; - - pmic { - compatible = "mediatek,mt6397"; - }; - }; From patchwork Wed Nov 16 12:33:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Mergnat X-Patchwork-Id: 625345 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 BE1A4C43219 for ; Wed, 16 Nov 2022 12:34:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238962AbiKPMeJ (ORCPT ); Wed, 16 Nov 2022 07:34:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229702AbiKPMdq (ORCPT ); Wed, 16 Nov 2022 07:33:46 -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 5A9926316 for ; Wed, 16 Nov 2022 04:33:45 -0800 (PST) Received: by mail-wr1-x42e.google.com with SMTP id bs21so29687407wrb.4 for ; Wed, 16 Nov 2022 04:33:45 -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=WJeLrYqcWtMc9mhPkVpaKIYTLHS4W3xdI9EsCwSsotY=; b=RE+scfJigrRMGaRyqu0nvEmq1ouw7HTydTee5XM1yNQHzz2DPFWGaPOLWChQ7hD/bw hs+CcD1wXGvVCf4y7B03pA9900k1R3YoSr8OO+M2pZglCBGrZza25ycrkmSaIGg5O/sG QMdl2tSrpofSupK8ENFv4BEeL8HzVzdUTjNs5+/N5ESObwI7N/RfvY0EIFyhmzcX2SRy juPjNn0YB9OvQsritJSAoiMojl5PQCzLCipb7lueI0SacRGPR53XB9bdiBmZLhTNGGFp vJPmEFyFPCB4ylVD9blqvfliP06L1nldV0B4W/8ogT0o6eb2zgnPxQuaX1YfjMDg1MkO A+IQ== 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=WJeLrYqcWtMc9mhPkVpaKIYTLHS4W3xdI9EsCwSsotY=; b=njQtDj2sQqm+d/K/bx5PbkPW7Hruky7A82sWKM4UUnVq5Fybl4fGGd16iPODkRg0V1 QY6Lb7KsbZmhCvOGEVFyW8mQLuMrP8zQi1VSmdAayswyxbDjwFnM6Csd9aCWdhA2pkIe jMzSBrTz+nzb0wUrgyLLyUqRiXkoVHnl0D9pVqQEt8yi3FY4Q+XRPi24NexCl76VZhmW BLo9wVBm3O8uMrdJisQv7jdq64ZyV/IUFRP0A20/0dedMWbA7WLglbaSOG8NK5qAta0c 2NoH8Y6QgV91aFxII88IBg5XLtrOrzNikm1H+Hd3c2MQCgXDJdRBm3i531gzcQKVqbd3 0XSQ== X-Gm-Message-State: ANoB5pkC+9J9xxxGbiwgOuTmlaTC/xS1110DReZt/qsmdFsOjwPSO56Y PgOy8xv2ZEoUAy9WewbcPwDlhg== X-Google-Smtp-Source: AA0mqf6HkkidY2au285VnM9daJO71u6fvJ/Ee92zMFYf2K2lAlbcB4yuAhtUtofCKcLOVlB4jTULzw== X-Received: by 2002:adf:f244:0:b0:236:6fcb:a0b0 with SMTP id b4-20020adff244000000b002366fcba0b0mr13558904wrp.555.1668602023853; Wed, 16 Nov 2022 04:33:43 -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 z13-20020adff1cd000000b0024166413a4fsm15051607wro.37.2022.11.16.04.33.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 04:33:43 -0800 (PST) From: Alexandre Mergnat Date: Wed, 16 Nov 2022 13:33:01 +0100 Subject: [PATCH v5 07/10] arm64: dts: mt6358: change node names MIME-Version: 1.0 Message-Id: <20221005-mt6357-support-v5-7-8210d955dd3d@baylibre.com> References: <20221005-mt6357-support-v5-0-8210d955dd3d@baylibre.com> In-Reply-To: <20221005-mt6357-support-v5-0-8210d955dd3d@baylibre.com> To: Flora Fu , Matthias Brugger , Dmitry Torokhov , Tianping Fang , Fabien Parent , Krzysztof Kozlowski , Liam Girdwood , Alexandre Belloni , Mark Brown , Sean Wang , Chen Zhong , Pavel Machek , Lee Jones , Alessandro Zummo , Rob Herring Cc: Krzysztof Kozlowski , Rob Herring , Mattijs Korpershoek , linux-mediatek@lists.infradead.org, Alexandre Mergnat , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-leds@vger.kernel.org, Fabien Parent , AngeloGioacchino Del Regno , linux-rtc@vger.kernel.org, linux-input@vger.kernel.org X-Mailer: b4 0.10.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1271; i=amergnat@baylibre.com; h=from:subject:message-id; bh=c7wPKy75bT8ebg54aEIMfSMAkZtNftilP/SW804aUPE=; b=owEBbQKS/ZANAwAKAStGSZ1+MdRFAcsmYgBjdNiejIJtPhWDcTqkPa+DfNFlbKX7l7D8TkEpyMUG ztTqHjqJAjMEAAEKAB0WIQQjG17X8+qqcA5g/osrRkmdfjHURQUCY3TYngAKCRArRkmdfjHURcRyD/ 93F7fWMEdJHVtnI9fw/5HzQJKi6Nie03CM3jv3sTRmtBH6Ea3N4jGFw1znI5sNkLA1o8991rCWjgn2 feUCtH8fz45tV+QWRpQQRUpz1qLsyu33zsYbd87ZILmN9U4iSaqhfYwq7f2G7HDpvlvyzYlaA6EW61 yRyzPT1/ujM0XdKOuRbC4GtNLa6rBNuTE+aHdj+qVZLUf0vF8SMx3IKvyDOTxKxW3mu/5+S6YvZlWH cgGitiNc+OkIIP5EPBvNjFHupaSRdY1PObh/KRloKjUBks9CLmjO8I9QDmGE8TcUSnWo0/yGTy65Nv TnnzanzPfgb2RZ2hIC2cnuajyD+WX3dBI4AF28EgmlYj4f0BaWaoXySTDUKEXkBe3DP90/I6iue6A3 m3gsO1h9wcs0wONAzTqGH42FHuoUUYlSwjzrMf20PzLHxia/qNWlWi+zJKjNM5PjZJpJ5eiDpnZzNn iu0+t5DlWavoYJWUAUNT77uQo0/HTIVJ8JTHTZNQpMLs08A+lXEPy/uoo2zl4nVTRdhEg8ANx5lsLw riNrVFh9Ela760/vFiT82nAdfKA5hfwLST7PpjVliBrioNb3g0TrK7P6ZplT1wQRBA6abt97wybCt8 37UhsEWRGHba9hq3JF0fDrsrueGQUAihKf66SsTYBd1WO7DDA2eTHr6mKwRA== X-Developer-Key: i=amergnat@baylibre.com; a=openpgp; fpr=231B5ED7F3EAAA700E60FE8B2B46499D7E31D445 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org - Change the node name from "mt6358" to "pmic" to be consistent with mediatek,pwrap.yaml documentation. - Change the node name from "mt6358rtc" to "rtc" to be consistent with mediatek,mt6397-rtc.yaml documentation. - Change the node name from "mt6358keys" to "keys" to be consistent with mediatek,pmic-keys.yaml documentation. Signed-off-by: Alexandre Mergnat --- arch/arm64/boot/dts/mediatek/mt6358.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm64/boot/dts/mediatek/mt6358.dtsi b/arch/arm64/boot/dts/mediatek/mt6358.dtsi index 98f3b0e0c9f6..b605313bed99 100644 --- a/arch/arm64/boot/dts/mediatek/mt6358.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt6358.dtsi @@ -5,7 +5,7 @@ #include &pwrap { - pmic: mt6358 { + pmic: pmic { compatible = "mediatek,mt6358"; interrupt-controller; interrupt-parent = <&pio>; @@ -355,11 +355,11 @@ mt6358_vsim2_reg: ldo_vsim2 { }; }; - mt6358rtc: mt6358rtc { + mt6358rtc: rtc { compatible = "mediatek,mt6358-rtc"; }; - mt6358keys: mt6358keys { + mt6358keys: keys { compatible = "mediatek,mt6358-keys"; power { linux,keycodes = ; From patchwork Wed Nov 16 12:33:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Mergnat X-Patchwork-Id: 625948 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 0FA79C43217 for ; Wed, 16 Nov 2022 12:34:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233594AbiKPMeL (ORCPT ); Wed, 16 Nov 2022 07:34:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230003AbiKPMdq (ORCPT ); Wed, 16 Nov 2022 07:33:46 -0500 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84BCE65FD for ; Wed, 16 Nov 2022 04:33:45 -0800 (PST) Received: by mail-wr1-x42a.google.com with SMTP id g12so29457546wrs.10 for ; Wed, 16 Nov 2022 04:33:45 -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=L20WZDfB4Ry2n4XJgPN1jHb78hlwsc6RiwrnFa7B3l8=; b=2sgjlHBxqdWwtFrhVJB8iW1yxKZ2cpU/ng8+DLzHv8kTH5P754dpAb3i+qLO59zY5f tAbYx0PuP86OqDYnTs72Ms53vR2exDNmjxomDaB1gm+YI8W2cH9nUil+4gtWVF2dIsSf kfGCzQmrbL0lMaIGwqi0MHWl5PvA3WRK1o6j1sAqDG3QEShsMYMvebNMKEzg15YrS427 V53Z9em/ftamEDGvGQNrQ2jz0zQs0kuSa+JfZzLdfHY7lTULX0agNVup6zZeluIWF5T+ bKzHWjUvuL35aGT/PJraaZr5q+NopvYkIF797b220EBOjAM5WNn4T1MJdmse0c6hrdoL q4LA== 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=L20WZDfB4Ry2n4XJgPN1jHb78hlwsc6RiwrnFa7B3l8=; b=OUzOUq4pneTfg2ICIA0rFPlyMUMLSsPWgqKt18DtJlMokaH1Su4HTJMCiAzsnEsAqA aNomRT8PLBBv3jCA/TGnexHRhnGV3jodvdXGep0AI6aWkZIBtexLnjq5uAmhK98sb7UW VigpfUpNNOTpWouwOfr2nbUbZXEsz/WjRgTkWeNBXI/TOLsB2KkE64GqT4JIz0RzTynG ccykzjyQiSVdTPN5M3DI2lQChgfuWZphVwgUQyJK6PkV8uHryQIL7ZqtLMNqS+DwK3h4 j2gBVuLwJVb5IHVHbYWRd36z1G7qJzpGSXkTWRruS26dHtkIYF0qsPK7a1gvwTunysH2 fAUQ== X-Gm-Message-State: ANoB5pnIProYg7OCkdh5TXu7dOzw5WAKz9o3odqTzdx3d1U98/eSIUg1 TvVnCgmxhJVDVkBD6gdd1VfXxg== X-Google-Smtp-Source: AA0mqf4khQTenypGm3STBNu3vcrYHdKH0RrgEXM0QSi8ly0xCjMQR/O3vU6YbPaA5xg5D2azqPyn0g== X-Received: by 2002:adf:fcce:0:b0:236:6ab6:a51c with SMTP id f14-20020adffcce000000b002366ab6a51cmr14184436wrs.54.1668602025031; Wed, 16 Nov 2022 04:33:45 -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 z13-20020adff1cd000000b0024166413a4fsm15051607wro.37.2022.11.16.04.33.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 04:33:44 -0800 (PST) From: Alexandre Mergnat Date: Wed, 16 Nov 2022 13:33:02 +0100 Subject: [PATCH v5 08/10] arm64: dts: mt8173: change node name MIME-Version: 1.0 Message-Id: <20221005-mt6357-support-v5-8-8210d955dd3d@baylibre.com> References: <20221005-mt6357-support-v5-0-8210d955dd3d@baylibre.com> In-Reply-To: <20221005-mt6357-support-v5-0-8210d955dd3d@baylibre.com> To: Flora Fu , Matthias Brugger , Dmitry Torokhov , Tianping Fang , Fabien Parent , Krzysztof Kozlowski , Liam Girdwood , Alexandre Belloni , Mark Brown , Sean Wang , Chen Zhong , Pavel Machek , Lee Jones , Alessandro Zummo , Rob Herring Cc: Krzysztof Kozlowski , Rob Herring , Mattijs Korpershoek , linux-mediatek@lists.infradead.org, Alexandre Mergnat , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-leds@vger.kernel.org, Fabien Parent , AngeloGioacchino Del Regno , linux-rtc@vger.kernel.org, linux-input@vger.kernel.org X-Mailer: b4 0.10.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1290; i=amergnat@baylibre.com; h=from:subject:message-id; bh=GBaNKrSWOOj3IIbimro7kSOdhFcUdE4vLaUrLB+TgIA=; b=owEBbQKS/ZANAwAKAStGSZ1+MdRFAcsmYgBjdNiegKLOAjGwCfqePOAUGXCPeQFCHu6Os+/wzG+t VrGU5r2JAjMEAAEKAB0WIQQjG17X8+qqcA5g/osrRkmdfjHURQUCY3TYngAKCRArRkmdfjHURdAID/ 47+yQajMgunjJTszn1jqdu1ck+aZ9AoF/9pqC/z6QZxgFuZ4f+Lus/UfxCPM179jOS691bjF3ThMRg okUP8GEWY138LjJk2dmziTA8OH+VMdXO8SSiLwjX4MBGIFuak6cH8wPpFZJb8IxsaMaeF5jHk07WOg MgXjeuhcsV8rALPPv9B83HRjh2bBbmokwxh+jsW0r4jEGuwMwlr3xjXEjpCaih888TVWpq42og79Y3 IVKUQEzoKuI19+dvvDO1FBU47Asy5BNqj373EP2qbYCP32qpyHUL5EHmn9rGMfF0hYUP6LnLUbqIX0 WfTtBJvfc9IFgRIM7/04l7Z0j5HeUE4WQLi8jxSRs4QrFE6JQ8GsdmtdRQ+R4WyiamiSvxqf4RALjF 6kOXgfCmCIqn2Y2s23SRIFiX0vlqnEkYh6B9psS2wqyWZPwMQyQsIgUwrbVQemHT8iMBBUflJwl1We 864KwSHLGPnlm0J1zRvNzETRmg52ri4tSfANr1rb9MtiGTQFh0zFAhHAAmm8ELziYZkZWOK5jHzeul Wqd0vAV4OlB26cuo545E5CUOL/Z9+rW8fd0h0mdUOH9piOoR+vcz8pEggiRJIfDG5hbO2qCl3/MPst wpONj0Xw9HlH3ko32pbBvWMn3AW2BOUpLH6SXkL31avYSrnNDxXVrwz2fNbw== X-Developer-Key: i=amergnat@baylibre.com; a=openpgp; fpr=231B5ED7F3EAAA700E60FE8B2B46499D7E31D445 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org - Change the node name from "mt6397" to "pmic" to be consistent with mediatek,pwrap.yaml documentation. Signed-off-by: Alexandre Mergnat --- arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi | 2 +- arch/arm64/boot/dts/mediatek/mt8173-evb.dts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi b/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi index e21feb85d822..a8f5c48e1782 100644 --- a/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi @@ -913,7 +913,7 @@ &pwm0 { }; &pwrap { - pmic: mt6397 { + pmic: pmic { compatible = "mediatek,mt6397"; #address-cells = <1>; #size-cells = <1>; diff --git a/arch/arm64/boot/dts/mediatek/mt8173-evb.dts b/arch/arm64/boot/dts/mediatek/mt8173-evb.dts index 0b5f154007be..755df5694234 100644 --- a/arch/arm64/boot/dts/mediatek/mt8173-evb.dts +++ b/arch/arm64/boot/dts/mediatek/mt8173-evb.dts @@ -300,7 +300,7 @@ &pwrap { /* Only MT8173 E1 needs USB power domain */ power-domains = <&spm MT8173_POWER_DOMAIN_USB>; - pmic: mt6397 { + pmic: pmic { compatible = "mediatek,mt6397"; interrupt-parent = <&pio>; interrupts = <11 IRQ_TYPE_LEVEL_HIGH>; From patchwork Wed Nov 16 12:33:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Mergnat X-Patchwork-Id: 625344 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 1DA79C43219 for ; Wed, 16 Nov 2022 12:34:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239020AbiKPMe0 (ORCPT ); Wed, 16 Nov 2022 07:34:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238495AbiKPMds (ORCPT ); Wed, 16 Nov 2022 07:33:48 -0500 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C558F2726 for ; Wed, 16 Nov 2022 04:33:46 -0800 (PST) Received: by mail-wr1-x432.google.com with SMTP id d9so24965757wrm.13 for ; Wed, 16 Nov 2022 04:33:46 -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=DuMPxdzffWOuF224lmzrhI5UgZe8q5UR3k/iWhLR51I=; b=FJ2if3lgIWED8ALFOiHvaaPoVTpZ7zE7+nsmHcScGdzktN/BpUlrxcPHsMnCrEFOs4 Y3qJ04ButNNyZ9AlnNB5eEyUr+M4x+pbFPLj36Yw7oEcAbJ8R7Z2V8ibHlUiK8HYEGRv vhxXxFB6MLViev+8P7We2lwGhVFf2TSRCSf83hJiH11MmdsYBnbC2jeYytKg0GA1cM6l glmLODQBJCJcI4A8mTgPISL++vtiCqumeIVA+4qwgdhQlGMVCfjIkAmk7uxIzBrd95vl 7Io4bmpJJB+QzyXGQaJbDMl4lJPd+QRNq+GZt3hbKx4Z/IfnLMckFzXYo7dJZ7eIuplN YkKw== 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=DuMPxdzffWOuF224lmzrhI5UgZe8q5UR3k/iWhLR51I=; b=X3QLoxIhfEuiB79sZMxfl2WCSsnQIjL2V6kmnDtTN+Vmi0xhbvxdFZGzRjm3eHmGmS 2QdlcdN0xz7UkM27QSDlDY63HgYL3k6Pvn6Tf8+C7wtBK1Rb4jfo9JJNP5tMVGVnPheX X+puOSvvO4yHLVWTAj+FyP2wcwwyqf5JoqB3thDd9NAn38+YkcfnaLJq537I6MRgAIt2 BZn1sA3Aa5STcryhJ4Toch4Zj8a4TjqpQHiBXy6TMoPkNXuMvzgqDhQdcgV+/J8KAqV6 gkUwICQvXffGGx3i1OjyZdmv4YcABzOTxRHRzzPeyQPVi9iUsGmaqP8ldEYu4W9O4vV0 rT8A== X-Gm-Message-State: ANoB5plUGPLO02o7U3uTYxTrV4LP5YTGQcuxFUsaO4+fhzHhILUoDNtB hdEriX0i6xzti0mHs4GRlSc05g== X-Google-Smtp-Source: AA0mqf72k8HGScyNGRVflJcI+VcX/y6WK6qWrq+I+nNe85XmJjOhCBaOmUxjQeU8JXB7lf14vbD5gw== X-Received: by 2002:a5d:6885:0:b0:22e:3460:5e28 with SMTP id h5-20020a5d6885000000b0022e34605e28mr13895016wru.211.1668602026178; Wed, 16 Nov 2022 04:33:46 -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 z13-20020adff1cd000000b0024166413a4fsm15051607wro.37.2022.11.16.04.33.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 04:33:45 -0800 (PST) From: Alexandre Mergnat Date: Wed, 16 Nov 2022 13:33:03 +0100 Subject: [PATCH v5 09/10] regulator: add mt6357 regulator MIME-Version: 1.0 Message-Id: <20221005-mt6357-support-v5-9-8210d955dd3d@baylibre.com> References: <20221005-mt6357-support-v5-0-8210d955dd3d@baylibre.com> In-Reply-To: <20221005-mt6357-support-v5-0-8210d955dd3d@baylibre.com> To: Flora Fu , Matthias Brugger , Dmitry Torokhov , Tianping Fang , Fabien Parent , Krzysztof Kozlowski , Liam Girdwood , Alexandre Belloni , Mark Brown , Sean Wang , Chen Zhong , Pavel Machek , Lee Jones , Alessandro Zummo , Rob Herring Cc: Krzysztof Kozlowski , Rob Herring , Mattijs Korpershoek , linux-mediatek@lists.infradead.org, Alexandre Mergnat , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-leds@vger.kernel.org, Fabien Parent , AngeloGioacchino Del Regno , linux-rtc@vger.kernel.org, linux-input@vger.kernel.org X-Mailer: b4 0.10.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=15626; i=amergnat@baylibre.com; h=from:subject:message-id; bh=3dEPAfwyo13Hx41orJp9vPoN+PW11vkwkpbCNu9EWtY=; b=owEBbQKS/ZANAwAKAStGSZ1+MdRFAcsmYgBjdNiet9N1d3o/YNdxjO+oUuAftMnyYdRK3zCs5jQL 473FM5yJAjMEAAEKAB0WIQQjG17X8+qqcA5g/osrRkmdfjHURQUCY3TYngAKCRArRkmdfjHURZ5nD/ 9FV0TYi/ZRqA9prkh3GW2/oU+9dxCIJm9QkKt+4YcZpbrL+EvYszOAxT4XH3mviYC48+P4Gh1NhHEx 3GecvHO/BWzbqTtNW5m/g54cjJtkJp3MmgTFUr3gzZQkVAPgmsJRrQNv18SIZwe0U/cnyd0Cgqj+Or bNW7aj3V3XEMgFIotyu42z42F6L23ps+ZgBghMwrMRKt6/Gi3BYztrFn4aG0IL8JaoyiK9GHidYXTM n8J0QNAi1P010qTS7XC7mihPlBnNqK0Q8Tjzmhx2cClUIjoFLydFzg6UHu2kr4PXcaY+HKt/u3KJjC uyyCkkoimsP1TJxv1GQauw6AheY3D6HSUv6DfnmoafJ/QGq+cIEl4SsU4g+dHQ6qxAvJ/OUJ7OPH2z y5Us+VZJaeLqCGhLgLKhiYXOUXuvCTmA2ipsaF5XdFRoY/y2NfKszQHfdchanCYsk4j2ZIJX4CHxlE wzOkWhZ3s2m+sgYZgbPb4QQUlXTHpDrOkDw/RAvwwOetIZ7GSnMC6S5sXJq7459WfFN1VTqJBe/5bN FESscSVhmN8yDshe//CWawPbEW1a8AHlzcVL8aGIqPigP2qm0P60dUc/XW22MnYr+0/CITpyl+pt+/ Vv9nh5vqIGaMI61uX3/FTmoLRiNrJtBbeK+X0ElcdJ568j+pDQ3bqoBvfxPw== X-Developer-Key: i=amergnat@baylibre.com; a=openpgp; fpr=231B5ED7F3EAAA700E60FE8B2B46499D7E31D445 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org From: Fabien Parent Add regulator driver for the MT6357 PMIC. Signed-off-by: Fabien Parent Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Alexandre Mergnat --- drivers/regulator/Kconfig | 9 + drivers/regulator/Makefile | 1 + drivers/regulator/mt6357-regulator.c | 454 +++++++++++++++++++++++++++++ include/linux/regulator/mt6357-regulator.h | 51 ++++ 4 files changed, 515 insertions(+) diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig index 070e4403c6c2..a659a57438f4 100644 --- a/drivers/regulator/Kconfig +++ b/drivers/regulator/Kconfig @@ -805,6 +805,15 @@ config REGULATOR_MT6332 This driver supports the control of different power rails of device through regulator interface +config REGULATOR_MT6357 + tristate "MediaTek MT6357 PMIC" + depends on MFD_MT6397 + help + Say y here to select this option to enable the power regulator of + MediaTek MT6357 PMIC. + This driver supports the control of different power rails of device + through regulator interface. + config REGULATOR_MT6358 tristate "MediaTek MT6358 PMIC" depends on MFD_MT6397 diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile index 5962307e1130..e4d67b7b1af6 100644 --- a/drivers/regulator/Makefile +++ b/drivers/regulator/Makefile @@ -97,6 +97,7 @@ obj-$(CONFIG_REGULATOR_MT6315) += mt6315-regulator.o obj-$(CONFIG_REGULATOR_MT6323) += mt6323-regulator.o obj-$(CONFIG_REGULATOR_MT6331) += mt6331-regulator.o obj-$(CONFIG_REGULATOR_MT6332) += mt6332-regulator.o +obj-$(CONFIG_REGULATOR_MT6357) += mt6357-regulator.o obj-$(CONFIG_REGULATOR_MT6358) += mt6358-regulator.o obj-$(CONFIG_REGULATOR_MT6359) += mt6359-regulator.o obj-$(CONFIG_REGULATOR_MT6360) += mt6360-regulator.o diff --git a/drivers/regulator/mt6357-regulator.c b/drivers/regulator/mt6357-regulator.c new file mode 100644 index 000000000000..0a1a847003b1 --- /dev/null +++ b/drivers/regulator/mt6357-regulator.c @@ -0,0 +1,454 @@ +// SPDX-License-Identifier: GPL-2.0 +// +// Copyright (c) 2022 MediaTek Inc. +// Copyright (c) 2022 BayLibre, SAS. +// Author: Chen Zhong +// Author: Fabien Parent +// Author: Alexandre Mergnat +// +// Based on mt6397-regulator.c +// + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * MT6357 regulators' information + * + * @desc: standard fields of regulator description. + * @da_vsel_reg: Monitor register for query buck's voltage. + * @da_vsel_mask: Mask for query buck's voltage. + */ +struct mt6357_regulator_info { + struct regulator_desc desc; + u32 da_vsel_reg; + u32 da_vsel_mask; +}; + +#define MT6357_BUCK(match, vreg, min, max, step, \ + volt_ranges, vosel_reg, vosel_mask, _da_vsel_mask) \ +[MT6357_ID_##vreg] = { \ + .desc = { \ + .name = #vreg, \ + .of_match = of_match_ptr(match), \ + .regulators_node = "regulators", \ + .ops = &mt6357_volt_range_ops, \ + .type = REGULATOR_VOLTAGE, \ + .id = MT6357_ID_##vreg, \ + .owner = THIS_MODULE, \ + .n_voltages = ((max) - (min)) / (step) + 1, \ + .linear_ranges = volt_ranges, \ + .n_linear_ranges = ARRAY_SIZE(volt_ranges), \ + .vsel_reg = vosel_reg, \ + .vsel_mask = vosel_mask, \ + .enable_reg = MT6357_BUCK_##vreg##_CON0, \ + .enable_mask = BIT(0), \ + }, \ + .da_vsel_reg = MT6357_BUCK_##vreg##_DBG0, \ + .da_vsel_mask = vosel_mask, \ +} + +#define MT6357_LDO(match, vreg, ldo_volt_table, \ + enreg, vosel, vosel_mask) \ +[MT6357_ID_##vreg] = { \ + .desc = { \ + .name = #vreg, \ + .of_match = of_match_ptr(match), \ + .regulators_node = "regulators", \ + .ops = &mt6357_volt_table_ops, \ + .type = REGULATOR_VOLTAGE, \ + .id = MT6357_ID_##vreg, \ + .owner = THIS_MODULE, \ + .n_voltages = ARRAY_SIZE(ldo_volt_table), \ + .volt_table = ldo_volt_table, \ + .vsel_reg = vosel, \ + .vsel_mask = vosel_mask, \ + .enable_reg = enreg, \ + .enable_mask = BIT(0), \ + }, \ +} + +#define MT6357_LDO1(match, vreg, min, max, step, volt_ranges, \ + enreg, vosel, vosel_mask) \ +[MT6357_ID_##vreg] = { \ + .desc = { \ + .name = #vreg, \ + .of_match = of_match_ptr(match), \ + .regulators_node = "regulators", \ + .ops = &mt6357_volt_range_ops, \ + .type = REGULATOR_VOLTAGE, \ + .id = MT6357_ID_##vreg, \ + .owner = THIS_MODULE, \ + .n_voltages = ((max) - (min)) / (step) + 1, \ + .linear_ranges = volt_ranges, \ + .n_linear_ranges = ARRAY_SIZE(volt_ranges), \ + .vsel_reg = vosel, \ + .vsel_mask = vosel_mask, \ + .enable_reg = enreg, \ + .enable_mask = BIT(0), \ + }, \ + .da_vsel_reg = MT6357_LDO_##vreg##_DBG0, \ + .da_vsel_mask = 0x7f00, \ +} + +#define MT6357_REG_FIXED(match, vreg, volt) \ +[MT6357_ID_##vreg] = { \ + .desc = { \ + .name = #vreg, \ + .of_match = of_match_ptr(match), \ + .regulators_node = "regulators", \ + .ops = &mt6357_volt_fixed_ops, \ + .type = REGULATOR_VOLTAGE, \ + .id = MT6357_ID_##vreg, \ + .owner = THIS_MODULE, \ + .n_voltages = 1, \ + .enable_reg = MT6357_LDO_##vreg##_CON0, \ + .enable_mask = BIT(0), \ + .min_uV = volt, \ + }, \ +} + +/** + * mt6357_get_buck_voltage_sel - get_voltage_sel for regmap users + * + * @rdev: regulator to operate on + * + * Regulators that use regmap for their register I/O can set the + * da_vsel_reg and da_vsel_mask fields in the info structure and + * then use this as their get_voltage_vsel operation. + */ +static int mt6357_get_buck_voltage_sel(struct regulator_dev *rdev) +{ + int ret, regval; + struct mt6357_regulator_info *info = rdev_get_drvdata(rdev); + + ret = regmap_read(rdev->regmap, info->da_vsel_reg, ®val); + if (ret != 0) { + dev_err(&rdev->dev, + "Failed to get mt6357 Buck %s vsel reg: %d\n", + info->desc.name, ret); + return ret; + } + + regval &= info->da_vsel_mask; + regval >>= ffs(info->da_vsel_mask) - 1; + + return regval; +} + +static const struct regulator_ops mt6357_volt_range_ops = { + .list_voltage = regulator_list_voltage_linear_range, + .map_voltage = regulator_map_voltage_linear_range, + .set_voltage_sel = regulator_set_voltage_sel_regmap, + .get_voltage_sel = mt6357_get_buck_voltage_sel, + .set_voltage_time_sel = regulator_set_voltage_time_sel, + .enable = regulator_enable_regmap, + .disable = regulator_disable_regmap, + .is_enabled = regulator_is_enabled_regmap, +}; + +static const struct regulator_ops mt6357_volt_table_ops = { + .list_voltage = regulator_list_voltage_table, + .map_voltage = regulator_map_voltage_iterate, + .set_voltage_sel = regulator_set_voltage_sel_regmap, + .get_voltage_sel = regulator_get_voltage_sel_regmap, + .set_voltage_time_sel = regulator_set_voltage_time_sel, + .enable = regulator_enable_regmap, + .disable = regulator_disable_regmap, + .is_enabled = regulator_is_enabled_regmap, +}; + +static const struct regulator_ops mt6357_volt_fixed_ops = { + .list_voltage = regulator_list_voltage_linear, + .enable = regulator_enable_regmap, + .disable = regulator_disable_regmap, + .is_enabled = regulator_is_enabled_regmap, +}; + +static const int vxo22_voltages[] = { + 2200000, + 0, + 2400000, +}; + +static const int vefuse_voltages[] = { + 1200000, + 1300000, + 1500000, + 0, + 1800000, + 0, + 0, + 0, + 0, + 2800000, + 2900000, + 3000000, + 0, + 3300000, +}; + +static const int vcn33_voltages[] = { + 0, + 3300000, + 3400000, + 3500000, +}; + +static const int vcama_voltages[] = { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2500000, + 0, + 0, + 2800000, +}; + +static const int vcamd_voltages[] = { + 0, + 0, + 0, + 0, + 1000000, + 1100000, + 1200000, + 1300000, + 0, + 1500000, + 0, + 0, + 1800000, +}; + +static const int vldo28_voltages[] = { + 0, + 2800000, + 0, + 3000000, +}; + +static const int vdram_voltages[] = { + 0, + 1100000, + 1200000, +}; + +static const int vsim_voltages[] = { + 0, + 0, + 0, + 1700000, + 1800000, + 0, + 0, + 0, + 2700000, + 0, + 0, + 3000000, + 3100000, +}; + +static const int vibr_voltages[] = { + 1200000, + 1300000, + 1500000, + 0, + 1800000, + 2000000, + 0, + 0, + 0, + 2800000, + 0, + 3000000, + 0, + 3300000, +}; + +static const int vmc_voltages[] = { + 0, + 0, + 0, + 0, + 1800000, + 0, + 0, + 0, + 0, + 0, + 2900000, + 3000000, + 0, + 3300000, +}; + +static const int vmch_voltages[] = { + 0, + 0, + 2900000, + 3000000, + 0, + 3300000, +}; + +static const int vemc_voltages[] = { + 0, + 0, + 2900000, + 3000000, + 0, + 3300000, +}; + +static const int vusb_voltages[] = { + 0, + 0, + 0, + 3000000, + 3100000, +}; + +static const struct linear_range buck_volt_range1[] = { + REGULATOR_LINEAR_RANGE(518750, 0, 0x7f, 6250), +}; + +static const struct linear_range buck_volt_range2[] = { + REGULATOR_LINEAR_RANGE(500000, 0, 0x7f, 6250), +}; + +static const struct linear_range buck_volt_range3[] = { + REGULATOR_LINEAR_RANGE(500000, 0, 0x3f, 50000), +}; + +static const struct linear_range buck_volt_range4[] = { + REGULATOR_LINEAR_RANGE(1200000, 0, 0x7f, 12500), +}; + +/* The array is indexed by id(MT6357_ID_XXX) */ +static struct mt6357_regulator_info mt6357_regulators[] = { + /* Bucks */ + MT6357_BUCK("buck-vcore", VCORE, 518750, 1312500, 6250, + buck_volt_range1, MT6357_BUCK_VCORE_ELR0, 0x7f, 0x7f), + MT6357_BUCK("buck-vproc", VPROC, 518750, 1312500, 6250, + buck_volt_range1, MT6357_BUCK_VPROC_ELR0, 0x7f, 0x7f), + MT6357_BUCK("buck-vmodem", VMODEM, 500000, 1293750, 6250, + buck_volt_range2, MT6357_BUCK_VMODEM_ELR0, 0x7f, 0x7f), + MT6357_BUCK("buck-vpa", VPA, 500000, 3650000, 50000, + buck_volt_range3, MT6357_BUCK_VPA_CON1, 0x3f, 0x3f), + MT6357_BUCK("buck-vs1", VS1, 1200000, 2787500, 12500, + buck_volt_range4, MT6357_BUCK_VS1_ELR0, 0x7f, 0x7f), + + /* LDOs */ + MT6357_LDO("ldo-vcama", VCAMA, vcama_voltages, + MT6357_LDO_VCAMA_CON0, MT6357_VCAMA_ANA_CON0, 0xf00), + MT6357_LDO("ldo-vcamd", VCAMD, vcamd_voltages, + MT6357_LDO_VCAMD_CON0, MT6357_VCAMD_ANA_CON0, 0xf00), + MT6357_LDO("ldo-vcn33-bt", VCN33_BT, vcn33_voltages, + MT6357_LDO_VCN33_CON0_0, MT6357_VCN33_ANA_CON0, 0x300), + MT6357_LDO("ldo-vcn33-wifi", VCN33_WIFI, vcn33_voltages, + MT6357_LDO_VCN33_CON0_1, MT6357_VCN33_ANA_CON0, 0x300), + MT6357_LDO("ldo-vdram", VDRAM, vdram_voltages, + MT6357_LDO_VDRAM_CON0, MT6357_VDRAM_ELR_2, 0x300), + MT6357_LDO("ldo-vefuse", VEFUSE, vefuse_voltages, + MT6357_LDO_VEFUSE_CON0, MT6357_VEFUSE_ANA_CON0, 0xf00), + MT6357_LDO("ldo-vemc", VEMC, vemc_voltages, + MT6357_LDO_VEMC_CON0, MT6357_VEMC_ANA_CON0, 0x700), + MT6357_LDO("ldo-vibr", VIBR, vibr_voltages, + MT6357_LDO_VIBR_CON0, MT6357_VIBR_ANA_CON0, 0xf00), + MT6357_LDO("ldo-vldo28", VLDO28, vldo28_voltages, + MT6357_LDO_VLDO28_CON0_0, MT6357_VLDO28_ANA_CON0, 0x300), + MT6357_LDO("ldo-vmc", VMC, vmc_voltages, + MT6357_LDO_VMC_CON0, MT6357_VMC_ANA_CON0, 0xf00), + MT6357_LDO("ldo-vmch", VMCH, vmch_voltages, + MT6357_LDO_VMCH_CON0, MT6357_VMCH_ANA_CON0, 0x700), + MT6357_LDO("ldo-vsim1", VSIM1, vsim_voltages, + MT6357_LDO_VSIM1_CON0, MT6357_VSIM1_ANA_CON0, 0xf00), + MT6357_LDO("ldo-vsim2", VSIM2, vsim_voltages, + MT6357_LDO_VSIM2_CON0, MT6357_VSIM2_ANA_CON0, 0xf00), + MT6357_LDO("ldo-vusb33", VUSB33, vusb_voltages, + MT6357_LDO_VUSB33_CON0_0, MT6357_VUSB33_ANA_CON0, 0x700), + MT6357_LDO("ldo-vxo22", VXO22, vxo22_voltages, + MT6357_LDO_VXO22_CON0, MT6357_VXO22_ANA_CON0, 0x300), + + MT6357_LDO1("ldo-vsram-proc", VSRAM_PROC, 518750, 1312500, 6250, + buck_volt_range1, MT6357_LDO_VSRAM_PROC_CON0, + MT6357_LDO_VSRAM_CON0, 0x7f00), + MT6357_LDO1("ldo-vsram-others", VSRAM_OTHERS, 518750, 1312500, 6250, + buck_volt_range1, MT6357_LDO_VSRAM_OTHERS_CON0, + MT6357_LDO_VSRAM_CON1, 0x7f00), + + MT6357_REG_FIXED("ldo-vaud28", VAUD28, 2800000), + MT6357_REG_FIXED("ldo-vaux18", VAUX18, 1800000), + MT6357_REG_FIXED("ldo-vcamio18", VCAMIO, 1800000), + MT6357_REG_FIXED("ldo-vcn18", VCN18, 1800000), + MT6357_REG_FIXED("ldo-vcn28", VCN28, 2800000), + MT6357_REG_FIXED("ldo-vfe28", VFE28, 2800000), + MT6357_REG_FIXED("ldo-vio18", VIO18, 1800000), + MT6357_REG_FIXED("ldo-vio28", VIO28, 2800000), + MT6357_REG_FIXED("ldo-vrf12", VRF12, 1200000), + MT6357_REG_FIXED("ldo-vrf18", VRF18, 1800000), +}; + +static int mt6357_regulator_probe(struct platform_device *pdev) +{ + struct mt6397_chip *mt6357 = dev_get_drvdata(pdev->dev.parent); + struct regulator_config config = {}; + struct regulator_dev *rdev; + int i; + + pdev->dev.of_node = pdev->dev.parent->of_node; + + for (i = 0; i < MT6357_MAX_REGULATOR; i++) { + config.dev = &pdev->dev; + config.driver_data = &mt6357_regulators[i]; + config.regmap = mt6357->regmap; + + rdev = devm_regulator_register(&pdev->dev, + &mt6357_regulators[i].desc, + &config); + if (IS_ERR(rdev)) { + dev_err(&pdev->dev, "failed to register %s\n", + mt6357_regulators[i].desc.name); + return PTR_ERR(rdev); + } + } + + return 0; +} + +static const struct platform_device_id mt6357_platform_ids[] = { + { "mt6357-regulator" }, + { /* sentinel */ }, +}; +MODULE_DEVICE_TABLE(platform, mt6357_platform_ids); + +static struct platform_driver mt6357_regulator_driver = { + .driver = { + .name = "mt6357-regulator", + }, + .probe = mt6357_regulator_probe, + .id_table = mt6357_platform_ids, +}; + +module_platform_driver(mt6357_regulator_driver); + +MODULE_AUTHOR("Chen Zhong "); +MODULE_AUTHOR("Fabien Parent "); +MODULE_AUTHOR("Alexandre Mergnat "); +MODULE_DESCRIPTION("Regulator Driver for MediaTek MT6357 PMIC"); +MODULE_LICENSE("GPL"); diff --git a/include/linux/regulator/mt6357-regulator.h b/include/linux/regulator/mt6357-regulator.h new file mode 100644 index 000000000000..238b1ee77ea6 --- /dev/null +++ b/include/linux/regulator/mt6357-regulator.h @@ -0,0 +1,51 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (c) 2022 MediaTek Inc. + */ + +#ifndef __LINUX_REGULATOR_MT6357_H +#define __LINUX_REGULATOR_MT6357_H + +enum { + /* Bucks */ + MT6357_ID_VCORE, + MT6357_ID_VMODEM, + MT6357_ID_VPA, + MT6357_ID_VPROC, + MT6357_ID_VS1, + + /* LDOs */ + MT6357_ID_VAUX18, + MT6357_ID_VAUD28, + MT6357_ID_VCAMA, + MT6357_ID_VCAMD, + MT6357_ID_VCAMIO, + MT6357_ID_VCN18, + MT6357_ID_VCN28, + MT6357_ID_VCN33_BT, + MT6357_ID_VCN33_WIFI, + MT6357_ID_VDRAM, + MT6357_ID_VEFUSE, + MT6357_ID_VEMC, + MT6357_ID_VFE28, + MT6357_ID_VIBR, + MT6357_ID_VIO18, + MT6357_ID_VIO28, + MT6357_ID_VLDO28, + MT6357_ID_VMC, + MT6357_ID_VMCH, + MT6357_ID_VRF12, + MT6357_ID_VRF18, + MT6357_ID_VSIM1, + MT6357_ID_VSIM2, + MT6357_ID_VSRAM_OTHERS, + MT6357_ID_VSRAM_PROC, + MT6357_ID_VUSB33, + MT6357_ID_VXO22, + + MT6357_ID_RG_MAX, +}; + +#define MT6357_MAX_REGULATOR MT6357_ID_RG_MAX + +#endif /* __LINUX_REGULATOR_MT6357_H */ From patchwork Wed Nov 16 12:33:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Mergnat X-Patchwork-Id: 625947 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 34725C43217 for ; Wed, 16 Nov 2022 12:34:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239048AbiKPMer (ORCPT ); Wed, 16 Nov 2022 07:34:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238808AbiKPMd7 (ORCPT ); Wed, 16 Nov 2022 07:33:59 -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 E96C964E3 for ; Wed, 16 Nov 2022 04:33:47 -0800 (PST) Received: by mail-wr1-x42e.google.com with SMTP id g12so29457706wrs.10 for ; Wed, 16 Nov 2022 04:33:47 -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=GI9uwBLCvWR3OgOlMBN6oypd3UQ7AbJ0Dp0NjT4lxFo=; b=sHnFd/lL5A2cdE7y7gKxWrquE3RvjTfCr4XesYiSwsj5MC9VoE5vwMCKnLLM62elD1 zkoE+HytAtoh8YJ2xe8EZpRuVkDhsHgBGY5CLiFBnE2p+ug5GaKgSfnSBHQaHWJSwUrA nusGcFS9EHdF97Ph0NXAeltWw0N9DbQWJLp3F/L2A39KeBvmHpbkxPsY1oyy2folnkqC nQxqlq8v8g8SeJMqiXidepB6RbqCAeah+1Zn975Cs48REyEtmOZjwW4hr0PEfh+itx5q 6GbqXuuWWTxK0cy+Y2G4TFZtogXoPDCrQevYEdHMzh48AXsF0hUakW/etOfA162NwUsj uALQ== 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=GI9uwBLCvWR3OgOlMBN6oypd3UQ7AbJ0Dp0NjT4lxFo=; b=IPOo4g6Uue2jZLwKdA0hWqdTmvTzT8FwniLo04NFQkZRnT9LEMEUbpFSQnwZHG+bS9 bdLVA4NPOUq62I7Mrhl1GopCp4xLBBt4SlWcm3p4aew4YjltCY7UVnjSoBSkI1i5XYKk B4M1F96l3LiFYGK+9/Rj3yamf8Ae/llULAboFT966t8JxEHCsFKvAdOmihYBvCt4MyR+ nTAWwxjPx0KRiEsqCeyBF8QyYnGlpB40RwafAsoKcwh3s3WtEguoPkit05VqJ/AwwXAn 3mRcE9IcsTPW0fmsa0cN5RT/VGF5mlRAHyru/eAFnLtuWnLB6PP81WlEXN3xcjrG+pdN RUYg== X-Gm-Message-State: ANoB5pkV1jnEVns1ip19EGw0DG7jMvd3jTdhAsaMrMHPptyjDQy8M98Q dJRYkGRDE+hAs6vpsPeIX8D7xQ== X-Google-Smtp-Source: AA0mqf43ZwqZX4qqGAkOOFpwMHLviKqBuca3ZNbsWFwMMrmY69hMHTVzUqv7KpJe+cRxk8lUEa65xQ== X-Received: by 2002:adf:ec83:0:b0:236:86f2:b3fa with SMTP id z3-20020adfec83000000b0023686f2b3famr13712940wrn.457.1668602027406; Wed, 16 Nov 2022 04:33:47 -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 z13-20020adff1cd000000b0024166413a4fsm15051607wro.37.2022.11.16.04.33.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 04:33:47 -0800 (PST) From: Alexandre Mergnat Date: Wed, 16 Nov 2022 13:33:04 +0100 Subject: [PATCH v5 10/10] Input: mtk-pmic-keys: add MT6357 support MIME-Version: 1.0 Message-Id: <20221005-mt6357-support-v5-10-8210d955dd3d@baylibre.com> References: <20221005-mt6357-support-v5-0-8210d955dd3d@baylibre.com> In-Reply-To: <20221005-mt6357-support-v5-0-8210d955dd3d@baylibre.com> To: Flora Fu , Matthias Brugger , Dmitry Torokhov , Tianping Fang , Fabien Parent , Krzysztof Kozlowski , Liam Girdwood , Alexandre Belloni , Mark Brown , Sean Wang , Chen Zhong , Pavel Machek , Lee Jones , Alessandro Zummo , Rob Herring Cc: Krzysztof Kozlowski , Rob Herring , Mattijs Korpershoek , linux-mediatek@lists.infradead.org, Alexandre Mergnat , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-leds@vger.kernel.org, Fabien Parent , AngeloGioacchino Del Regno , linux-rtc@vger.kernel.org, linux-input@vger.kernel.org X-Mailer: b4 0.10.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2028; i=amergnat@baylibre.com; h=from:subject:message-id; bh=K2/LktiwnSqpYUY/NYDB7cyyBwW4Kzl5Gx1VcVhpHIg=; b=owEBbQKS/ZANAwAKAStGSZ1+MdRFAcsmYgBjdNieZ404YpNtkYSivYSn+3ZAsowD7kjt8AT8H7pn 1beN5/KJAjMEAAEKAB0WIQQjG17X8+qqcA5g/osrRkmdfjHURQUCY3TYngAKCRArRkmdfjHURQ/jEA CjBs9hecD71EXvrtGB0GD+Pt3BUK+ISJbtY85IJFzSjCQQeJQ7I3fcY1PGIP3Zl3t6PZJHJAM007AR t++htXH/6Q9LEi4UVPwNwVS6x4lE78IPBY8V8g3HBFkx0jPKyh7z937yYSuFvy//jyAJqt4+rN8mGR VZJSS7DXwvhG/Nsk2CFUg878ENFvdAgex9eoz+L0SIPoshxX/l++CvPi6TR4jFYlEeMdK14zFXNWSM fhRuiz16EqdTJB+yDHMK6GrkpF9ljnr1dqxLIQnD/OHO5/U2XeCtLZ5iiuMmS0ZNwyu+sRffNyemUi cNBiSl16AQgUJ3XFq+7coWbMzvvfWjIUa7eqUkVmOCDyYlohpQajGq+H6y50a3ty+CrYc5L9LcGEMv qterhaqxmNGaTE31evhakhFX+zZYMh3UAUsj1vV2913t/dHV/QH+wY0C7RowJloevAwZ80Mbt22UWT qnCLCzKa0KaDA6Wu01NkgyQlZhQSRshKy94rb1SDCxCQ1Tum8gto6nFxqaOoU5sVpMRiRWOY9fIl0C BiaNwxN0VmQZKpPrKtSvNSM1YjRo3tkjM5k4CN2V82s+DmAlDZ2GTto8hqmfoWINgGK1FCKzgEvctF VvxlByeamx6OXAnReeR5WsKIcykLMA9EEO3ruMlZtVxS3LNlQBR0zKPuao2Q== X-Developer-Key: i=amergnat@baylibre.com; a=openpgp; fpr=231B5ED7F3EAAA700E60FE8B2B46499D7E31D445 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org From: Fabien Parent Add PMIC Keys support on MT6357 SoC. Signed-off-by: Fabien Parent Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Mattijs Korpershoek Acked-by: Dmitry Torokhov Signed-off-by: Alexandre Mergnat --- drivers/input/keyboard/mtk-pmic-keys.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/input/keyboard/mtk-pmic-keys.c b/drivers/input/keyboard/mtk-pmic-keys.c index 9b34da0ec260..2a63e0718eb6 100644 --- a/drivers/input/keyboard/mtk-pmic-keys.c +++ b/drivers/input/keyboard/mtk-pmic-keys.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -90,6 +91,19 @@ static const struct mtk_pmic_regs mt6331_regs = { .rst_lprst_mask = MTK_PMIC_MT6331_RST_DU_MASK, }; +static const struct mtk_pmic_regs mt6357_regs = { + .keys_regs[MTK_PMIC_PWRKEY_INDEX] = + MTK_PMIC_KEYS_REGS(MT6357_TOPSTATUS, + 0x2, MT6357_PSC_TOP_INT_CON0, 0x5, + MTK_PMIC_PWRKEY_RST), + .keys_regs[MTK_PMIC_HOMEKEY_INDEX] = + MTK_PMIC_KEYS_REGS(MT6357_TOPSTATUS, + 0x8, MT6357_PSC_TOP_INT_CON0, 0xa, + MTK_PMIC_HOMEKEY_INDEX), + .pmic_rst_reg = MT6357_TOP_RST_MISC, + .rst_lprst_mask = MTK_PMIC_RST_DU_MASK, +}; + static const struct mtk_pmic_regs mt6358_regs = { .keys_regs[MTK_PMIC_PWRKEY_INDEX] = MTK_PMIC_KEYS_REGS(MT6358_TOPSTATUS, @@ -276,6 +290,9 @@ static const struct of_device_id of_mtk_pmic_keys_match_tbl[] = { }, { .compatible = "mediatek,mt6331-keys", .data = &mt6331_regs, + }, { + .compatible = "mediatek,mt6357-keys", + .data = &mt6357_regs, }, { .compatible = "mediatek,mt6358-keys", .data = &mt6358_regs,