aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorFabrice Gasnier <fabrice.gasnier@st.com>2017-05-02 08:33:45 -0400
committerJonathan Cameron <jic23@kernel.org>2017-05-07 11:08:10 -0400
commit6fb34812c2a2a4cdcdad4452b9634892812fa97b (patch)
tree84579f1e9633faceb5db8b5404ac55e97f9a101c /include/linux
parentf80ac400ee762bba3a420a4a537ce6ae7854b657 (diff)
iio: stm32 trigger: Add support for TRGO2 triggers
Add support for TRGO2 trigger that can be found on STM32F7. Add additional master modes supported by TRGO2. Register additional "tim[1/8]_trgo2" triggers for timer1 & timer8. Detect TRGO2 timer capability (master mode selection 2). Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com> Acked-by: Benjamin Gaignard <benjamin.gaignard@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/iio/timer/stm32-timer-trigger.h2
-rw-r--r--include/linux/mfd/stm32-timers.h2
2 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/iio/timer/stm32-timer-trigger.h b/include/linux/iio/timer/stm32-timer-trigger.h
index 55535aef2e6c..fa7d786ed99e 100644
--- a/include/linux/iio/timer/stm32-timer-trigger.h
+++ b/include/linux/iio/timer/stm32-timer-trigger.h
@@ -10,6 +10,7 @@
10#define _STM32_TIMER_TRIGGER_H_ 10#define _STM32_TIMER_TRIGGER_H_
11 11
12#define TIM1_TRGO "tim1_trgo" 12#define TIM1_TRGO "tim1_trgo"
13#define TIM1_TRGO2 "tim1_trgo2"
13#define TIM1_CH1 "tim1_ch1" 14#define TIM1_CH1 "tim1_ch1"
14#define TIM1_CH2 "tim1_ch2" 15#define TIM1_CH2 "tim1_ch2"
15#define TIM1_CH3 "tim1_ch3" 16#define TIM1_CH3 "tim1_ch3"
@@ -44,6 +45,7 @@
44#define TIM7_TRGO "tim7_trgo" 45#define TIM7_TRGO "tim7_trgo"
45 46
46#define TIM8_TRGO "tim8_trgo" 47#define TIM8_TRGO "tim8_trgo"
48#define TIM8_TRGO2 "tim8_trgo2"
47#define TIM8_CH1 "tim8_ch1" 49#define TIM8_CH1 "tim8_ch1"
48#define TIM8_CH2 "tim8_ch2" 50#define TIM8_CH2 "tim8_ch2"
49#define TIM8_CH3 "tim8_ch3" 51#define TIM8_CH3 "tim8_ch3"
diff --git a/include/linux/mfd/stm32-timers.h b/include/linux/mfd/stm32-timers.h
index 4a0abbc10ef6..ce7346e7f77a 100644
--- a/include/linux/mfd/stm32-timers.h
+++ b/include/linux/mfd/stm32-timers.h
@@ -34,6 +34,7 @@
34#define TIM_CR1_DIR BIT(4) /* Counter Direction */ 34#define TIM_CR1_DIR BIT(4) /* Counter Direction */
35#define TIM_CR1_ARPE BIT(7) /* Auto-reload Preload Ena */ 35#define TIM_CR1_ARPE BIT(7) /* Auto-reload Preload Ena */
36#define TIM_CR2_MMS (BIT(4) | BIT(5) | BIT(6)) /* Master mode selection */ 36#define TIM_CR2_MMS (BIT(4) | BIT(5) | BIT(6)) /* Master mode selection */
37#define TIM_CR2_MMS2 GENMASK(23, 20) /* Master mode selection 2 */
37#define TIM_SMCR_SMS (BIT(0) | BIT(1) | BIT(2)) /* Slave mode selection */ 38#define TIM_SMCR_SMS (BIT(0) | BIT(1) | BIT(2)) /* Slave mode selection */
38#define TIM_SMCR_TS (BIT(4) | BIT(5) | BIT(6)) /* Trigger selection */ 39#define TIM_SMCR_TS (BIT(4) | BIT(5) | BIT(6)) /* Trigger selection */
39#define TIM_DIER_UIE BIT(0) /* Update interrupt */ 40#define TIM_DIER_UIE BIT(0) /* Update interrupt */
@@ -60,6 +61,7 @@
60 61
61#define MAX_TIM_PSC 0xFFFF 62#define MAX_TIM_PSC 0xFFFF
62#define TIM_CR2_MMS_SHIFT 4 63#define TIM_CR2_MMS_SHIFT 4
64#define TIM_CR2_MMS2_SHIFT 20
63#define TIM_SMCR_TS_SHIFT 4 65#define TIM_SMCR_TS_SHIFT 4
64#define TIM_BDTR_BKF_MASK 0xF 66#define TIM_BDTR_BKF_MASK 0xF
65#define TIM_BDTR_BKF_SHIFT 16 67#define TIM_BDTR_BKF_SHIFT 16