From patchwork Mon May 23 15:47:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 12859200 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 9FBD5C433FE for ; Mon, 23 May 2022 15:47:34 +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=dX+5BwYlNFvNcUQ58FnMWbVWQvT23o6E65lRcs0SN0s=; b=KnVR6dclZrCqlg ivKlBgNcTRDnhH3TpwhNftjK10AvHqEryUHDnQmd1/A0LYTMXC2SGYKHwG/iHX97f77Pa59wS4HmK 4Snt20d5OxQUmK8ZfbqeKxluXi0JKEIu4hg2GP+c/+8Gy80MVYhqk6zm8sLoP275xWYu7jrZ8I2hc 01CcurX2F/pdcBZSXD2WMQCh58ZwwY/aFp8nk+JDkJzfiOb8ZTDF2xZjjPBnIPO8Ej9gvpWqEfsyH upcJ1II9VTwUKzujbqzmw9IRmxUivYfj6T7tjqlPsZAfSC45B2zH2CM178871xJSfz8R9BDtXO9SU zwF/lx4P46i2pFoZ6dvg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ntAHG-0050Rk-M9; Mon, 23 May 2022 15:47:26 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ntAH4-0050OM-Tp; Mon, 23 May 2022 15:47:16 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: kholk11) with ESMTPSA id C14471F409B1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1653320833; bh=Z/KHZc12qDX/inLmL7IrQMICsxClm1H1wZiKgBW9jfM=; h=From:To:Cc:Subject:Date:From; b=kM0euB7OFpPc7UJmj3IbweR+fPqdmbQihUZfPH9mOsVEsAKkQc/wri9NjNBp7RWva vvx0Aw/QUlAHXg8jsJueEGVx6bDWFNau3WnRHV9TgJDndfxtE6AFeEQMifDH96anJb K19HC1XZGVKLj6lJhd5n38CIQoPEURxAowQOMtnO+DjVDmo30ftlAv/0OGLDOAMBUw MpzG6hwM92RDpirHG3hkshg1OW6NZKrQnbHFp1mUm9K+89Oeygc2SfDAwY3E18X6JB 1eAdo0uY5PC1FZ/6ZkVAdMPGv8ph7QQAtvNtEh9/geiRTrzw5SVziV3pe3kE8AhHOK v1w3mU1Km1bUw== From: AngeloGioacchino Del Regno To: lgirdwood@gmail.com Cc: broonie@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH v3 0/4] MediaTek Helio X10 MT6795 - MT6331/6332 Regulators Date: Mon, 23 May 2022 17:47:05 +0200 Message-Id: <20220523154709.118663-1-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220523_084715_137295_969E87CB X-CRM114-Status: GOOD ( 13.64 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org 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 adds support for the regulators found in MT6331 and MT6332 main/companion PMICs. Adding support to each driver in each subsystem is done in different patch series as to avoid spamming uninteresting patches to maintainers. This series depends on another two series series [1], [2] named "MediaTek Helio X10 MT6795 - MT6331/6332 PMIC Wrapper" and "MediaTek Helio X10 MT6795 - MT6331/6332 PMIC MFD integration" Tested on a MT6795 Sony Xperia M5 (codename "Holly") smartphone. [1]: https://lore.kernel.org/lkml/20220520124039.228314-1-angelogioacchino.delregno@collabora.com/T/#t [2]: https://lore.kernel.org/lkml/20220520124617.228808-1-angelogioacchino.delregno@collabora.com/T/#t Changes in v3: - Sorry, one of the commits picked both the pre-rename file and the new one... the v3 fixes the mt6332 bindings commit. - Changed comment style on top for mt633[12]-regulator.c as suggested (missed that in v2) Changes in v2: - Refactored description in dt-bindings - Simplified get_status() function and removed callback where not needed - Simplified set_mode()/get_mode() functions and removed callback where not needed - Added new regulator_ops for no_qi (no .get_status) and for no_ms (no .{get, set}_mode) - Fixed vsel mask on some regulators and removed pattern of repeated voltage entries present in some voltage tables, avoiding to set higher bits for safety - Reordered regulators (and some formatting fixes) in mt6331-regulator.c in per-type alphabetic order AngeloGioacchino Del Regno (4): dt-bindings: regulator: Add bindings for MT6331 regulator regulator: Add driver for MT6331 PMIC regulators dt-bindings: regulator: Add bindings for MT6332 regulator regulator: Add driver for MT6332 PMIC regulators .../regulator/mediatek,mt6331-regulator.yaml | 273 ++++++++++ .../regulator/mediatek,mt6332-regulator.yaml | 112 ++++ drivers/regulator/Kconfig | 18 + drivers/regulator/Makefile | 2 + drivers/regulator/mt6331-regulator.c | 507 ++++++++++++++++++ drivers/regulator/mt6332-regulator.c | 422 +++++++++++++++ include/linux/regulator/mt6331-regulator.h | 46 ++ include/linux/regulator/mt6332-regulator.h | 27 + 8 files changed, 1407 insertions(+) create mode 100644 Documentation/devicetree/bindings/regulator/mediatek,mt6331-regulator.yaml create mode 100644 Documentation/devicetree/bindings/regulator/mediatek,mt6332-regulator.yaml create mode 100644 drivers/regulator/mt6331-regulator.c create mode 100644 drivers/regulator/mt6332-regulator.c create mode 100644 include/linux/regulator/mt6331-regulator.h create mode 100644 include/linux/regulator/mt6332-regulator.h