Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1569857

[PATCH v2 5/5] iio: adc: stm32: add exti gpio trigger source

From Fabrice Gasnier <fabrice.gasnier@st.com>
Newsgroups linux.kernel
Subject [PATCH v2 5/5] iio: adc: stm32: add exti gpio trigger source
Date 2017-01-30 17:00 +0100
Message-ID <t5mx3-5LI-7@gated-at.bofh.it> (permalink)
References <t5lhD-55I-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


STM32F4 ADC can use exti11 (gpio) signal as trigger source for
conversions.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
---
 drivers/iio/adc/stm32-adc.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/iio/adc/stm32-adc.c b/drivers/iio/adc/stm32-adc.c
index be0e457..0118c9c 100644
--- a/drivers/iio/adc/stm32-adc.c
+++ b/drivers/iio/adc/stm32-adc.c
@@ -26,6 +26,7 @@
 #include <linux/iio/iio.h>
 #include <linux/iio/buffer.h>
 #include <linux/iio/timer/stm32-timer-trigger.h>
+#include <linux/iio/trigger/stm32-exti-trigger.h>
 #include <linux/iio/trigger.h>
 #include <linux/iio/trigger_consumer.h>
 #include <linux/iio/triggered_buffer.h>
@@ -240,6 +241,7 @@ struct stm32_adc_chan_spec {
 	{ TIM5_CH3, STM32_EXT12 },
 	{ TIM8_CH1, STM32_EXT13 },
 	{ TIM8_TRGO, STM32_EXT14 },
+	{ STM32_EXTI(11), STM32_EXT15 },
 	{}, /* sentinel */
 };
 
@@ -409,6 +411,11 @@ static int stm32_adc_get_trig_extsel(struct iio_trigger *trig)
 		    !strcmp(stm32f4_adc_trigs[i].name, trig->name)) {
 			return stm32f4_adc_trigs[i].extsel;
 		}
+
+		if (is_stm32_exti_trigger(trig) &&
+		    !strcmp(stm32f4_adc_trigs[i].name, trig->name)) {
+			return stm32f4_adc_trigs[i].extsel;
+		}
 	}
 
 	return -EINVAL;
-- 
1.9.1

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/5] Add EXTI GPIO trigger support to STM32 ADC Fabrice Gasnier <fabrice.gasnier@st.com> - 2017-01-30 15:40 +0100
  [PATCH v2 2/5] iio: adc: stm32: add dt option to set default trigger polarity Fabrice Gasnier <fabrice.gasnier@st.com> - 2017-01-30 15:40 +0100
  [PATCH v2 3/5] Documentation: dt: iio: document stm32 exti trigger Fabrice Gasnier <fabrice.gasnier@st.com> - 2017-01-30 15:40 +0100
  [PATCH v2 1/5] Documentation: dt: iio: document stm32 adc trigger polarity Fabrice Gasnier <fabrice.gasnier@st.com> - 2017-01-30 15:40 +0100
    Re: [PATCH v2 1/5] Documentation: dt: iio: document stm32 adc trigger  polarity Jonathan Cameron <jic23@kernel.org> - 2017-02-05 11:00 +0100
  [PATCH v2 5/5] iio: adc: stm32: add exti gpio trigger source Fabrice Gasnier <fabrice.gasnier@st.com> - 2017-01-30 17:00 +0100

csiph-web