devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Add support for ADC on stm32mp157c-ed1
@ 2019-11-08 16:37 Fabrice Gasnier
  2019-11-08 16:37 ` [PATCH 1/2] ARM: dts: stm32: add ADC pins used for stm32mp157c-ed1 Fabrice Gasnier
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Fabrice Gasnier @ 2019-11-08 16:37 UTC (permalink / raw)
  To: alexandre.torgue
  Cc: robh+dt, mcoquelin.stm32, mark.rutland, linux-arm-kernel,
	devicetree, linux-kernel, linux-stm32, fabrice.gasnier

This series adds support for digital-to-analog converter on
stm32mp157c-ed1 board:
- define pins that can be used for ADC
- configure ADC channels to use these

Fabrice Gasnier (2):
  ARM: dts: stm32: add ADC pins used for stm32mp157c-ed1
  ARM: dts: stm32: add ADC support to stm32mp157c-ed1

 arch/arm/boot/dts/stm32mp157-pinctrl.dtsi |  6 ++++++
 arch/arm/boot/dts/stm32mp157c-ed1.dts     | 16 ++++++++++++++++
 2 files changed, 22 insertions(+)

-- 
2.7.4


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

* [PATCH 1/2] ARM: dts: stm32: add ADC pins used for stm32mp157c-ed1
  2019-11-08 16:37 [PATCH 0/2] Add support for ADC on stm32mp157c-ed1 Fabrice Gasnier
@ 2019-11-08 16:37 ` Fabrice Gasnier
  2019-11-08 16:37 ` [PATCH 2/2] ARM: dts: stm32: add ADC support to stm32mp157c-ed1 Fabrice Gasnier
  2019-11-15 13:10 ` [PATCH 0/2] Add support for ADC on stm32mp157c-ed1 Alexandre Torgue
  2 siblings, 0 replies; 4+ messages in thread
From: Fabrice Gasnier @ 2019-11-08 16:37 UTC (permalink / raw)
  To: alexandre.torgue
  Cc: robh+dt, mcoquelin.stm32, mark.rutland, linux-arm-kernel,
	devicetree, linux-kernel, linux-stm32, fabrice.gasnier

Define adc1_in6 pin used on stm32mp157c eval board.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
---
 arch/arm/boot/dts/stm32mp157-pinctrl.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/boot/dts/stm32mp157-pinctrl.dtsi b/arch/arm/boot/dts/stm32mp157-pinctrl.dtsi
index 1e45b75..41cb211 100644
--- a/arch/arm/boot/dts/stm32mp157-pinctrl.dtsi
+++ b/arch/arm/boot/dts/stm32mp157-pinctrl.dtsi
@@ -137,6 +137,12 @@
 				status = "disabled";
 			};
 
