public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "cy_huang(黃啟原)" <cy_huang@richtek.com>
To: "axel.lin@ingics.com" <axel.lin@ingics.com>,
	"broonie@kernel.org" <broonie@kernel.org>
Cc: "lgirdwood@gmail.com" <lgirdwood@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"u0084500@gmail.com" <u0084500@gmail.com>
Subject: Re: [PATCH] regulator: rt6160: Fix setting suspend voltage
Date: Wed, 16 Jun 2021 02:06:22 +0000	[thread overview]
Message-ID: <1623809182.3584.5.camel@richtek.com> (raw)
In-Reply-To: <20210616011816.3479406-1-axel.lin@ingics.com>

> The vsel active level is for the normal voltage, the opposite level is
> the suspend voltage.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
> Hi ChiYuan,
> I think fix it this way make the intention more clear.
>
>  drivers/regulator/rt6160-regulator.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
Thx. It's more intuitive.

Reviewed-by: ChiYuan Huang <cy_huang@richtek.com>

> diff --git a/drivers/regulator/rt6160-regulator.c b/drivers/regulator/rt6160-
> regulator.c
> index ccd023da4318..5d7b0e7ad69a 100644
> --- a/drivers/regulator/rt6160-regulator.c
> +++ b/drivers/regulator/rt6160-regulator.c
> @@ -128,13 +128,19 @@ static unsigned int rt6160_get_mode(struct regulator_dev
> *rdev)
>  static int rt6160_set_suspend_voltage(struct regulator_dev *rdev, int uV)
>  {
>  struct regmap *regmap = rdev_get_regmap(rdev);
> +unsigned int suspend_vsel_reg;
>  int vsel;
>
>  vsel = regulator_map_voltage_linear(rdev, uV, uV);
>  if (vsel < 0)
>  return vsel;
>
> -return regmap_update_bits(regmap, rdev->desc->vsel_reg,
> +if (rdev->desc->vsel_reg == RT6160_REG_VSELL)
> +suspend_vsel_reg = RT6160_REG_VSELH;
> +else
> +suspend_vsel_reg = RT6160_REG_VSELL;
> +
> +return regmap_update_bits(regmap, suspend_vsel_reg,
>    RT6160_VSEL_MASK, vsel);
>  }
>
************* Email Confidentiality Notice ********************

The information contained in this e-mail message (including any attachments) may be confidential, proprietary, privileged, or otherwise exempt from disclosure under applicable laws. It is intended to be conveyed only to the designated recipient(s). Any use, dissemination, distribution, printing, retaining or copying of this e-mail (including its attachments) by unintended recipient(s) is strictly prohibited and may be unlawful. If you are not an intended recipient of this e-mail, or believe that you have received this e-mail in error, please notify the sender immediately (by replying to this e-mail), delete any and all copies of this e-mail (including any attachments) from your system, and do not disclose the content of this e-mail to any other person. Thank you!

  reply	other threads:[~2021-06-16  2:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-16  1:18 [PATCH] regulator: rt6160: Fix setting suspend voltage Axel Lin
2021-06-16  2:06 ` cy_huang(黃啟原) [this message]
2021-06-16 16:41 ` Mark Brown

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=1623809182.3584.5.camel@richtek.com \
    --to=cy_huang@richtek.com \
    --cc=axel.lin@ingics.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=u0084500@gmail.com \
    /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