2019-07-01 08:29:02

by Fabrice Gasnier

[permalink] [raw]
Subject: [PATCH v2 0/4] regulator: add support for the STM32 ADC booster

Add support for the 3.3V booster regulator embedded in stm32h7 and stm32mp1
devices, that can be used to supply ADC analog input switches.
It's useful to reach full ADC performance when their supply is below 2.7V
(vdda by default).

Changes in v2:
- rebase on top of for-next branch

Fabrice Gasnier (4):
dt-bindings: regulator: add support for the stm32-booster
regulator: add support for the stm32-booster
ARM: multi_v7_defconfig: enable STM32 booster regulator
ARM: dts: stm32: add booster for ADC analog switches on stm32mp157c

.../bindings/regulator/st,stm32-booster.txt | 18 +++
arch/arm/boot/dts/stm32mp157c.dtsi | 6 +
arch/arm/configs/multi_v7_defconfig | 1 +
drivers/regulator/Kconfig | 11 ++
drivers/regulator/Makefile | 1 +
drivers/regulator/stm32-booster.c | 132 +++++++++++++++++++++
6 files changed, 169 insertions(+)
create mode 100644 Documentation/devicetree/bindings/regulator/st,stm32-booster.txt
create mode 100644 drivers/regulator/stm32-booster.c

--
2.7.4


2019-07-01 08:29:39

by Fabrice Gasnier

[permalink] [raw]
Subject: [PATCH v2 1/4] dt-bindings: regulator: add support for the stm32-booster

Document the 3.3V booster regulator embedded in stm32h7 and stm32mp1
devices, that can be used to supply ADC analog input switches.
It's controlled by using system configuration registers (SYSCFG).
Introduce two compatibles as the booster regulator is controlled by:
- a unique register/bit in STM32H7
- a set/clear register pair in STM32MP1

Signed-off-by: Fabrice Gasnier <[email protected]>
---
.../devicetree/bindings/regulator/st,stm32-booster.txt | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
create mode 100644 Documentation/devicetree/bindings/regulator/st,stm32-booster.txt

diff --git a/Documentation/devicetree/bindings/regulator/st,stm32-booster.txt b/Documentation/devicetree/bindings/regulator/st,stm32-booster.txt
new file mode 100644
index 0000000..479ad4c
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/st,stm32-booster.txt
@@ -0,0 +1,18 @@
+STM32 BOOSTER - Booster for ADC analog input switches
+
+Some STM32 devices embed a 3.3V booster supplied by Vdda, that can be used
+to supply ADC analog input switches.
+
+Required properties:
+- compatible: Should be one of:
+ "st,stm32h7-booster"
+ "st,stm32mp1-booster"
+- st,syscfg: Phandle to system configuration controller.
+- vdda-supply: Phandle to the vdda input analog voltage.
+
+Example:
+ booster: regulator-booster {
+ compatible = "st,stm32mp1-booster";
+ st,syscfg = <&syscfg>;
+ vdda-supply = <&vdda>;
+ };
--
2.7.4

2019-07-01 08:29:45

by Fabrice Gasnier

[permalink] [raw]
Subject: [PATCH v2 3/4] ARM: multi_v7_defconfig: enable STM32 booster regulator

This enables the driver for STM32 booster regulator found on stm32mp1.

Signed-off-by: Fabrice Gasnier <[email protected]>
---
arch/arm/configs/multi_v7_defconfig | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig
index 6b748f2..230e7e0 100644
--- a/arch/arm/configs/multi_v7_defconfig
+++ b/arch/arm/configs/multi_v7_defconfig
@@ -568,6 +568,7 @@ CONFIG_REGULATOR_RK808=y
CONFIG_REGULATOR_RN5T618=y
CONFIG_REGULATOR_S2MPS11=y
CONFIG_REGULATOR_S5M8767=y
+CONFIG_REGULATOR_STM32_BOOSTER=m
CONFIG_REGULATOR_STM32_VREFBUF=m
CONFIG_REGULATOR_STPMIC1=y
CONFIG_REGULATOR_TI_ABB=y
--
2.7.4

2019-07-01 08:29:47

by Fabrice Gasnier

[permalink] [raw]
Subject: [PATCH v2 4/4] ARM: dts: stm32: add booster for ADC analog switches on stm32mp157c

Booster for ADC analog input switches can be used when Vdda is below 2.7V
to get maximum ADC analog performances.
Add booster for ADC analog switches on stm32mp157c.

