Re: [U-Boot] [PATCH] regulator: Allow autosetting fixed regulators

2019-06-03 Thread Peng Fan
> -Original Message- > From: Sven Schwermer [mailto:s...@svenschwermer.de] > Sent: 2019年5月31日 18:44 > To: Peng Fan > Cc: u-boot@lists.denx.de; Jaehoon Chung > Subject: Re: [PATCH] regulator: Allow autosetting fixed regulators > > > How about the following patch? not tested > > > > diff

Re: [U-Boot] [PATCH] regulator: Allow autosetting fixed regulators

2019-05-31 Thread Sven Schwermer
> How about the following patch? not tested > > diff --git a/drivers/power/regulator/regulator-uclass.c > b/drivers/power/regulator/regulator-uclass.c > index 9118b8eb39..76be95bcd1 100644 > --- a/drivers/power/regulator/regulator-uclass.c > +++ b/drivers/power/regulator/regulator-uclass.c > @@ -

Re: [U-Boot] [PATCH] regulator: Allow autosetting fixed regulators

2019-05-31 Thread Peng Fan
> Subject: [PATCH] regulator: Allow autosetting fixed regulators > > Fixed regulators don't have a set_value method. Therefore, > regulator_set_value will return -ENOSYS when called from regulator_autoset. > > Accepting this return value allows autosetting fixed regulators. > > Signed-off-by: Sv

Re: [U-Boot] [PATCH] regulator: Allow autosetting fixed regulators

2019-05-31 Thread Sven Schwermer
> For fixed regulator, will min_uV/max_uV be set to value other > than -ENODATA? I think no. I see this commonly done (see Linux device trees as well as the u-boot device trees) and the kernel documentation seems to encourage it: https://www.kernel.org/doc/Documentation/devicetree/bindings/regul

Re: [U-Boot] [PATCH] regulator: Allow autosetting fixed regulators

2019-05-31 Thread Peng Fan
> Subject: Re: [PATCH] regulator: Allow autosetting fixed regulators > > Hi Peng, > > > According to code: > >if (uc_pdata->flags & REGULATOR_FLAG_AUTOSET_UV) > >ret = regulator_set_value(dev, uc_pdata->min_uV); > >if (!ret && (uc_pdata->flags & REGULATOR_FLAG_AUTO

Re: [U-Boot] [PATCH] regulator: Allow autosetting fixed regulators

2019-05-31 Thread Sven Schwermer
Hi Peng, > According to code: >if (uc_pdata->flags & REGULATOR_FLAG_AUTOSET_UV) >ret = regulator_set_value(dev, uc_pdata->min_uV); >if (!ret && (uc_pdata->flags & REGULATOR_FLAG_AUTOSET_UA)) >ret = regulator_set_current(dev, uc_pdata->min_uA); > > S

Re: [U-Boot] [PATCH] regulator: Allow autosetting fixed regulators

2019-05-31 Thread Peng Fan
Hi Sven, > Subject: [PATCH] regulator: Allow autosetting fixed regulators > > Fixed regulators don't have a set_value method. Therefore, > regulator_set_value will return -ENOSYS when called from regulator_autoset. > > Accepting this return value allows autosetting fixed regulators. > > Signed-

[U-Boot] [PATCH] regulator: Allow autosetting fixed regulators

2019-05-31 Thread Sven Schwermer
Fixed regulators don't have a set_value method. Therefore, regulator_set_value will return -ENOSYS when called from regulator_autoset. Accepting this return value allows autosetting fixed regulators. Signed-off-by: Sven Schwermer Cc: Jaehoon Chung Cc: Peng Fan --- drivers/power/regulator/regu