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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4C90EC38142 for ; Sat, 21 Jan 2023 23:13:55 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1A9B685698; Sun, 22 Jan 2023 00:13:36 +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="J9U0SrD0"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="TF71EHgY"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AD66A8566F; Sun, 22 Jan 2023 00:13:19 +0100 (CET) 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 047C985657 for ; Sun, 22 Jan 2023 00:13:16 +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 compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 4945D32006F2; Sat, 21 Jan 2023 18:13:14 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sat, 21 Jan 2023 18:13:14 -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 :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1674342793; x=1674429193; bh=As /QzBgKzg86pZtcoUfWnwvuKQnkVQqn4iFPaqIm7LM=; b=J9U0SrD072Qz7i0H/8 7ANxvAEe1M3ozgVxIOMBemxz+kEnRleehzbiQC0lgCIu454DmuX8sW21Q7jes/Z+ Zod0Pbb0BvQ6+O2BdzSsdj63EfsNK8XRVW1WmSylTENvY665CEu/0TLF4IRNhPcN 0petggcj8Jf9CZTu+3lS5wBM9gsURYkrhPJ/b+nqL2HjtcuGpc4NGEYH3Aip1RWs YE6rgJxkPgI6pDhejNlegridvUnHU+cYgNO3KyJeLKU0MPb/6HSZxPClQ+XxsIft uSCmqCq+7ePNEjgrvRwBq8JkFX5CoyjNGFa8aTOWScQ0EjKY06jLdeeKhrcu3F4c i2gw== 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:in-reply-to :message-id:mime-version:references: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=1674342793; x=1674429193; bh=As/QzBgKzg86p ZtcoUfWnwvuKQnkVQqn4iFPaqIm7LM=; b=TF71EHgYrxKcWyVnPZmFAdwNaOcMA WQRBH00DVzPAGR8rzQv3vGRjDbmQW8H69ZxlrW1z89pBys+nwhvpto2KFHsAkRX8 sS9AmZ1Tpz8keIZMz9d1LWTDAnMjmaopn859Gt8aQcU5j8lMWyx5rlwuxZm4hLzx xr4uVIJxw95GtbijJ2dpFSVcYMyjiHJ+JRw/lyte616F5m7HJo9RVcqrS1nA0tac aSI4QvFccIpe9u4Dfg6nBy5M47Hzb9VuiWN2fTDRjwuWkO+rxhfPKKdqmvHVoykM PR8Cta37qsKRuNbQjKMWp1TDTV5C+tJS6gYUrZoq7wVRjL5CQbnoMlylg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudduhedgtdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepufgrmhhu vghlucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecugg ftrfgrthhtvghrnhepudekteeuudehtdelteevgfduvddvjefhfedulefgudevgeeghefg udefiedtveetnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepshgrmhhuvghlsehshhholhhlrghnugdrohhrgh X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 21 Jan 2023 18:13:13 -0500 (EST) From: Samuel Holland To: Jaehoon Chung , Andre Przywara Cc: u-boot@lists.denx.de, Samuel Holland Subject: [PATCH v2 3/3] power: pmic: axp: Bind regulators from the DT Date: Sat, 21 Jan 2023 17:13:06 -0600 Message-Id: <20230121231307.42628-4-samuel@sholland.org> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20230121231307.42628-1-samuel@sholland.org> References: <20230121231307.42628-1-samuel@sholland.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Now that a regulator driver exists for this PMIC, hook it up to the device tree "regulators" subnodes. Signed-off-by: Samuel Holland --- (no changes since v1) drivers/power/pmic/axp.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/power/pmic/axp.c b/drivers/power/pmic/axp.c index e0005994e2..025dac24f2 100644 --- a/drivers/power/pmic/axp.c +++ b/drivers/power/pmic/axp.c @@ -45,14 +45,32 @@ static struct dm_pmic_ops axp_pmic_ops = { .write = dm_i2c_write, }; +static const struct pmic_child_info axp_pmic_child_info[] = { + { "aldo", "axp_regulator" }, + { "bldo", "axp_regulator" }, + { "cldo", "axp_regulator" }, + { "dc", "axp_regulator" }, + { "dldo", "axp_regulator" }, + { "eldo", "axp_regulator" }, + { "fldo", "axp_regulator" }, + { "ldo", "axp_regulator" }, + { "sw", "axp_regulator" }, + { } +}; + static int axp_pmic_bind(struct udevice *dev) { + ofnode regulators_node; int ret; ret = dm_scan_fdt_dev(dev); if (ret) return ret; + regulators_node = dev_read_subnode(dev, "regulators"); + if (ofnode_valid(regulators_node)) + pmic_bind_children(dev, regulators_node, axp_pmic_child_info); + if (CONFIG_IS_ENABLED(SYSRESET)) { ret = device_bind_driver_to_node(dev, "axp_sysreset", "axp_sysreset", dev_ofnode(dev), NULL); -- 2.37.4