From: Kever Yang <kever.yang@rock-chips.com>
To: Quentin Schulz <foss+uboot@0leil.net>,
Jaehoon Chung <jh80.chung@samsung.com>,
Tom Rini <trini@konsulko.com>
Cc: Simon Glass <sjg@chromium.org>,
u-boot@lists.denx.de, Quentin Schulz <quentin.schulz@cherry.de>
Subject: Re: [PATCH 2/3] regulator: rk8xx: pass pmic udevice instead of regulator to all internal functions
Date: Thu, 6 Jun 2024 14:45:52 +0800 [thread overview]
Message-ID: <770db746-e154-4890-ba2a-3b17bfcfcbbf@rock-chips.com> (raw)
In-Reply-To: <20240605-pmic-rk8xx-v1-2-2349fdf68aa0@cherry.de>
On 2024/6/5 17:33, Quentin Schulz wrote:
> From: Quentin Schulz <quentin.schulz@cherry.de>
>
> For the sake of consistency, make all internal (starting with _)
> functions expect a pmic udevice instead of a regulator udevice.
>
> Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Thanks,
- Kever
> ---
> drivers/power/regulator/rk8xx.c | 20 ++++++++++----------
> 1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/power/regulator/rk8xx.c b/drivers/power/regulator/rk8xx.c
> index cce3502f89c..bd5a37e718f 100644
> --- a/drivers/power/regulator/rk8xx.c
> +++ b/drivers/power/regulator/rk8xx.c
> @@ -1134,14 +1134,14 @@ static int buck_get_enable(struct udevice *dev)
> return _buck_get_enable(dev->parent, buck);
> }
>
> -static int _ldo_get_value(struct udevice *dev, const struct rk8xx_reg_info *info)
> +static int _ldo_get_value(struct udevice *pmic, const struct rk8xx_reg_info *info)
> {
> int mask = info->vsel_mask;
> int ret, val;
>
> if (info->vsel_reg == NA)
> return -ENOSYS;
> - ret = pmic_reg_read(dev->parent, info->vsel_reg);
> + ret = pmic_reg_read(pmic, info->vsel_reg);
> if (ret < 0)
> return ret;
> val = ret & mask;
> @@ -1154,7 +1154,7 @@ static int ldo_get_value(struct udevice *dev)
> int ldo = dev->driver_data - 1;
> const struct rk8xx_reg_info *info = get_ldo_reg(dev->parent, ldo, 0);
>
> - return _ldo_get_value(dev, info);
> + return _ldo_get_value(dev->parent, info);
> }
>
> static int nldo_get_value(struct udevice *dev)
> @@ -1162,7 +1162,7 @@ static int nldo_get_value(struct udevice *dev)
> int nldo = dev->driver_data - 1;
> const struct rk8xx_reg_info *info = get_nldo_reg(dev->parent, nldo, 0);
>
> - return _ldo_get_value(dev, info);
> + return _ldo_get_value(dev->parent, info);
> }
>
> static int pldo_get_value(struct udevice *dev)
> @@ -1170,10 +1170,10 @@ static int pldo_get_value(struct udevice *dev)
> int pldo = dev->driver_data - 1;
> const struct rk8xx_reg_info *info = get_pldo_reg(dev->parent, pldo, 0);
>
> - return _ldo_get_value(dev, info);
> + return _ldo_get_value(dev->parent, info);
> }
>
> -static int _ldo_set_value(struct udevice *dev, const struct rk8xx_reg_info *info, int uvolt)
> +static int _ldo_set_value(struct udevice *pmic, const struct rk8xx_reg_info *info, int uvolt)
> {
> int mask = info->vsel_mask;
> int val;
> @@ -1189,7 +1189,7 @@ static int _ldo_set_value(struct udevice *dev, const struct rk8xx_reg_info *info
> debug("%s: volt=%d, reg=0x%x, mask=0x%x, val=0x%x\n",
> __func__, uvolt, info->vsel_reg, mask, val);
>
> - return pmic_clrsetbits(dev->parent, info->vsel_reg, mask, val);
> + return pmic_clrsetbits(pmic, info->vsel_reg, mask, val);
> }
>
> static int ldo_set_value(struct udevice *dev, int uvolt)
> @@ -1197,7 +1197,7 @@ static int ldo_set_value(struct udevice *dev, int uvolt)
> int ldo = dev->driver_data - 1;
> const struct rk8xx_reg_info *info = get_ldo_reg(dev->parent, ldo, uvolt);
>
> - return _ldo_set_value(dev, info, uvolt);
> + return _ldo_set_value(dev->parent, info, uvolt);
> }
>
> static int nldo_set_value(struct udevice *dev, int uvolt)
> @@ -1205,7 +1205,7 @@ static int nldo_set_value(struct udevice *dev, int uvolt)
> int nldo = dev->driver_data - 1;
> const struct rk8xx_reg_info *info = get_nldo_reg(dev->parent, nldo, uvolt);
>
> - return _ldo_set_value(dev, info, uvolt);
> + return _ldo_set_value(dev->parent, info, uvolt);
> }
>
> static int pldo_set_value(struct udevice *dev, int uvolt)
> @@ -1213,7 +1213,7 @@ static int pldo_set_value(struct udevice *dev, int uvolt)
> int pldo = dev->driver_data - 1;
> const struct rk8xx_reg_info *info = get_pldo_reg(dev->parent, pldo, uvolt);
>
> - return _ldo_set_value(dev, info, uvolt);
> + return _ldo_set_value(dev->parent, info, uvolt);
> }
>
> static int _ldo_set_suspend_value(struct udevice *pmic, const struct rk8xx_reg_info *info, int uvolt)
>
next prev parent reply other threads:[~2024-06-06 6:46 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-05 9:33 [PATCH 0/3] rockchip: rk8xx: fix broken [np]ldo callbacks Quentin Schulz
2024-06-05 9:33 ` [PATCH 1/3] regulator: rk8xx: fix incorrect device used for _ldo_[sg]et_suspend_value Quentin Schulz
2024-06-06 6:45 ` Kever Yang
2024-06-06 15:04 ` Simon Glass
2024-06-05 9:33 ` [PATCH 2/3] regulator: rk8xx: pass pmic udevice instead of regulator to all internal functions Quentin Schulz
2024-06-06 6:45 ` Kever Yang [this message]
2024-06-06 15:04 ` Simon Glass
2024-06-05 9:33 ` [PATCH 3/3] regulator: rk8xx: clarify operator precedence Quentin Schulz
2024-06-05 11:20 ` Mattijs Korpershoek
2024-06-06 6:46 ` Kever Yang
2024-06-06 15:04 ` Simon Glass
2024-06-05 13:11 ` [PATCH 0/3] rockchip: rk8xx: fix broken [np]ldo callbacks Anand Moon
2024-06-05 16:00 ` Quentin Schulz
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=770db746-e154-4890-ba2a-3b17bfcfcbbf@rock-chips.com \
--to=kever.yang@rock-chips.com \
--cc=foss+uboot@0leil.net \
--cc=jh80.chung@samsung.com \
--cc=quentin.schulz@cherry.de \
--cc=sjg@chromium.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/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