From mboxrd@z Thu Jan 1 00:00:00 1970 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 3D17BC25B4E for ; Sun, 22 Jan 2023 17:42:04 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8E462850CC; Sun, 22 Jan 2023 18:42:01 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id EAAF88539D; Sun, 22 Jan 2023 18:41:58 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id 7D26984FD1 for ; Sun, 22 Jan 2023 18:41:56 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=andre.przywara@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 37DF21042; Sun, 22 Jan 2023 09:42:37 -0800 (PST) Received: from slackpad.lan (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D0E963F445; Sun, 22 Jan 2023 09:41:54 -0800 (PST) Date: Sun, 22 Jan 2023 17:39:52 +0000 From: Andre Przywara To: Samuel Holland Cc: Jaehoon Chung , u-boot@lists.denx.de Subject: Re: [PATCH v2 3/3] power: pmic: axp: Bind regulators from the DT Message-ID: <20230122173952.63cb0e4e@slackpad.lan> In-Reply-To: <20230121231307.42628-4-samuel@sholland.org> References: <20230121231307.42628-1-samuel@sholland.org> <20230121231307.42628-4-samuel@sholland.org> Organization: Arm Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.31; x86_64-slackware-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 On Sat, 21 Jan 2023 17:13:06 -0600 Samuel Holland wrote: Hi, > 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" }, Technically I think this list misses "rtc" (for rtc[_-]ldo), but those are real fixed regulators, and I see only one weird consumer (GPS device in sun8i-a83t-tbs-a711.dts, not relevant to U-Boot), so I think it's fine. Should an actual user emerge, we can always add it. Reviewed-by: Andre Przywara Cheers, Andre > + { "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);