From patchwork Wed Apr 12 13:12:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 13209163 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 14093C77B77 for ; Wed, 12 Apr 2023 13:13:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Rh5EPyyaUbAaHtpSFnblTjoLJYMplsgXWiS+cwjqW0c=; b=V+B/zNjfOWczd7 0AAHJd7yx5S0CcNOd/M1aH+/jYl5x0Y87rZvHEMYRVRvYjBrHf+i9HM4xogqPqIiCx1xji81Rh7s+ KAPPIywagiS/aoRkGRFbyp2Q6dURrKJx8jsX7TvLXnhZyfjCknTz/uwmALzMQPNBqlN9xoYoP+R1S qUjcFjFXFntG5teH0kkWveZR1o7CjsEQ4Gd1MSEcLCUC5IDo5MEUcH6lqsf+PFmHiywzwXk3Lg9do pd+rFnHKA7mNvXhC/r6GsAnhZmrvcyFudg7hkuUD8KHJIU0wNtREBnVRUkBzXrRN8fFiB6Wake8pP EU4P0G5ZIb4T6e0b2nmw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pmaGx-003H8Z-0i; Wed, 12 Apr 2023 13:12:27 +0000 Received: from madras.collabora.co.uk ([46.235.227.172]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pmaGs-003H5Y-32; Wed, 12 Apr 2023 13:12:24 +0000 Received: from IcarusMOD.eternityproject.eu (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 9FC606603102; Wed, 12 Apr 2023 14:12:20 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1681305141; bh=+riuISXy3VPiJ6mOioE8PhdIQu+xEKxpkJXqCAILO9c=; h=From:To:Cc:Subject:Date:From; b=or42XwpmzhGHuSBWzVRtaENPX1BZSaOk/mksrYYXK1Wk1cmkimGKT/p6KShTcSqbj 16h4pVLezeTQviuGIXackRKbpaHt0HaUiWp6sAxPaX5Nrj3IHiqlzjW5G/JZStl3gQ vqqvYF3b6HWmNRIFQCdtd9Ybncd4k9b2/cW4ZhGzUjw9JtAHoQTUR6nLp9KSP4zlCW 1ss/FGv7Coz/qbCbRSGu5wPGvhVhvhMJmKslKo5hOXPll/s9P/Ez43HqQtja/RnOjV 9Wd0ZqmdkNbsA6z+Wtek8GuG8F7Qj+fxNgZOT86K7505zv9scOaW77XWP/vFQ5VnVU dRsYHPbbHmN8A== From: AngeloGioacchino Del Regno To: matthias.bgg@gmail.com Cc: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, amergnat@baylibre.com, flora.fu@mediatek.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, kernel@collabora.com, phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, AngeloGioacchino Del Regno Subject: [PATCH v3 0/6] MediaTek Helio X10 MT6795 - MT6331/6332 PMIC Wrapper Date: Wed, 12 Apr 2023 15:12:10 +0200 Message-Id: <20230412131216.198313-1-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230412_061223_106728_1A219004 X-CRM114-Status: UNSURE ( 9.89 ) X-CRM114-Notice: Please train this message. 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 Changes in v3: - Rebased on next-20230412 - Changed if branch to switch in pwrap_init() as suggested by Matthias and Alexandre. Changes in v2: - Rebased on next-20230323 - Changed pwrap.txt addition to new yaml file addition In an effort to give some love to the apparently forgotten MT6795 SoC, I am upstreaming more components that are necessary to support platforms powered by this one apart from a simple boot to serial console. This series introduces support in the PMIC Wrapper for a different PMIC topology, which is commonly found on smartphone boards, using one main PMIC and one Companion/Sub PMIC, both accessible *only* through the pwrap; be aware that this kind of topology is not *specific to* the Helio X10 SoC, but common across many kinds of MediaTek smartphone oriented SoCs and board designs. That said, support for the PMIC combo MT6331+MT6332 is provided in this series in a form that will be able to initialize the PMICs with crypto and DualIO but nothing else: these PMICs are very featureful, so I have decided to add this support in more than just one step, as there will be multiple patches for multiple different subsystems (..it's a mfd!..). Tested on a MT6795 Sony Xperia M5 (codename "Holly") smartphone. AngeloGioacchino Del Regno (6): dt-bindings: soc: mediatek: pwrap: Add compatible for MT6795 Helio X10 soc: mediatek: pwrap: Move PMIC read test sequence in function soc: mediatek: pwrap: Add kerneldoc for struct pwrap_slv_type soc: mediatek: mtk-pmic-wrap: Add support for companion PMICs soc: mediatek: mtk-pmic-wrap: Add support for MT6331 w/ MT6332 companion soc: mediatek: pwrap: Add support for MT6795 Helio X10 .../bindings/soc/mediatek/mediatek,pwrap.yaml | 1 + drivers/soc/mediatek/mtk-pmic-wrap.c | 292 ++++++++++++++++-- 2 files changed, 267 insertions(+), 26 deletions(-)