linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] regulator: bd9571mwv: Miscellaneous fixes and improvements
@ 2021-03-12 13:02 Geert Uytterhoeven
  2021-03-12 13:02 ` [PATCH 1/3] regulator: bd9571mwv: Fix AVS and DVFS voltage range Geert Uytterhoeven
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2021-03-12 13:02 UTC (permalink / raw)
  To: Marek Vasut, Liam Girdwood, Mark Brown
  Cc: Yoshihiro Shimoda, Matti Vaittinen, linux-kernel,
	linux-renesas-soc, Geert Uytterhoeven

*** BLURB HERE ***

Geert Uytterhoeven (3):
  regulator: bd9571mwv: Fix AVS and DVFS voltage range
  regulator: bd9571mwv: Fix regulator name printed on registration
    failure
  regulator: bd9571mwv: Convert device attribute to sysfs_emit()

 drivers/regulator/bd9571mwv-regulator.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

-- 
2.25.1

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

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

* [PATCH 1/3] regulator: bd9571mwv: Fix AVS and DVFS voltage range
  2021-03-12 13:02 [PATCH 0/3] regulator: bd9571mwv: Miscellaneous fixes and improvements Geert Uytterhoeven
@ 2021-03-12 13:02 ` Geert Uytterhoeven
  2021-03-12 13:02 ` [PATCH 2/3] regulator: bd9571mwv: Fix regulator name printed on registration failure Geert Uytterhoeven
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2021-03-12 13:02 UTC (permalink / raw)
  To: Marek Vasut, Liam Girdwood, Mark Brown
  Cc: Yoshihiro Shimoda, Matti Vaittinen, linux-kernel,
	linux-renesas-soc, Geert Uytterhoeven

According to Table 30 ("DVFS_MoniVDAC [6:0] Setting Table") in the
BD9571MWV-M Datasheet Rev. 002, the valid voltage range is 600..1100 mV
(settings 0x3c..0x6e).  While the lower limit is taken into account (by
setting regulator_desc.linear_min_sel to 0x3c), the upper limit is not.

Fix this by reducing regulator_desc.n_voltages from 0x80 to 0x6f.

Fixes: e85c5a153fe237f2 ("regulator: Add ROHM BD9571MWV-M PMIC regulator driver")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/regulator/bd9571mwv-regulator.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/bd9571mwv-regulator.c b/drivers/regulator/bd9571mwv-regulator.c
index 7b0cd08db4462395..13393cdc6be1497e 100644
--- a/drivers/regulator/bd9571mwv-regulator.c
+++ b/drivers/regulator/bd9571mwv-regulator.c
@@ -125,7 +125,7 @@ static const struct regulator_ops vid_ops = {
 
 static const struct regulator_desc regulators[] = {
 	BD9571MWV_REG("VD09", "vd09", VD09, avs_ops, 0, 0x7f,
-		      0x80, 600000, 10000, 0x3c),
+		      0x6f, 600000, 10000, 0x3c),
 	BD9571MWV_REG("VD18", "vd18", VD18, vid_ops, BD9571MWV_VD18_VID, 0xf,
 		      16, 1625000, 25000, 0),
 	BD9571MWV_REG("VD25", "vd25", VD25, vid_ops, BD9571MWV_VD25_VID, 0xf,
@@ -134,7 +134,7 @@ static const struct regulator_desc regulators[] = {
 		      11, 2800000, 100000, 0),
 	BD9571MWV_REG("DVFS", "dvfs", DVFS, reg_ops,
 		      BD9571MWV_DVFS_MONIVDAC, 0x7f,
-		      0x80, 600000, 10000, 0x3c),
+		      0x6f, 600000, 10000, 0x3c),
 };
 
 #ifdef CONFIG_PM_SLEEP
-- 
2.25.1


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

* [PATCH 2/3] regulator: bd9571mwv: Fix regulator name printed on registration failure
  2021-03-12 13:02 [PATCH 0/3] regulator: bd9571mwv: Miscellaneous fixes and improvements Geert Uytterhoeven
  2021-03-12 13:02 ` [PATCH 1/3] regulator: bd9571mwv: Fix AVS and DVFS voltage range Geert Uytterhoeven