+			adc1_in6_pins_a: adc1-in6 {
+				pins {
+					pinmux = <STM32_PINMUX('F', 12, ANALOG)>;
+				};
+			};
+
 			adc12_ain_pins_a: adc12-ain-0 {
 				pins {
 					pinmux = <STM32_PINMUX('C', 3, ANALOG)>, /* ADC1 in13 */
-- 
2.7.4


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

* [PATCH 2/2] ARM: dts: stm32: add ADC support to stm32mp157c-ed1
  2019-11-08 16:37 [PATCH 0/2] Add support for ADC on stm32mp157c-ed1 Fabrice Gasnier
  2019-11-08 16:37 ` [PATCH 1/2] ARM: dts: stm32: add ADC pins used for stm32mp157c-ed1 Fabrice Gasnier
@ 2019-11-08 16:37 ` Fabrice Gasnier
  2019-11-15 13:10 ` [PATCH 0/2] Add support for ADC on stm32mp157c-ed1 Alexandre Torgue
  2 siblings, 0 replies; 4+ messages in thread
From: Fabrice Gasnier @ 2019-11-08 16:37 UTC (permalink / raw)
  To: alexandre.torgue
  Cc: robh+dt, mcoquelin.stm32, mark.rutland, linux-arm-kernel,
	devicetree, linux-kernel, linux-stm32, fabrice.gasnier

Add ADC support to stm32mp157c-ed1 board.
Following ADC signals are dedicated for analog and routed to connectors:
- ADC1/2 in0 (ANA0)
- ADC1/2 in1 (ANA1)
- ADC1 in6 (PF12)
Configure ADC1 with these signals. But keep it disabled by default, so
PF12 can be used as gpio by default.
Add VDD and VDDA supplies to ADC on stm32mp157c-ed1 board. This allows to
get full ADC analog performances in case VDDA is below 2.7V (not the case
by default).

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
---
 arch/arm/boot/dts/stm32mp157c-ed1.dts | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/arch/arm/boot/dts/stm32mp157c-ed1.dts b/arch/arm/boot/dts/stm32mp157c-ed1.dts
index b8cc0fb..d889813 100644
--- a/arch/arm/boot/dts/stm32mp157c-ed1.dts
+++ b/arch/arm/boot/dts/stm32mp157c-ed1.dts
@@ -89,6 +89,22 @@
 	};
 };
 
+&adc {
+	/* ANA0, ANA1 are dedicated pins and don't need pinctrl: only in6. */
+	pinctrl-0 = <&adc1_in6_pins_a>;
+	pinctrl-names = "default";
+	vdd-supply = <&vdd>;
+	vdda-supply = <&vdda>;
+	vref-supply = <&vdda>;
+	status = "disabled";
+	adc1: adc@0 {
+		st,adc-channels = <0 1 6>;
+		/* 16.5 ck_cycles sampling time */
+		st,min-sample-time-nsecs = <400>;
+		status = "okay";
+	};
+};
+
 &dac {
 	pinctrl-names = "default";
 	pinctrl-0 = <&dac_ch1_pins_a &dac_ch2_pins_a>;
-- 
2.7.4


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

* Re: [PATCH 0/2] Add support for ADC on stm32mp157c-ed1
  2019-11-08 16:37 [PATCH 0/2] Add support for ADC on stm32mp157c-ed1 Fabrice Gasnier
  2019-11-08 16:37 ` [PATCH 1/2] ARM: dts: stm32: add ADC pins used for stm32mp157c-ed1 Fabrice Gasnier
  2019-11-08 16:37 ` [PATCH 2/2] ARM: dts: stm32: add ADC support to stm32mp157c-ed1 Fabrice Gasnier
@ 2019-11-15 13:10 ` Alexandre Torgue
  2 siblings, 0 replies; 4+ messages in thread
From: Alexandre Torgue @ 2019-11-15 13:10 UTC (permalink / raw)
  To: Fabrice Gasnier
  Cc: robh+dt, mcoquelin.stm32, mark.rutland, linux-arm-kernel,
	devicetree, linux-kernel, linux-stm32

Hi Fabrice

On 11/8/19 5:37 PM, Fabrice Gasnier wrote:
> This series adds support for digital-to-analog converter on
> stm32mp157c-ed1 board:
> - define pins that can be used for ADC
> - configure ADC channels to use these
> 
> Fabrice Gasnier (2):
>    ARM: dts: stm32: add ADC pins used for stm32mp157c-ed1
>    ARM: dts: stm32: add ADC support to stm32mp157c-ed1
> 
>   arch/arm/boot/dts/stm32mp157-pinctrl.dtsi |  6 ++++++
>   arch/arm/boot/dts/stm32mp157c-ed1.dts     | 16 ++++++++++++++++
>   2 files changed, 22 insertions(+)
> 
Series applied on stm32-next.

Regards
Alex

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

end of thread, other threads:[~2019-11-15 13:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-08 16:37 [PATCH 0/2] Add support for ADC on stm32mp157c-ed1 Fabrice Gasnier
2019-11-08 16:37 ` [PATCH 1/2] ARM: dts: stm32: add ADC pins used for stm32mp157c-ed1 Fabrice Gasnier
2019-11-08 16:37 ` [PATCH 2/2] ARM: dts: stm32: add ADC support to stm32mp157c-ed1 Fabrice Gasnier
2019-11-15 13:10 ` [PATCH 0/2] Add support for ADC on stm32mp157c-ed1 Alexandre Torgue

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