All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regulator: rt6160: Fix setting suspend voltage
@ 2021-06-16  1:18 Axel Lin
  2021-06-16  2:06 ` cy_huang(黃啟原)
  2021-06-16 16:41 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2021-06-16  1:18 UTC (permalink / raw)
  To: Mark Brown; +Cc: ChiYuan Huang, Liam Girdwood, linux-kernel, Axel Lin

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(-)

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);
 }
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] regulator: rt6160: Fix setting suspend voltage
  2021-06-16  1:18 [PATCH] regulator: rt6160: Fix setting suspend voltage Axel Lin
@ 2021-06-16  2:06 ` cy_huang(黃啟原)
  2021-06-16 16:41 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: cy_huang(黃啟原) @ 2021-06-16  2:06 UTC (permalink / raw)
  To: axel.lin, broonie; +Cc: lgirdwood, linux-kernel, u0084500

> 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!

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] regulator: rt6160: Fix setting suspend voltage
  2021-06-16  1:18 [PATCH] regulator: rt6160: Fix setting suspend voltage Axel Lin
  2021-06-16  2:06 ` cy_huang(黃啟原)
@ 2021-06-16 16:41 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2021-06-16 16:41 UTC (permalink / raw)
  To: Axel Lin; +Cc: Mark Brown, ChiYuan Huang, Liam Girdwood, linux-kernel

On Wed, 16 Jun 2021 09:18:16 +0800, Axel Lin wrote:
> The vsel active level is for the normal voltage, the opposite level is
> the suspend voltage.

Applied to

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

Thanks!

[1/1] regulator: rt6160: Fix setting suspend voltage
      commit: 512d895664a318d57de0ca3655d2bf1c280767a0

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-16 16:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-16  1:18 [PATCH] regulator: rt6160: Fix setting suspend voltage Axel Lin
2021-06-16  2:06 ` cy_huang(黃啟原)
2021-06-16 16:41 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.