@ 2021-03-12 13:02 ` Geert Uytterhoeven
  2021-03-15  5:49   ` Matti Vaittinen
  2021-03-12 13:02 ` [PATCH 3/3] regulator: bd9571mwv: Convert device attribute to sysfs_emit() Geert Uytterhoeven
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2021-03-12 13:02 UTC (permalink / raw)
  To: Marek Vasut, Liam Girdwood, Mark Brown
  Cc: Yoshihiro Shimoda, Matti Vaittinen, linux-kernel,
	linux-renesas-soc, Geert Uytterhoeven

If a regulator fails to register, the driver prints an error message
like:

    bd9571mwv-regulator bd9571mwv-regulator.6.auto: failed to register bd9571mwv-regulator regulator

However, the platform device's name is already printed as part of
dev_err(), and does not allow the user to distinguish among the various
regulators that are part of the PMIC.

Fix this by printing regulator_desc.name instead, to change the message
like:

    bd9571mwv-regulator bd9571mwv-regulator.6.auto: failed to register DVFS regulator

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/regulator/bd9571mwv-regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/bd9571mwv-regulator.c b/drivers/regulator/bd9571mwv-regulator.c
index 13393cdc6be1497e..a4d406022587d59d 100644
--- a/drivers/regulator/bd9571mwv-regulator.c
+++ b/drivers/regulator/bd9571mwv-regulator.c
@@ -301,7 +301,7 @@ static int bd9571mwv_regulator_probe(struct platform_device *pdev)
 					       &config);
 		if (IS_ERR(rdev)) {
 			dev_err(&pdev->dev, "failed to register %s regulator\n",
-				pdev->name);
+				regulators[i].name);
 			return PTR_ERR(rdev);
 		}
 	}
-- 
2.25.1


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

* [PATCH 3/3] regulator: bd9571mwv: Convert device attribute to sysfs_emit()
  2021-03-12 13:02 [PATCH 0/3] regulator: bd9571mwv: Miscellaneous fixes and improvements Geert Uytterhoeven
  2021-03-12 13:02 ` [PATCH 1/3] regulator: bd9571mwv: Fix AVS and DVFS voltage range Geert Uytterhoeven
  2021-03-12 13:02 ` [PATCH 2/3] regulator: bd9571mwv: Fix regulator name printed on registration failure Geert Uytterhoeven
@ 2021-03-12 13:02 ` Geert Uytterhoeven
  2021-03-12 13:07 ` [PATCH 0/3] regulator: bd9571mwv: Miscellaneous fixes and improvements Geert Uytterhoeven
  2021-03-15 16:57 ` Mark Brown
  4 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2021-03-12 13:02 UTC (permalink / raw)
  To: Marek Vasut, Liam Girdwood, Mark Brown
  Cc: Yoshihiro Shimoda, Matti Vaittinen, linux-kernel,
	linux-renesas-soc, Geert Uytterhoeven

