public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@arm.com>
To: Samuel Holland <samuel@sholland.org>
Cc: Jaehoon Chung <jh80.chung@samsung.com>, u-boot@lists.denx.de
Subject: Re: [PATCH v2 3/3] power: pmic: axp: Bind regulators from the DT
Date: Sun, 22 Jan 2023 17:39:52 +0000	[thread overview]
Message-ID: <20230122173952.63cb0e4e@slackpad.lan> (raw)
In-Reply-To: <20230121231307.42628-4-samuel@sholland.org>

On Sat, 21 Jan 2023 17:13:06 -0600
Samuel Holland <samuel@sholland.org> 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 <samuel@sholland.org>
> ---
> 
> (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 <andre.przywara@arm.com>

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);


  reply	other threads:[~2023-01-22 17:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-21 23:13 [PATCH v2 0/3] power: X-Powers PMIC regulator support Samuel Holland
2023-01-21 23:13 ` [PATCH v2 1/3] power: pmic: axp: Provide a variant ID in the driver data Samuel Holland
2023-01-21 23:13 ` [PATCH v2 2/3] power: regulator: Add a driver for AXP PMIC regulators Samuel Holland
2023-01-22  0:10   ` Andre Przywara
2023-01-23 18:49   ` Simon Glass
2023-01-23 19:54     ` Andre Przywara
2023-01-21 23:13 ` [PATCH v2 3/3] power: pmic: axp: Bind regulators from the DT Samuel Holland
2023-01-22 17:39   ` Andre Przywara [this message]
2023-01-23  1:38 ` [PATCH v2 0/3] power: X-Powers PMIC regulator support Andre Przywara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230122173952.63cb0e4e@slackpad.lan \
    --to=andre.przywara@arm.com \
    --cc=jh80.chung@samsung.com \
    --cc=samuel@sholland.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox