From patchwork Sat Jan 21 23:13:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 1730093 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=sholland.org header.i=@sholland.org header.a=rsa-sha256 header.s=fm1 header.b=X6kcuJMY; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=mHMejy0z; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NzscT4WNPz23gM for ; Sun, 22 Jan 2023 10:13:45 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D7A2285592; Sun, 22 Jan 2023 00:13:23 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=sholland.org header.i=@sholland.org header.b="X6kcuJMY"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="mHMejy0z"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 493EB8028A; Sun, 22 Jan 2023 00:13:17 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 83F908028A for ; Sun, 22 Jan 2023 00:13:12 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=samuel@sholland.org Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 1D8F83200583; Sat, 21 Jan 2023 18:13:07 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sat, 21 Jan 2023 18:13:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm1; t=1674342786; x=1674429186; bh=GGHSsdtfPkmtQjHKG6/ruGIUB m/Yoz7z2elBdUn9RDU=; b=X6kcuJMYfO0yuOYrPGpW0zBjy2PEah9Q2P7XYalOE kNJkwBFZ3CEyGgvw2XV5/P11SYnK6YRcnTL9YVeIOewCCdwBFyP/M5ZhaZmn926p 5TSD4HUStP0DH0mk0W7BPg3jS+u8FmLBvaUDVjxkU0tDYvn3CG7D5esI7FeCia6n R6OGedpAkzhDvwjUoCkZKkr8HXaQrc20Ji45CtMzzK6v9JmSoLgYqev/VMdzLzMo IgfiPldlhyn5cNY18VADGs8NMty2dtXMhCzdOY/Zo/CjS6xzo67VfGIlkLp+yOif MC0mb2efricd/tLke8cpQFVc4/UbKcyLMt1EelNxJmULg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1674342786; x=1674429186; bh=GGHSsdtfPkmtQjHKG6/ruGIUBm/Yoz7z2el BdUn9RDU=; b=mHMejy0zA7hYGVgfMyCwjhxDHIQH7aOLqoaCvFmuDAhEXp2nOCJ luga/U1DO1vowjxr74QAQoPV/f5Cx6yu3Cd88Ux2ebZqOx0TxLuE79KjuW1K/nKU tN+REmANd66JUpuyg8nivB7lrKjHxyfe60N8KFMWG1qtLn01bg/O+CB7tO+tDfGd 7UGeM97G66lGxpWZLu5MuUxUkNwpxAsnWlnURkvQpTmw+w0frugL2FQQcKzRBG5Y GmOG4Jk2MkhZXVSvdZdoRl1a4JeL/34xB5AATb+s+MHudyqXtM1ROwrN2wJ568AK fWFqSMolilfxDY74xKln5WEBKzZ3+edwp7g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudduhedgtdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgggfestdekredtredttdenucfhrhhomhepufgrmhhuvghl ucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecuggftrf grthhtvghrnhepkeevlefhjeeuleeltedvjedvfeefteegleehueejffehgffffeekhefh hfekkeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epshgrmhhuvghlsehshhholhhlrghnugdrohhrgh X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 21 Jan 2023 18:13:05 -0500 (EST) From: Samuel Holland To: Jaehoon Chung , Andre Przywara Cc: u-boot@lists.denx.de, Samuel Holland Subject: [PATCH v2 0/3] power: X-Powers PMIC regulator support Date: Sat, 21 Jan 2023 17:13:03 -0600 Message-Id: <20230121231307.42628-1-samuel@sholland.org> X-Mailer: git-send-email 2.37.4 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean This series adds a driver for the regulators in X-Powers AXPxxx PMICs. It supports everything except regulators shared with GPIO pins. Those have a different register interface, so they may need a separate driver. Regulator setup in U-Boot proper is needed for Ethernet and HDMI/LCD display output. For some SoCs (H616), this driver could possibly be used for the DRAM regulator setup done in SPL. Older SoCs do all of their regulator setup in SPL. Some of that is probably necessary, but I think a lot of it is not and can be deferred to U-Boot proper or Linux; that's just where it was convenient to initialize the PMIC at the time. The main goal here is to replace the corresponding code in TF-A, both because of TF-A size constraints, and because the TF-A code is too simple/overzealous and breaks EPHY power sequencing on some boards. Changes in v2: - Dual-license the driver - Add a comment about the requirements for the voltage table - Fix AXP22x ALDO3 enable bit position Samuel Holland (3): power: pmic: axp: Provide a variant ID in the driver data power: regulator: Add a driver for AXP PMIC regulators power: pmic: axp: Bind regulators from the DT drivers/power/pmic/axp.c | 36 ++- drivers/power/regulator/Kconfig | 14 ++ drivers/power/regulator/Makefile | 1 + drivers/power/regulator/axp_regulator.c | 312 ++++++++++++++++++++++++ include/axp_pmic.h | 12 + 5 files changed, 366 insertions(+), 9 deletions(-) create mode 100644 drivers/power/regulator/axp_regulator.c Reviewed-by: Andre Przywara