[PATCH] regulator: axp20x: AXP717: set ramp_delay

Philippe Simons posted 1 patch 1 year ago
There is a newer version of this series
drivers/regulator/axp20x-regulator.c | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
[PATCH] regulator: axp20x: AXP717: set ramp_delay
Posted by Philippe Simons 1 year ago
AXP717 datasheet says that regulator ramp delay is 15.625 us/step,
which is 10mV in our case.

Add a AXP_DESC_RANGES_DELAY macro and update AXP_DESC_RANGES macro to
expand to AXP_DESC_RANGES_DELAY with ramp_delay = 0

Signed-off-by: Philippe Simons <simons.philippe@gmail.com>
---
 drivers/regulator/axp20x-regulator.c | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
index a8e91d9d0..8f035db13 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -419,8 +419,8 @@
 		.ops		= &axp20x_ops_fixed				\
 	}
 
-#define AXP_DESC_RANGES(_family, _id, _match, _supply, _ranges, _n_voltages,	\
-			_vreg, _vmask, _ereg, _emask)				\
+#define AXP_DESC_RANGES_DELAY(_family, _id, _match, _supply, _ranges, _n_voltages,	\
+			_vreg, _vmask, _ereg, _emask, _ramp_delay)	\
 	[_family##_##_id] = {							\
 		.name		= (_match),					\
 		.supply_name	= (_supply),					\
@@ -437,8 +437,15 @@
 		.linear_ranges	= (_ranges),					\
 		.n_linear_ranges = ARRAY_SIZE(_ranges),				\
 		.ops		= &axp20x_ops_range,				\
+		.ramp_delay = (_ramp_delay),			\
 	}
 
+#define AXP_DESC_RANGES(_family, _id, _match, _supply, _ranges, _n_voltages,	\
+			_vreg, _vmask, _ereg, _emask)				\
+	AXP_DESC_RANGES_DELAY(_family, _id, _match, _supply, _ranges, _n_voltages,	\
+		_vreg, _vmask, _ereg, _emask, 0)
+
+
 static const int axp209_dcdc2_ldo3_slew_rates[] = {
 	1600,
 	 800,
@@ -781,18 +788,18 @@ static const struct linear_range axp717_dcdc3_ranges[] = {
 };
 
 static const struct regulator_desc axp717_regulators[] = {
-	AXP_DESC_RANGES(AXP717, DCDC1, "dcdc1", "vin1",
+	AXP_DESC_RANGES_DELAY(AXP717, DCDC1, "dcdc1", "vin1",
 			axp717_dcdc1_ranges, AXP717_DCDC1_NUM_VOLTAGES,
 			AXP717_DCDC1_CONTROL, AXP717_DCDC_V_OUT_MASK,
-			AXP717_DCDC_OUTPUT_CONTROL, BIT(0)),
-	AXP_DESC_RANGES(AXP717, DCDC2, "dcdc2", "vin2",
+			AXP717_DCDC_OUTPUT_CONTROL, BIT(0), 640),
+	AXP_DESC_RANGES_DELAY(AXP717, DCDC2, "dcdc2", "vin2",
 			axp717_dcdc2_ranges, AXP717_DCDC2_NUM_VOLTAGES,
 			AXP717_DCDC2_CONTROL, AXP717_DCDC_V_OUT_MASK,
-			AXP717_DCDC_OUTPUT_CONTROL, BIT(1)),
-	AXP_DESC_RANGES(AXP717, DCDC3, "dcdc3", "vin3",
+			AXP717_DCDC_OUTPUT_CONTROL, BIT(1), 640),
+	AXP_DESC_RANGES_DELAY(AXP717, DCDC3, "dcdc3", "vin3",
 			axp717_dcdc3_ranges, AXP717_DCDC3_NUM_VOLTAGES,
 			AXP717_DCDC3_CONTROL, AXP717_DCDC_V_OUT_MASK,
-			AXP717_DCDC_OUTPUT_CONTROL, BIT(2)),
+			AXP717_DCDC_OUTPUT_CONTROL, BIT(2), 640),
 	AXP_DESC(AXP717, DCDC4, "dcdc4", "vin4", 1000, 3700, 100,
 		 AXP717_DCDC4_CONTROL, AXP717_DCDC_V_OUT_MASK,
 		 AXP717_DCDC_OUTPUT_CONTROL, BIT(3)),
-- 
2.47.1
Re: [PATCH] regulator: axp20x: AXP717: set ramp_delay
Posted by Mark Brown 1 year ago
On Fri, 06 Dec 2024 13:37:51 +0100, Philippe Simons wrote:
> AXP717 datasheet says that regulator ramp delay is 15.625 us/step,
> which is 10mV in our case.
> 
> Add a AXP_DESC_RANGES_DELAY macro and update AXP_DESC_RANGES macro to
> expand to AXP_DESC_RANGES_DELAY with ramp_delay = 0
> 
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next

Thanks!

[1/1] regulator: axp20x: AXP717: set ramp_delay
      commit: f07ae52f5cf6a5584fdf7c8c652f027d90bc8b74

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
Re: [PATCH] regulator: axp20x: AXP717: set ramp_delay
Posted by Chris Morgan 1 year ago
On Fri, Dec 06, 2024 at 01:37:51PM +0100, Philippe Simons wrote:
> AXP717 datasheet says that regulator ramp delay is 15.625 us/step,
> which is 10mV in our case.
> 
> Add a AXP_DESC_RANGES_DELAY macro and update AXP_DESC_RANGES macro to
> expand to AXP_DESC_RANGES_DELAY with ramp_delay = 0
> 
> Signed-off-by: Philippe Simons <simons.philippe@gmail.com>
> ---
>  drivers/regulator/axp20x-regulator.c | 23 +++++++++++++++--------
>  1 file changed, 15 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
> index a8e91d9d0..8f035db13 100644
> --- a/drivers/regulator/axp20x-regulator.c
> +++ b/drivers/regulator/axp20x-regulator.c
> @@ -419,8 +419,8 @@
>  		.ops		= &axp20x_ops_fixed				\
>  	}
>  
> -#define AXP_DESC_RANGES(_family, _id, _match, _supply, _ranges, _n_voltages,	\
> -			_vreg, _vmask, _ereg, _emask)				\
> +#define AXP_DESC_RANGES_DELAY(_family, _id, _match, _supply, _ranges, _n_voltages,	\
> +			_vreg, _vmask, _ereg, _emask, _ramp_delay)	\
>  	[_family##_##_id] = {							\
>  		.name		= (_match),					\
>  		.supply_name	= (_supply),					\
> @@ -437,8 +437,15 @@
>  		.linear_ranges	= (_ranges),					\
>  		.n_linear_ranges = ARRAY_SIZE(_ranges),				\
>  		.ops		= &axp20x_ops_range,				\
> +		.ramp_delay = (_ramp_delay),			\
>  	}
>  
> +#define AXP_DESC_RANGES(_family, _id, _match, _supply, _ranges, _n_voltages,	\
> +			_vreg, _vmask, _ereg, _emask)				\
> +	AXP_DESC_RANGES_DELAY(_family, _id, _match, _supply, _ranges, _n_voltages,	\
> +		_vreg, _vmask, _ereg, _emask, 0)
> +
> +
>  static const int axp209_dcdc2_ldo3_slew_rates[] = {
>  	1600,
>  	 800,
> @@ -781,18 +788,18 @@ static const struct linear_range axp717_dcdc3_ranges[] = {
>  };
>  
>  static const struct regulator_desc axp717_regulators[] = {
> -	AXP_DESC_RANGES(AXP717, DCDC1, "dcdc1", "vin1",
> +	AXP_DESC_RANGES_DELAY(AXP717, DCDC1, "dcdc1", "vin1",
>  			axp717_dcdc1_ranges, AXP717_DCDC1_NUM_VOLTAGES,
>  			AXP717_DCDC1_CONTROL, AXP717_DCDC_V_OUT_MASK,
> -			AXP717_DCDC_OUTPUT_CONTROL, BIT(0)),
> -	AXP_DESC_RANGES(AXP717, DCDC2, "dcdc2", "vin2",
> +			AXP717_DCDC_OUTPUT_CONTROL, BIT(0), 640),
> +	AXP_DESC_RANGES_DELAY(AXP717, DCDC2, "dcdc2", "vin2",
>  			axp717_dcdc2_ranges, AXP717_DCDC2_NUM_VOLTAGES,
>  			AXP717_DCDC2_CONTROL, AXP717_DCDC_V_OUT_MASK,
> -			AXP717_DCDC_OUTPUT_CONTROL, BIT(1)),
> -	AXP_DESC_RANGES(AXP717, DCDC3, "dcdc3", "vin3",
> +			AXP717_DCDC_OUTPUT_CONTROL, BIT(1), 640),
> +	AXP_DESC_RANGES_DELAY(AXP717, DCDC3, "dcdc3", "vin3",
>  			axp717_dcdc3_ranges, AXP717_DCDC3_NUM_VOLTAGES,
>  			AXP717_DCDC3_CONTROL, AXP717_DCDC_V_OUT_MASK,
> -			AXP717_DCDC_OUTPUT_CONTROL, BIT(2)),
> +			AXP717_DCDC_OUTPUT_CONTROL, BIT(2), 640),
>  	AXP_DESC(AXP717, DCDC4, "dcdc4", "vin4", 1000, 3700, 100,
>  		 AXP717_DCDC4_CONTROL, AXP717_DCDC_V_OUT_MASK,
>  		 AXP717_DCDC_OUTPUT_CONTROL, BIT(3)),
> -- 
> 2.47.1
> 

This series solves the immediate crashes I get on startup when I use
schedutil as my cpu scheduler.

Tested-by: Chris Morgan <macromorgan@hotmail.com>
Re: [PATCH] regulator: axp20x: AXP717: set ramp_delay
Posted by Chen-Yu Tsai 1 year ago
On Fri, Dec 6, 2024 at 8:38 PM Philippe Simons
<simons.philippe@gmail.com> wrote:
>
> AXP717 datasheet says that regulator ramp delay is 15.625 us/step,
> which is 10mV in our case.

Thanks! It looks like the reason the delay is needed is because the
voltage ramp control feature is on by default on this chip.

That is not entirely correct. 10mV is the smallest step forDCDC1,
DCDC2, and DCDC3, so it makes sense to calculate the ramp delay
using that.

For DCDC4, the step is 100mV, so the delay would be different.

> Add a AXP_DESC_RANGES_DELAY macro and update AXP_DESC_RANGES macro to
> expand to AXP_DESC_RANGES_DELAY with ramp_delay = 0
>
> Signed-off-by: Philippe Simons <simons.philippe@gmail.com>

The ramp rate / delay is actually configurable between 15.625 us/step
and 31.250 us/step. However the setting shared among all DCDCs that
support this function and have it turned on. I'm not sure how that
should be modeled if we want to make it configurable.

Also looking at older AXP PMICs:

- AXP803: ramp rate 2.5mV / us, on by default, has register bit that can
          polled to check for ramp completion
- AXP813: same as AXP803

- AXP805: Similar to AXP717, where rate is given in time / step, the
          options are the same two and step is different for different
          buck regulators; difference is not all buck regulators support
          this feature, and also the rate is individually configurable
          for each one. Off by default.

- AXP223: 1.6mV/us or 0.8mV/us; off by default; only two buck regulators
          support it; individually configurable.

> ---
>  drivers/regulator/axp20x-regulator.c | 23 +++++++++++++++--------
>  1 file changed, 15 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
> index a8e91d9d0..8f035db13 100644
> --- a/drivers/regulator/axp20x-regulator.c
> +++ b/drivers/regulator/axp20x-regulator.c
> @@ -419,8 +419,8 @@
>                 .ops            = &axp20x_ops_fixed                             \
>         }
>
> -#define AXP_DESC_RANGES(_family, _id, _match, _supply, _ranges, _n_voltages,   \
> -                       _vreg, _vmask, _ereg, _emask)                           \
> +#define AXP_DESC_RANGES_DELAY(_family, _id, _match, _supply, _ranges, _n_voltages,     \
> +                       _vreg, _vmask, _ereg, _emask, _ramp_delay)      \
>         [_family##_##_id] = {                                                   \
>                 .name           = (_match),                                     \
>                 .supply_name    = (_supply),                                    \
> @@ -437,8 +437,15 @@
>                 .linear_ranges  = (_ranges),                                    \
>                 .n_linear_ranges = ARRAY_SIZE(_ranges),                         \
>                 .ops            = &axp20x_ops_range,                            \
> +               .ramp_delay = (_ramp_delay),                    \
>         }
>
> +#define AXP_DESC_RANGES(_family, _id, _match, _supply, _ranges, _n_voltages,   \
> +                       _vreg, _vmask, _ereg, _emask)                           \
> +       AXP_DESC_RANGES_DELAY(_family, _id, _match, _supply, _ranges, _n_voltages,      \
> +               _vreg, _vmask, _ereg, _emask, 0)
> +
> +
>  static const int axp209_dcdc2_ldo3_slew_rates[] = {
>         1600,
>          800,
> @@ -781,18 +788,18 @@ static const struct linear_range axp717_dcdc3_ranges[] = {
>  };
>
>  static const struct regulator_desc axp717_regulators[] = {
> -       AXP_DESC_RANGES(AXP717, DCDC1, "dcdc1", "vin1",
> +       AXP_DESC_RANGES_DELAY(AXP717, DCDC1, "dcdc1", "vin1",
>                         axp717_dcdc1_ranges, AXP717_DCDC1_NUM_VOLTAGES,
>                         AXP717_DCDC1_CONTROL, AXP717_DCDC_V_OUT_MASK,
> -                       AXP717_DCDC_OUTPUT_CONTROL, BIT(0)),
> -       AXP_DESC_RANGES(AXP717, DCDC2, "dcdc2", "vin2",
> +                       AXP717_DCDC_OUTPUT_CONTROL, BIT(0), 640),
> +       AXP_DESC_RANGES_DELAY(AXP717, DCDC2, "dcdc2", "vin2",
>                         axp717_dcdc2_ranges, AXP717_DCDC2_NUM_VOLTAGES,
>                         AXP717_DCDC2_CONTROL, AXP717_DCDC_V_OUT_MASK,
> -                       AXP717_DCDC_OUTPUT_CONTROL, BIT(1)),
> -       AXP_DESC_RANGES(AXP717, DCDC3, "dcdc3", "vin3",
> +                       AXP717_DCDC_OUTPUT_CONTROL, BIT(1), 640),
> +       AXP_DESC_RANGES_DELAY(AXP717, DCDC3, "dcdc3", "vin3",
>                         axp717_dcdc3_ranges, AXP717_DCDC3_NUM_VOLTAGES,
>                         AXP717_DCDC3_CONTROL, AXP717_DCDC_V_OUT_MASK,
> -                       AXP717_DCDC_OUTPUT_CONTROL, BIT(2)),
> +                       AXP717_DCDC_OUTPUT_CONTROL, BIT(2), 640),
>         AXP_DESC(AXP717, DCDC4, "dcdc4", "vin4", 1000, 3700, 100,

Can you also add it to DCDC4 for completeness?


Thanks
ChenYu


>                  AXP717_DCDC4_CONTROL, AXP717_DCDC_V_OUT_MASK,
>                  AXP717_DCDC_OUTPUT_CONTROL, BIT(3)),
> --
> 2.47.1
>
Re: [PATCH] regulator: axp20x: AXP717: set ramp_delay
Posted by Philippe Simons 1 year ago
On Sat, Dec 7, 2024 at 5:37 AM Chen-Yu Tsai <wens@csie.org> wrote:
>
> On Fri, Dec 6, 2024 at 8:38 PM Philippe Simons
> <simons.philippe@gmail.com> wrote:
> >
> > AXP717 datasheet says that regulator ramp delay is 15.625 us/step,
> > which is 10mV in our case.
>
> Thanks! It looks like the reason the delay is needed is because the
> voltage ramp control feature is on by default on this chip.
>
> That is not entirely correct. 10mV is the smallest step forDCDC1,
> DCDC2, and DCDC3, so it makes sense to calculate the ramp delay
> using that.
>
> For DCDC4, the step is 100mV, so the delay would be different.
>
> > Add a AXP_DESC_RANGES_DELAY macro and update AXP_DESC_RANGES macro to
> > expand to AXP_DESC_RANGES_DELAY with ramp_delay = 0
> >
> > Signed-off-by: Philippe Simons <simons.philippe@gmail.com>
>
> The ramp rate / delay is actually configurable between 15.625 us/step
> and 31.250 us/step. However the setting shared among all DCDCs that
> support this function and have it turned on. I'm not sure how that
> should be modeled if we want to make it configurable.

there is axp20x_set_ramp_delay() ops, but it seems to only handle
axp209 DCDC2 and LDO3

>
> Also looking at older AXP PMICs:
>
> - AXP803: ramp rate 2.5mV / us, on by default, has register bit that can
>           polled to check for ramp completion
> - AXP813: same as AXP803
>
> - AXP805: Similar to AXP717, where rate is given in time / step, the
>           options are the same two and step is different for different
>           buck regulators; difference is not all buck regulators support
>           this feature, and also the rate is individually configurable
>           for each one. Off by default.
>
> - AXP223: 1.6mV/us or 0.8mV/us; off by default; only two buck regulators
>           support it; individually configurable.
>
> > ---
> >  drivers/regulator/axp20x-regulator.c | 23 +++++++++++++++--------
> >  1 file changed, 15 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
> > index a8e91d9d0..8f035db13 100644
> > --- a/drivers/regulator/axp20x-regulator.c
> > +++ b/drivers/regulator/axp20x-regulator.c
> > @@ -419,8 +419,8 @@
> >                 .ops            = &axp20x_ops_fixed                             \
> >         }
> >
> > -#define AXP_DESC_RANGES(_family, _id, _match, _supply, _ranges, _n_voltages,   \
> > -                       _vreg, _vmask, _ereg, _emask)                           \
> > +#define AXP_DESC_RANGES_DELAY(_family, _id, _match, _supply, _ranges, _n_voltages,     \
> > +                       _vreg, _vmask, _ereg, _emask, _ramp_delay)      \
> >         [_family##_##_id] = {                                                   \
> >                 .name           = (_match),                                     \
> >                 .supply_name    = (_supply),                                    \
> > @@ -437,8 +437,15 @@
> >                 .linear_ranges  = (_ranges),                                    \
> >                 .n_linear_ranges = ARRAY_SIZE(_ranges),                         \
> >                 .ops            = &axp20x_ops_range,                            \
> > +               .ramp_delay = (_ramp_delay),                    \
> >         }
> >
> > +#define AXP_DESC_RANGES(_family, _id, _match, _supply, _ranges, _n_voltages,   \
> > +                       _vreg, _vmask, _ereg, _emask)                           \
> > +       AXP_DESC_RANGES_DELAY(_family, _id, _match, _supply, _ranges, _n_voltages,      \
> > +               _vreg, _vmask, _ereg, _emask, 0)
> > +
> > +
> >  static const int axp209_dcdc2_ldo3_slew_rates[] = {
> >         1600,
> >          800,
> > @@ -781,18 +788,18 @@ static const struct linear_range axp717_dcdc3_ranges[] = {
> >  };
> >
> >  static const struct regulator_desc axp717_regulators[] = {
> > -       AXP_DESC_RANGES(AXP717, DCDC1, "dcdc1", "vin1",
> > +       AXP_DESC_RANGES_DELAY(AXP717, DCDC1, "dcdc1", "vin1",
> >                         axp717_dcdc1_ranges, AXP717_DCDC1_NUM_VOLTAGES,
> >                         AXP717_DCDC1_CONTROL, AXP717_DCDC_V_OUT_MASK,
> > -                       AXP717_DCDC_OUTPUT_CONTROL, BIT(0)),
> > -       AXP_DESC_RANGES(AXP717, DCDC2, "dcdc2", "vin2",
> > +                       AXP717_DCDC_OUTPUT_CONTROL, BIT(0), 640),
> > +       AXP_DESC_RANGES_DELAY(AXP717, DCDC2, "dcdc2", "vin2",
> >                         axp717_dcdc2_ranges, AXP717_DCDC2_NUM_VOLTAGES,
> >                         AXP717_DCDC2_CONTROL, AXP717_DCDC_V_OUT_MASK,
> > -                       AXP717_DCDC_OUTPUT_CONTROL, BIT(1)),
> > -       AXP_DESC_RANGES(AXP717, DCDC3, "dcdc3", "vin3",
> > +                       AXP717_DCDC_OUTPUT_CONTROL, BIT(1), 640),
> > +       AXP_DESC_RANGES_DELAY(AXP717, DCDC3, "dcdc3", "vin3",
> >                         axp717_dcdc3_ranges, AXP717_DCDC3_NUM_VOLTAGES,
> >                         AXP717_DCDC3_CONTROL, AXP717_DCDC_V_OUT_MASK,
> > -                       AXP717_DCDC_OUTPUT_CONTROL, BIT(2)),
> > +                       AXP717_DCDC_OUTPUT_CONTROL, BIT(2), 640),
> >         AXP_DESC(AXP717, DCDC4, "dcdc4", "vin4", 1000, 3700, 100,
>
> Can you also add it to DCDC4 for completeness?

I'll do in V2

>
>
> Thanks
> ChenYu
>
>
> >                  AXP717_DCDC4_CONTROL, AXP717_DCDC_V_OUT_MASK,
> >                  AXP717_DCDC_OUTPUT_CONTROL, BIT(3)),
> > --
> > 2.47.1
> >
Re: [PATCH] regulator: axp20x: AXP717: set ramp_delay
Posted by Hironori KIKUCHI 1 year ago
This patch resolves the freezing issue. Tested on Anbernic RG35XX Plus with AXP717 PMIC.

Tested-by: Hironori KIKUCHI <kikuchan98@gmail.com>
Re: [PATCH] regulator: axp20x: AXP717: set ramp_delay
Posted by Mark Brown 1 year ago
On Fri, Dec 06, 2024 at 01:37:51PM +0100, Philippe Simons wrote:
> AXP717 datasheet says that regulator ramp delay is 15.625 us/step,
> which is 10mV in our case.

>  static const struct regulator_desc axp717_regulators[] = {
> +	AXP_DESC_RANGES_DELAY(AXP717, DCDC1, "dcdc1", "vin1",
> +			AXP717_DCDC_OUTPUT_CONTROL, BIT(0), 640),

This doesn't seem to match with the above - ramp_delay is in units of
uV/us?
Re: [PATCH] regulator: axp20x: AXP717: set ramp_delay
Posted by Philippe Simons 1 year ago
On Fri, Dec 6, 2024 at 1:48 PM Mark Brown <broonie@kernel.org> wrote:
>
> On Fri, Dec 06, 2024 at 01:37:51PM +0100, Philippe Simons wrote:
> > AXP717 datasheet says that regulator ramp delay is 15.625 us/step,
> > which is 10mV in our case.
>
> >  static const struct regulator_desc axp717_regulators[] = {
> > +     AXP_DESC_RANGES_DELAY(AXP717, DCDC1, "dcdc1", "vin1",
> > +                     AXP717_DCDC_OUTPUT_CONTROL, BIT(0), 640),
>
> This doesn't seem to match with the above - ramp_delay is in units of
> uV/us?

15.625 us / 10mV = 1.5625 us/mV = 0.0015625 us/uV
0.0015625^-1 = 640 uV/us

Or did I miss too many math lessons...
Re: [PATCH] regulator: axp20x: AXP717: set ramp_delay
Posted by Mark Brown 1 year ago
On Fri, Dec 06, 2024 at 01:54:39PM +0100, Philippe Simons wrote:
> On Fri, Dec 6, 2024 at 1:48 PM Mark Brown <broonie@kernel.org> wrote:

> > >  static const struct regulator_desc axp717_regulators[] = {
> > > +     AXP_DESC_RANGES_DELAY(AXP717, DCDC1, "dcdc1", "vin1",
> > > +                     AXP717_DCDC_OUTPUT_CONTROL, BIT(0), 640),

> > This doesn't seem to match with the above - ramp_delay is in units of
> > uV/us?

> 15.625 us / 10mV = 1.5625 us/mV = 0.0015625 us/uV
> 0.0015625^-1 = 640 uV/us

Ah, yes - sorry - I typed when I did the calculation.
Re: [PATCH] regulator: axp20x: AXP717: set ramp_delay
Posted by Philippe Simons 1 year ago
On Fri, Dec 6, 2024 at 2:44 PM Mark Brown <broonie@kernel.org> wrote:
>
> On Fri, Dec 06, 2024 at 01:54:39PM +0100, Philippe Simons wrote:
> > On Fri, Dec 6, 2024 at 1:48 PM Mark Brown <broonie@kernel.org> wrote:
>
> > > >  static const struct regulator_desc axp717_regulators[] = {
> > > > +     AXP_DESC_RANGES_DELAY(AXP717, DCDC1, "dcdc1", "vin1",
> > > > +                     AXP717_DCDC_OUTPUT_CONTROL, BIT(0), 640),
>
> > > This doesn't seem to match with the above - ramp_delay is in units of
> > > uV/us?
>
> > 15.625 us / 10mV = 1.5625 us/mV = 0.0015625 us/uV
> > 0.0015625^-1 = 640 uV/us
>
> Ah, yes - sorry - I typed when I did the calculation.

No problem.
BTW: this patch is critical to at least Anbernic H700 based devices.
Without it, DVFS crashes very quickly.