Signed-off-by: Fabrice Gasnier <[email protected]>
---
arch/arm/boot/dts/stm32mp157c.dtsi | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/arch/arm/boot/dts/stm32mp157c.dtsi b/arch/arm/boot/dts/stm32mp157c.dtsi
index 2afeee6..2dd5162 100644
--- a/arch/arm/boot/dts/stm32mp157c.dtsi
+++ b/arch/arm/boot/dts/stm32mp157c.dtsi
@@ -109,6 +109,12 @@
};
};

+ booster: regulator-booster {
+ compatible = "st,stm32mp1-booster";
+ st,syscfg = <&syscfg>;
+ status = "disabled";
+ };
+
soc {
compatible = "simple-bus";
#address-cells = <1>;
--
2.7.4

2019-07-02 13:06:50

by Mark Brown

[permalink] [raw]
Subject: Applied "dt-bindings: regulator: add support for the stm32-booster" to the regulator tree

The patch

dt-bindings: regulator: add support for the stm32-booster

has been applied to the regulator tree at

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

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

From d6d02bc6e80453ca004e101eae28d741bde54426 Mon Sep 17 00:00:00 2001
From: Fabrice Gasnier <[email protected]>
Date: Mon, 1 Jul 2019 10:14:22 +0200
Subject: [PATCH] dt-bindings: regulator: add support for the stm32-booster

Document the 3.3V booster regulator embedded in stm32h7 and stm32mp1
devices, that can be used to supply ADC analog input switches.
It's controlled by using system configuration registers (SYSCFG).
Introduce two compatibles as the booster regulator is controlled by:
- a unique register/bit in STM32H7
- a set/clear register pair in STM32MP1

Signed-off-by: Fabrice Gasnier <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
---
.../bindings/regulator/st,stm32-booster.txt | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
create mode 100644 Documentation/devicetree/bindings/regulator/st,stm32-booster.txt

diff --git a/Documentation/devicetree/bindings/regulator/st,stm32-booster.txt b/Documentation/devicetree/bindings/regulator/st,stm32-booster.txt
new file mode 100644
index 000000000000..479ad4c8758e
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/st,stm32-booster.txt
@@ -0,0 +1,18 @@
+STM32 BOOSTER - Booster for ADC analog input switches
+
+Some STM32 devices embed a 3.3V booster supplied by Vdda, that can be used
+to supply ADC analog input switches.
+
+Required properties:
+- compatible: Should be one of:
+ "st,stm32h7-booster"
+ "st,stm32mp1-booster"
+- st,syscfg: Phandle to system configuration controller.
+- vdda-supply: Phandle to the vdda input analog voltage.
+
+Example:
+ booster: regulator-booster {
+ compatible = "st,stm32mp1-booster";
+ st,syscfg = <&syscfg>;
+ vdda-supply = <&vdda>;
+ };
--
2.20.1

2019-07-26 19:25:41

by Alexandre Torgue

[permalink] [raw]
Subject: Re: [PATCH v2 0/4] regulator: add support for the STM32 ADC booster

Hi Fabrice

On 7/1/19 10:14 AM, Fabrice Gasnier wrote:
> Add support for the 3.3V booster regulator embedded in stm32h7 and stm32mp1
> devices, that can be used to supply ADC analog input switches.
> It's useful to reach full ADC performance when their supply is below 2.7V
> (vdda by default).
>
> Changes in v2:
> - rebase on top of for-next branch
>
> Fabrice Gasnier (4):
> dt-bindings: regulator: add support for the stm32-booster
> regulator: add support for the stm32-booster
> ARM: multi_v7_defconfig: enable STM32 booster regulator
> ARM: dts: stm32: add booster for ADC analog switches on stm32mp157c
>
> .../bindings/regulator/st,stm32-booster.txt | 18 +++
> arch/arm/boot/dts/stm32mp157c.dtsi | 6 +
> arch/arm/configs/multi_v7_defconfig | 1 +
> drivers/regulator/Kconfig | 11 ++
> drivers/regulator/Makefile | 1 +
> drivers/regulator/stm32-booster.c | 132 +++++++++++++++++++++
> 6 files changed, 169 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/regulator/st,stm32-booster.txt
> create mode 100644 drivers/regulator/stm32-booster.c
>

DT patch + config applied in stm32-next.

regards
alex