Convert the "backup_mode" device attribute from sprintf() to
sysfs_emit(), as the latter is aware of the PAGE_SIZE buffer.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/regulator/bd9571mwv-regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/bd9571mwv-regulator.c b/drivers/regulator/bd9571mwv-regulator.c
index a4d406022587d59d..ba020a45f238e764 100644
--- a/drivers/regulator/bd9571mwv-regulator.c
+++ b/drivers/regulator/bd9571mwv-regulator.c
@@ -174,7 +174,7 @@ static ssize_t backup_mode_show(struct device *dev,
 {
 	struct bd9571mwv_reg *bdreg = dev_get_drvdata(dev);
 
-	return sprintf(buf, "%s\n", bdreg->bkup_mode_enabled ? "on" : "off");
+	return sysfs_emit(buf, "%s\n", bdreg->bkup_mode_enabled ? "on" : "off");
 }
 
 static ssize_t backup_mode_store(struct device *dev,
-- 
2.25.1


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

* Re: [PATCH 0/3] regulator: bd9571mwv: Miscellaneous fixes and improvements
  2021-03-12 13:02 [PATCH 0/3] regulator: bd9571mwv: Miscellaneous fixes and improvements Geert Uytterhoeven
                   ` (2 preceding siblings ...)
  2021-03-12 13:02 ` [PATCH 3/3] regulator: bd9571mwv: Convert device attribute to sysfs_emit() Geert Uytterhoeven
@ 2021-03-12 13:07 ` Geert Uytterhoeven
  2021-03-15 16:57 ` Mark Brown
  4 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2021-03-12 13:07 UTC (permalink / raw)
  To: Marek Vasut, Liam Girdwood, Mark Brown
  Cc: Yoshihiro Shimoda, Matti Vaittinen, Linux Kernel Mailing List,
	Linux-Renesas, Geert Uytterhoeven

Hi Marek, Liam, Mark,

On Fri, Mar 12, 2021 at 2:02 PM Geert Uytterhoeven
<geert+renesas@glider.be> wrote:
> *** BLURB HERE ***

Woops, that was a bit too early, sorry for that.
But there was not much to say anyway, just a few miscellaneous fixes
and improvements.

Thanks for your comments!

> Geert Uytterhoeven (3):
>   regulator: bd9571mwv: Fix AVS and DVFS voltage range
>   regulator: bd9571mwv: Fix regulator name printed on registration
>     failure
>   regulator: bd9571mwv: Convert device attribute to sysfs_emit()
>
>  drivers/regulator/bd9571mwv-regulator.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH 2/3] regulator: bd9571mwv: Fix regulator name printed on registration failure
  2021-03-12 13:02 ` [PATCH 2/3] regulator: bd9571mwv: Fix regulator name printed on registration failure Geert Uytterhoeven
@ 2021-03-15  5:49   ` Matti Vaittinen
  0 siblings, 0 replies; 7+ messages in thread
From: Matti Vaittinen @ 2021-03-15  5:49 UTC (permalink / raw)
  To: Geert Uytterhoeven, Marek Vasut, Liam Girdwood, Mark Brown
  Cc: Yoshihiro Shimoda, linux-kernel, linux-renesas-soc


On Fri, 2021-03-12 at 14:02 +0100, Geert Uytterhoeven wrote:
> If a regulator fails to register, the driver prints an error message
> like:
> 
>     bd9571mwv-regulator bd9571mwv-regulator.6.auto: failed to
> register bd9571mwv-regulator regulator
> 
> However, the platform device's name is already printed as part of
> dev_err(), and does not allow the user to distinguish among the
> various
> regulators that are part of the PMIC.
> 
> Fix this by printing regulator_desc.name instead, to change the
> message
> like:
> 
>     bd9571mwv-regulator bd9571mwv-regulator.6.auto: failed to
> register DVFS regulator
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Reviewed-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>



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

* Re: [PATCH 0/3] regulator: bd9571mwv: Miscellaneous fixes and improvements
  2021-03-12 13:02 [PATCH 0/3] regulator: bd9571mwv: Miscellaneous fixes and improvements Geert Uytterhoeven
                   ` (3 preceding siblings ...)
  2021-03-12 13:07 ` [PATCH 0/3] regulator: bd9571mwv: Miscellaneous fixes and improvements Geert Uytterhoeven
@ 2021-03-15 16:57 ` Mark Brown
  4 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2021-03-15 16:57 UTC (permalink / raw)
  To: Geert Uytterhoeven, Marek Vasut, Liam Girdwood
  Cc: Mark Brown, linux-renesas-soc, Yoshihiro Shimoda,
	Matti Vaittinen, linux-kernel

On Fri, 12 Mar 2021 14:02:39 +0100, Geert Uytterhoeven wrote:
> *** BLURB HERE ***
> 
> Geert Uytterhoeven (3):
>   regulator: bd9571mwv: Fix AVS and DVFS voltage range
>   regulator: bd9571mwv: Fix regulator name printed on registration
>     failure
>   regulator: bd9571mwv: Convert device attribute to sysfs_emit()
> 
> [...]

Applied to

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

Thanks!

[1/3] regulator: bd9571mwv: Fix AVS and DVFS voltage range
      commit: 3b6e7088afc919f5b52e4d2de8501ad34d35b09b
[2/3] regulator: bd9571mwv: Fix regulator name printed on registration failure
      commit: 9cbc23f7d51fb0b1363bdfdd0b770aa7b5982f2f
[3/3] regulator: bd9571mwv: Convert device attribute to sysfs_emit()
      commit: 1deceabbdc0dd3162def1e26acb2e57a93275909

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] 7+ messages in thread

end of thread, other threads:[~2021-03-15 16:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-12 13:02 [PATCH 0/3] regulator: bd9571mwv: Miscellaneous fixes and improvements Geert Uytterhoeven
2021-03-12 13:02 ` [PATCH 1/3] regulator: bd9571mwv: Fix AVS and DVFS voltage range Geert Uytterhoeven
2021-03-12 13:02 ` [PATCH 2/3] regulator: bd9571mwv: Fix regulator name printed on registration failure Geert Uytterhoeven
2021-03-15  5:49   ` Matti Vaittinen
2021-03-12 13:02 ` [PATCH 3/3] regulator: bd9571mwv: Convert device attribute to sysfs_emit() Geert Uytterhoeven
2021-03-12 13:07 ` [PATCH 0/3] regulator: bd9571mwv: Miscellaneous fixes and improvements Geert Uytterhoeven
2021-03-15 16:57 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).