From: Michael Riesch <michael.riesch@wolfvision.net>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>, barebox@lists.infradead.org
Subject: Re: [PATCH master v2] regulator: rk808: fix misplaced DCDC_REG5
Date: Thu, 1 Dec 2022 08:27:03 +0100 [thread overview]
Message-ID: <eb9cd275-e27f-a3a4-7934-56e741775605@wolfvision.net> (raw)
In-Reply-To: <20221130171439.2928344-1-a.fatoum@pengutronix.de>
Hi Ahmad,
On 11/30/22 18:14, 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.
Cool, thanks for the fix!
>
> 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>
Reviewed-by: Michael Riesch <michael.riesch@wolfvision.net>
> ---
> move entry in rk809_reg, not rk809_reg_matches to keep same numbering as
> enum rk809_reg_id.
Note that I haven't tested your patch, but v2 is identical to the fix I
have applied and tested in my setup. So it should be fine (TM).
Best regards,
Michael
> ---
> drivers/regulator/rk808-regulator.c | 27 ++++++++++++++-------------
> 1 file changed, 14 insertions(+), 13 deletions(-)
>
> 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",
next prev parent reply other threads:[~2022-12-01 7:29 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 [this message]
2022-12-02 8:50 ` Sascha Hauer
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=eb9cd275-e27f-a3a4-7934-56e741775605@wolfvision.net \
--to=michael.riesch@wolfvision.net \
--cc=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/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