From patchwork Fri Nov 25 15:10:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Mergnat X-Patchwork-Id: 13056125 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F0A17C4332F for ; Fri, 25 Nov 2022 16:17:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Message-Id:Date:From:MIME-Version :Subject:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=0kB8k9/IqrKDz/NbhlvZkq1gphYbFElTgy44ngLtefg=; b=YvUJrL+I69IaSz 9UduMDhqs1x+NGMaahKC5XRAHl2lkqkeLBdbz542QqcKZkAmE9MJU3nkZdJi/iCazhOnbk3SG4O0M /NAAz85jMS6eaRSkUyfYlo9VbC+wnJMzi5BCzUVlq8gyDYqbZiPCYQff+8qsqkO2TiYPJzDIf18LO m/vYDmcQrXIUVl9XxTYizjwkOlLu7E0kFNM8mEt28Gr+USMa5e7qzgQeQBxv2F+txF+Dvz5P9iQ5W ZugKGYn5vx9hFMfUMQSZ0aagBSgA8+HbBn6XHyny1gdaOBruTrFBsBC/1bsSFuqBxDCE7gw2hQHcN lSirzAONX6SfBRjKDuOg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oybNg-000DqS-Od; Fri, 25 Nov 2022 16:16:48 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oyaMO-00HNMb-0A for linux-arm-kernel@lists.infradead.org; Fri, 25 Nov 2022 15:11:27 +0000 Received: by mail-wm1-x334.google.com with SMTP id 83-20020a1c0256000000b003d03017c6efso5729644wmc.4 for ; Fri, 25 Nov 2022 07:11:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=cc:to:message-id:date:from:content-transfer-encoding:mime-version :subject:from:to:cc:subject:date:message-id:reply-to; bh=XJxTDeXeIWQYLD7JipzsnC61wDCNzbvkJYjH3GkbQc4=; b=f70FiwS+6LTA1RanYy/8t0VxONnDQjyBwpY+GUS7suJdPMiRPy+tIiuH6gcAubmKjK wVAn5Uv/I9Ae+oPCKzv4wXUFHoCVwfp5oxXLAyQgcBlpO8qRz9DdlsRXW3VYw3Hx6Yi9 yMmxKc/PiivGCg6nso8aseq44GazboeAkgdz5jupauOrzdPoURcLAxV17pekN7Z8mG9o 6lfmsaKrcvwqq73WMi0X4RtyLleaic9DDMK02erYz1Rffml/DmxwJUuwvJdtqk69S1iI nq7/oeO7F+/WQYZF1uInLl1VBzom0q7bT2WZxUhb+Q+NE+jFTvGiP0JmAUJpbCjmx5Kf OuCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:message-id:date:from:content-transfer-encoding:mime-version :subject:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=XJxTDeXeIWQYLD7JipzsnC61wDCNzbvkJYjH3GkbQc4=; b=G9sen7aAaGhKKwmRFeLIctjeYjkGQYx5kHjfwJtg1kR7JeXdFsnKwZstKkBeFxDQ9L RqTT3jni5dVgLcVdi2VsS4g/lPsBAYqY+egSBUKqlUGOtxciN0lmGqKHxDd1CjEjNMI0 8DeKaktZS9pEqBUxic96sB+ZuuMLHM8Upb9jQBiTjJg8BV9SXmKvLY6vac8gBf2f5nD+ jFO8RYyNyLjLdvnfDKzDdu35tiw6uXii+37XlS1XrRj4M13aWwIqQ8SQTAxdBMAwZGkC Lp4sgPhcsilKkdeeNvVGbT+r56w/JzEU4HXgw3eeB62WWXsklWmAjrMqKyi3wXDy3/d2 pReA== X-Gm-Message-State: ANoB5pmfR1nsOXm5ud2E9tgkHNWqTZjBlmuK7weJ0uEUhaXraFjQhR0E zCwLd9uM4rwYyRdWuDL6mz+e8w== X-Google-Smtp-Source: AA0mqf7+7d/sQ3IiRQAa80tIBPWkqZ/V9yHRIDk37st4q9LcHQhMW6ZVgj75Mvyx5S/MhNjNVwccOQ== X-Received: by 2002:a1c:6a02:0:b0:3cf:71e4:75b with SMTP id f2-20020a1c6a02000000b003cf71e4075bmr16311984wmc.114.1669389080513; Fri, 25 Nov 2022 07:11:20 -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 w10-20020a05600c474a00b003b435c41103sm11565885wmo.0.2022.11.25.07.11.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Nov 2022 07:11:19 -0800 (PST) Subject: [PATCH v6 00/10] Add MediaTek MT6357 PMIC support MIME-Version: 1.0 X-b4-tracking: H4sIANPagGMC/33NQY7CMAwF0KugrCcodXATWHEPNIu4NtNIpUVJqYRQ7z7WLEfQlfVt/eeXqVKyVH PavUyRJdc8jRrar53p+jT+iM2s2YADaJxDe5tbj8HWx/0+ldkiehcpgnh/NVqiVMVSSWPXa218DIMu +1znqTz/niyg4/LRW8A6e20CJWBgl45nSs8hU5F9N93Mt2qL3xa8CkEcceh8gwRvhMO2cFABGYgwSu tieCPgtoAqRD3xEZHZ8z9hXddf4yU9+3oBAAA= From: Alexandre Mergnat Date: Fri, 25 Nov 2022 16:10:11 +0100 Message-Id: <20221005-mt6357-support-v6-0-4f589756befa@baylibre.com> To: Krzysztof Kozlowski , Sean Wang , Rob Herring , Matthias Brugger , Chen Zhong , Fabien Parent , Alessandro Zummo , Mark Brown , Alexandre Belloni , Flora Fu , Tianping Fang , Pavel Machek , Lee Jones , Liam Girdwood , Dmitry Torokhov Cc: Mattijs Korpershoek , Alexandre Mergnat , Rob Herring , AngeloGioacchino Del Regno , linux-rtc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Krzysztof Kozlowski , linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Fabien Parent , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-leds@vger.kernel.org X-Mailer: b4 0.10.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=6755; i=amergnat@baylibre.com; h=from:subject:message-id; bh=FgsXPgRXvQqbCe+YwUjx2VoAtXg81wnZiWFINiOzpLo=; b=owEBbQKS/ZANAwAKAStGSZ1+MdRFAcsmYgBjgNsWBkcBpKvN/k3q2Z5kAYRf6DZ8FyMGz504eSgP ZbiGMF6JAjMEAAEKAB0WIQQjG17X8+qqcA5g/osrRkmdfjHURQUCY4DbFgAKCRArRkmdfjHURcKNEA C/Bkuh8P4rVzqqS7DJjIa2PgrRXckXRF5DQnKYYkQyVhtKQOXgXT0JCQ4C4kGiiriO9IYn9Turk0Ik klJq+Sp2vaHbcEOocoTn7QeatBx4d9/HokgQJB5/VNvC6yKdW6/UrjKcO7YQP7KEYh/xenSR2fvgQ1 Hx5yhtChx8HYFe7p7daQ/mEu9X1h20bxv7FMrf8XUT/8UrbJkCE3KrqdZnFW2nE0lrGqSSl+x+o8tV APYSRuLVOtBhKVoxH8a69G8YinOOZlyQEDgn0aBCZbC8q0sfVdEqR/38FwDMEfmrGhwICibGVDXMKC D6W5JBXRGU+4usgZOIu1nBCNMh5x+GIVl2yn4OBaR0tgpviLnUuQz6UEaOVh2Ry6Q8xcnU/FxGeXZG cCTuHIuEOlBrZsiDdEeLkAHm9EBzQxvgITNM7cHJYzDWHZZCAXR8JEyMVv7QcvgJ056CbXh8yVDzYl 3QRZB5+92OZM4JWz/7TnnapfUO8FLQ1OhvwF7l2UnxgjsUbvCHFaNJ0JURh+sMX1y9iXt7MrhI9m0O Kl54hqMlLNm2RU0+O0SHDeX7ggNAxXLfH1xqZPpSqXo0OGDpqymABsgdwBxZTpxCETXlFwwrzvqe7u j8uLc1ahikc1eeXujWbhXdy2i+9G0k6M1xv/B6Z8v6/I7oyGHsSSBFK4ohjw== X-Developer-Key: i=amergnat@baylibre.com; a=openpgp; fpr=231B5ED7F3EAAA700E60FE8B2B46499D7E31D445 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221125_071124_277199_AC7C8575 X-CRM114-Status: GOOD ( 24.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, This patch series adds MFD, PMIC keys, and regulator support for MT6357. MT6357 is a MediaTek PMIC very similar to MT6358. Currently, MTK bindings related to the PMICs are not converted yet (still .txt): soc/mediatek/pwrap.txt (all PMIC parent) | V mfd/mt6397.txt (support lot of mt63XX PMIC) +---------------+----------------+---... V V V regulator/... rtc/... codec/... 1) Convert pwrap to yaml is ok. 2) For the PMIC bindings, there are two option: - Convert mt6397.txt to mediatek,mt6397.yaml and continue to support multiple PMIC with only one file. IMO, the file will be hard to read because the supported features aren't the same for each PMIC. - Make a binding file for each PMIC ref: - mfd/mediatek,mt6357.yaml - mfd/mediatek,mt6358.yaml - ... 3) All PMIC daughter bindings (regulator, rtc, codec, led, ...) aren't fully converted yet. Refering to the two PMIC convertion options above: - To be clean, all daughter bindings should be converted. This is hard because a good understanding of each device is requiered to write efficient bindings. - Only daughter bindings supported by the added PMIC should be converted, that allows to do the task conversion step by step. In the V4 of this serie, I chose the second option. Regards, Alex Changes in v6: - Fix typo in documentations. - Remove mediatek,mt6397-rtc.yaml example. - Align pwrap convertion with the original .txt file. - Remove unecessary include in the mt6357-regulator driver. - Link to v5: https://lore.kernel.org/r/20221005-mt6357-support-v5-0-8210d955dd3d@baylibre.com Changes in v5: - Add missing maintainers - Improve RTC binding by adding rtc.yaml ref and start-year property - Split the txt->yaml conversion in one commit and the addition of the new mt6357-rtc compatible in another commit. - Improve PWRAP binding: - clocks and clock-name have been refactored. - reset-names is now properly dependent to resets. - additionalProperties change from true to false. - change example for a most recent and popular SoC. - "allOf" part has been simplified. - Pass binding tests with the updated tools. Here the command: "make DT_CHECKER_FLAGS=-m dt_binding_check" - Link to v4: https://lore.kernel.org/r/20221005-mt6357-support-v4-0-5d2bb58e6087@baylibre.com Changes in v4: - "dt-bindings: mfd: mt6397: add binding for MT6357" has been applied by Lee Jones - All fixed regulator are now refering to fixed-regulator.yaml - vfe28 and vcamio18 regulators have been added - pwrap binding has been converted and mt8365 support has been added - mt6357 PMIC binding has been created - mt6397 RTC binding has been converted and mt6357 support has been added - Link to v3: https://lore.kernel.org/r/20221005-mt6357-support-v3-0-7e0bd7c315b2@baylibre.com Changes in v3: - To be consistent with regulator/driver.h and helper.c, shift variables have been removed and the mask values have been directly shifted. - Remove index tables and rework volt tables to use set/get helper functions. - Add comment to structure and function. - Fix Fabien Parent mail address. - Link to v2: https://lore.kernel.org/r/20221005-mt6357-support-v2-0-f17ba2d2d0a9@baylibre.com Changes in v2: - Rebase - Fix typo - Remove dependencies with https://lore.kernel.org/all/20220415153629.1817202-1-fparent@baylibre.com/ which is no longer relevant. Previous versions: v1 - https://lore.kernel.org/all/20220531124959.202787-1-fparent@baylibre.com/ To: Lee Jones To: Rob Herring To: Krzysztof Kozlowski To: Matthias Brugger To: Dmitry Torokhov To: Chen Zhong To: Liam Girdwood To: Mark Brown To: Fabien Parent To: Alessandro Zummo To: Alexandre Belloni To: Sean Wang To: Pavel Machek To: Tianping Fang To: Flora Fu Cc: devicetree@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mediatek@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: linux-input@vger.kernel.org Cc: Fabien Parent Cc: Rob Herring Cc: linux-rtc@vger.kernel.org Cc: linux-leds@vger.kernel.org Cc: AngeloGioacchino Del Regno Cc: Mattijs Korpershoek Cc: Krzysztof Kozlowski Signed-off-by: Alexandre Mergnat --- Alexandre Mergnat (6): dt-bindings: rtc: mediatek: convert MT6397 rtc documentation dt-bindings: rtc: mediatek: add MT6357 support dt-bindings: soc: mediatek: convert pwrap documentation dt-bindings: mfd: mediatek: Add bindings for MT6357 PMIC arm64: dts: mt6358: change node names arm64: dts: mt8173: change node name Fabien Parent (4): dt-bindings: input: mtk-pmic-keys: add binding for MT6357 PMIC regulator: dt-bindings: Add binding schema for mt6357 regulators regulator: add mt6357 regulator Input: mtk-pmic-keys: add MT6357 support .../bindings/input/mediatek,pmic-keys.yaml | 1 + .../devicetree/bindings/leds/leds-mt6323.txt | 2 +- .../devicetree/bindings/mfd/mediatek,mt6357.yaml | 105 +++++ Documentation/devicetree/bindings/mfd/mt6397.txt | 4 +- .../regulator/mediatek,mt6357-regulator.yaml | 294 +++++++++++++ .../bindings/rtc/mediatek,mt6397-rtc.yaml | 36 ++ .../devicetree/bindings/rtc/rtc-mt6397.txt | 31 -- .../bindings/soc/mediatek/mediatek,pwrap.yaml | 147 +++++++ .../devicetree/bindings/soc/mediatek/pwrap.txt | 75 ---- arch/arm64/boot/dts/mediatek/mt6358.dtsi | 6 +- arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi | 2 +- arch/arm64/boot/dts/mediatek/mt8173-evb.dts | 2 +- drivers/input/keyboard/mtk-pmic-keys.c | 17 + drivers/regulator/Kconfig | 9 + drivers/regulator/Makefile | 1 + drivers/regulator/mt6357-regulator.c | 453 +++++++++++++++++++++ include/linux/regulator/mt6357-regulator.h | 51 +++ 17 files changed, 1122 insertions(+), 114 deletions(-) --- base-commit: f6e37bb630736d880a319b7845e8837c8536dd59 change-id: 20221005-mt6357-support-55308b82e33f Best regards,