Re: [PATCH net-next v1 2/2] net: dsa: realtek: rtl83xx: add support for enabling supplies

Andrew Lunn <[email protected]>
Newsgroups org.kernel.vger.netdev,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
> +static const char *const rtl8365mb_supplies[] = {
> +	"avddh", "avddl", "dvddio", "dvddio1", "dvddl", "pllvddl", NULL,
> +};
> +

> +static int rtl83xx_enable_supplies(struct device *dev,
> +				   const char *const *supplies)
> +{
> +	int i, ret, count = 0;
> +
> +	for (i = 0; supplies && supplies[i]; i++) {
> +		ret = devm_regulator_get_enable_optional(dev, supplies[i]);
> +		if (ret == -ENODEV)
> +			continue;
> +		if (ret)
> +			return dev_err_probe(dev, ret, "failed to enable %s supply\n",
> +					     supplies[i]);
> +		count++;
> +	}
> +

I've never used it, i've no idea if it is applicable, but there does
appear to be _bulk_ calls in the regulator API, maybe which is similar
to the clk _bulk_ API?

Andrew
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.