Re: [PATCH net-next v5 09/12] net: pse-pd: pd692x0: Add support for controller and manager power supplies

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Köry,

On Tue, 18 Feb 2025 17:19:13 +0100
Kory Maincent <kory.maincent@xxxxxxxxxxx> wrote:

> From: Kory Maincent (Dent Project) <kory.maincent@xxxxxxxxxxx>
> 
> Add support for managing the VDD and VDDA power supplies for the PD692x0
> PSE controller, as well as the VAUX5 and VAUX3P3 power supplies for the
> PD6920x PSE managers.
> 
> Signed-off-by: Kory Maincent (Dent Project) <kory.maincent@xxxxxxxxxxx>
> ---
> 
> Changes in v5:
> - New patch
> ---
>  drivers/net/pse-pd/pd692x0.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/drivers/net/pse-pd/pd692x0.c b/drivers/net/pse-pd/pd692x0.c
> index 44ded2aa6fca..c9fa60b314ce 100644
> --- a/drivers/net/pse-pd/pd692x0.c
> +++ b/drivers/net/pse-pd/pd692x0.c
> @@ -976,8 +976,10 @@ pd692x0_register_managers_regulator(struct pd692x0_priv *priv,
>  	reg_name_len = strlen(dev_name(dev)) + 23;
>  
>  	for (i = 0; i < nmanagers; i++) {
> +		static const char * const regulators[] = { "vaux5", "vaux3p3" };

Looks like the 'static' is not needed here :)

>  		struct regulator_dev *rdev;
>  		char *reg_name;
> +		int ret;
>  
>  		reg_name = devm_kzalloc(dev, reg_name_len, GFP_KERNEL);
>  		if (!reg_name)
> @@ -988,6 +990,17 @@ pd692x0_register_managers_regulator(struct pd692x0_priv *priv,
>  		if (IS_ERR(rdev))
>  			return PTR_ERR(rdev);
>  
> +		/* VMAIN is described as main supply for the manager.
> +		 * Add other VAUX power supplies and link them to the
> +		 * virtual device rdev->dev.
> +		 */
> +		ret = devm_regulator_bulk_get_enable(&rdev->dev,
> +						     ARRAY_SIZE(regulators),
> +						     regulators);
> +		if (ret)
> +			return dev_err_probe(&rdev->dev, ret,
> +					     "Failed to enable regulators\n");
> +
>  		priv->manager_reg[i] = rdev;
>  	}
>  
> @@ -1640,6 +1653,7 @@ static const struct fw_upload_ops pd692x0_fw_ops = {
>  
>  static int pd692x0_i2c_probe(struct i2c_client *client)
>  {
> +	static const char * const regulators[] = { "vdd", "vdda" };

And here as well

Thanks,

Maxime





[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux