mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <sha@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org,
	Michael Riesch <michael.riesch@wolfvision.net>
Subject: Re: [PATCH master v2] regulator: rk808: fix misplaced DCDC_REG5
Date: Fri, 2 Dec 2022 09:50:45 +0100	[thread overview]
Message-ID: <20221202085045.GL29728@pengutronix.de> (raw)
In-Reply-To: <20221130171439.2928344-1-a.fatoum@pengutronix.de>

On Wed, Nov 30, 2022 at 06:14:39PM +0100, Ahmad Fatoum wrote:
> Driver was written to mimic existing stpmic1 regulator driver, which had
> the implicit assumption of a 1:1 relationship between of_match_data and
> regulator configuration with same indices.
> 
> Yet DCDC_REG5 was not at the same place it was in the rk_regulator_cfg
> due to likely a copy-paste mistake, leading to possibly the wrong
> regulators being controlled. Fix this.
> 
> Reported-by: Michael Riesch <michael.riesch@wolfvision.net>
> Suggested-by: Michael Riesch <michael.riesch@wolfvision.net>
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
> move entry in rk809_reg, not rk809_reg_matches to keep same numbering as
> enum rk809_reg_id.
> ---
>  drivers/regulator/rk808-regulator.c | 27 ++++++++++++++-------------
>  1 file changed, 14 insertions(+), 13 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/drivers/regulator/rk808-regulator.c b/drivers/regulator/rk808-regulator.c
> index 39eadbd3ebe5..f8bc31f354e2 100644
> --- a/ drivers/regulator/rk808-regulator.c
> +++ b/drivers/regulator/rk808-regulator.c
> @@ -526,19 +526,6 @@ static struct rk_regulator_cfg rk809_reg[] = {
>  		.enable_mask = ENABLE_MASK(RK817_ID_DCDC4),
>  		.enable_val = ENABLE_MASK(RK817_ID_DCDC4),
>  		.disable_val = DISABLE_VAL(RK817_ID_DCDC4),
> -	}}, {{
> -		/* .name = "DCDC_REG5", */
> -		.supply_name = "vcc9",
> -		.ops = &rk809_buck5_ops_range,
> -		.n_voltages = RK809_BUCK5_SEL_CNT,
> -		.linear_ranges = rk809_buck5_voltage_ranges,
> -		.n_linear_ranges = ARRAY_SIZE(rk809_buck5_voltage_ranges),
> -		.vsel_reg = RK809_BUCK5_CONFIG(0),
> -		.vsel_mask = RK809_BUCK5_VSEL_MASK,
> -		.enable_reg = RK817_POWER_EN_REG(3),
> -		.enable_mask = ENABLE_MASK(1),
> -		.enable_val = ENABLE_MASK(1),
> -		.disable_val = DISABLE_VAL(1),
>  	}},
>  	RK817_DESC(/* "LDO_REG1", */ "vcc5", 600, 3400, 25,
>  		   RK817_LDO_ON_VSEL_REG(0), RK817_LDO_VSEL_MASK,
> @@ -576,6 +563,20 @@ static struct rk_regulator_cfg rk809_reg[] = {
>  		   RK817_LDO_ON_VSEL_REG(8), RK817_LDO_VSEL_MASK,
>  		   RK817_POWER_EN_REG(3), ENABLE_MASK(0),
>  		   DISABLE_VAL(0), 400),
> +	{{
> +		/* .name = "DCDC_REG5", */
> +		.supply_name = "vcc9",
> +		.ops = &rk809_buck5_ops_range,
> +		.n_voltages = RK809_BUCK5_SEL_CNT,
> +		.linear_ranges = rk809_buck5_voltage_ranges,
> +		.n_linear_ranges = ARRAY_SIZE(rk809_buck5_voltage_ranges),
> +		.vsel_reg = RK809_BUCK5_CONFIG(0),
> +		.vsel_mask = RK809_BUCK5_VSEL_MASK,
> +		.enable_reg = RK817_POWER_EN_REG(3),
> +		.enable_mask = ENABLE_MASK(1),
> +		.enable_val = ENABLE_MASK(1),
> +		.disable_val = DISABLE_VAL(1),
> +	}},
>  	RK817_DESC_SWITCH(/* "SWITCH_REG1", */ "vcc9",
>  			  RK817_POWER_EN_REG(3), ENABLE_MASK(2), DISABLE_VAL(2)),
>  	RK817_DESC_SWITCH(/* "SWITCH_REG2", */ "vcc8",
> -- 
> 2.30.2
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



      parent reply	other threads:[~2022-12-02  8:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-30 17:14 Ahmad Fatoum
2022-12-01  7:27 ` Michael Riesch
2022-12-02  8:50 ` Sascha Hauer [this message]

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=20221202085045.GL29728@pengutronix.de \
    --to=sha@pengutronix.de \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=michael.riesch@wolfvision.net \
    /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