From patchwork Tue Sep 13 12:34:52 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: 605471 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 2D909C54EE9 for ; Tue, 13 Sep 2022 12:35:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229876AbiIMMfI (ORCPT ); Tue, 13 Sep 2022 08:35:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230201AbiIMMfG (ORCPT ); Tue, 13 Sep 2022 08:35:06 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A524BE02A; Tue, 13 Sep 2022 05:35:05 -0700 (PDT) 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 D95976602004; Tue, 13 Sep 2022 13:35:03 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1663072504; bh=arXXRyviojxzK2161tTWG0B0Y0ZjNohDB8F9CsAPFw8=; h=From:To:Cc:Subject:Date:From; b=GLGf8B0ZPwyHun1rN6tWm0s2flKhGxaJxBaqib8Ah7laLwLmcJltRoaFSKEZjBJoe F0C8mwAYl195QrlIaqiH2qJ3e29uydkJVJhDMs6/z760sdhxYaWfAwWcqAAvtAWUAe nddnr5nyYpuYxUMAh+BX2JoYgS27rnHdeyBXK7PDE2YXmLHQNxrwK1uvcj83qa5uLZ aiStZvHX+LT6sCe1S1crxUNMI4eS0C0rcg88ubc5yQcnNeBYkcICJUT0vzyJgNJWe6 jPglZAqD1V1wCBoJCnfK9mLLYt1widMeKb15NDv9xvg5Xm0WGCHBpc1+rSmrTqXMUe nbKKvBQjc+pGQ== From: AngeloGioacchino Del Regno To: broonie@kernel.org Cc: lgirdwood@gmail.com, 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 v4 0/4] MediaTek Helio X10 MT6795 - MT6331/6332 Regulators Date: Tue, 13 Sep 2022 14:34:52 +0200 Message-Id: <20220913123456.384513-1-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.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. Tested on a MT6795 Sony Xperia M5 (codename "Holly") smartphone. Changes in v4: - Rebased on next-20220912 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