Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / 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
  2019-11-08 16:37 ` [PATCH 2/2] ARM: dts: stm32: add ADC support to stm32mp157c-ed1 Fabrice Gasnier
  0 siblings, 2 replies; 3+ messages in thread
From: Fabrice Gasnier @ 2019-11-08 16:37 UTC (permalink / raw)
  To: alexandre.torgue
  Cc: mark.rutland, devicetree, linux-kernel, robh+dt, mcoquelin.stm32,
	fabrice.gasnier, linux-stm32, linux-arm-kernel

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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ 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
  1 sibling, 0 replies; 3+ messages in thread
From: Fabrice Gasnier @ 2019-11-08 16:37 UTC (permalink / raw)
  To: alexandre.torgue
  Cc: mark.rutland, devicetree, linux-kernel, robh+dt, mcoquelin.stm32,
	fabrice.gasnier, linux-stm32, linux-arm-kernel

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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ 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
  1 sibling, 0 replies; 3+ messages in thread
From: Fabrice Gasnier @ 2019-11-08 16:37 UTC (permalink / raw)
  To: alexandre.torgue
  Cc: mark.rutland, devicetree, linux-kernel, robh+dt, mcoquelin.stm32,
	fabrice.gasnier, linux-stm32, linux-arm-kernel

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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, back to index

Thread overview: 3+ 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

Linux-ARM-Kernel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-arm-kernel/0 linux-arm-kernel/git/0.git
	git clone --mirror https://lore.kernel.org/linux-arm-kernel/1 linux-arm-kernel/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-arm-kernel linux-arm-kernel/ https://lore.kernel.org/linux-arm-kernel \
		linux-arm-kernel@lists.infradead.org
	public-inbox-index linux-arm-kernel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-arm-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git