Skip to content

Commit ace2cd1

Browse files
Fabrice GasnierWilliam Breathitt Gray
authored andcommitted
counter: stm32-timer-cnt: add support for stm32mp25
Add support for STM32MP25 SoC. There are new counter modes that may be implemented in later. Still, use newly introduced compatible to handle this new HW variant and avoid being blocked with existing compatible in SoC dtsi file. Modes supported currently still remains compatible. New timer 20 has encoder capability, add it to the list. Signed-off-by: Fabrice Gasnier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: William Breathitt Gray <[email protected]>
1 parent 08e2a66 commit ace2cd1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/counter/stm32-timer-cnt.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -669,12 +669,14 @@ static void stm32_timer_cnt_detect_channels(struct device *dev,
669669
dev_dbg(dev, "has %d cc channels\n", priv->nchannels);
670670
}
671671

672-
/* encoder supported on TIM1 TIM2 TIM3 TIM4 TIM5 TIM8 */
673-
#define STM32_TIM_ENCODER_SUPPORTED (BIT(0) | BIT(1) | BIT(2) | BIT(3) | BIT(4) | BIT(7))
672+
/* encoder supported on TIM1 TIM2 TIM3 TIM4 TIM5 TIM8 TIM20 */
673+
#define STM32_TIM_ENCODER_SUPPORTED (BIT(0) | BIT(1) | BIT(2) | BIT(3) | BIT(4) | BIT(7) | \
674+
BIT(19))
674675

675676
static const char * const stm32_timer_trigger_compat[] = {
676677
"st,stm32-timer-trigger",
677678
"st,stm32h7-timer-trigger",
679+
"st,stm32mp25-timer-trigger",
678680
};
679681

680682
static int stm32_timer_cnt_probe_encoder(struct device *dev,
@@ -846,6 +848,7 @@ static SIMPLE_DEV_PM_OPS(stm32_timer_cnt_pm_ops, stm32_timer_cnt_suspend,
846848

847849
static const struct of_device_id stm32_timer_cnt_of_match[] = {
848850
{ .compatible = "st,stm32-timer-counter", },
851+
{ .compatible = "st,stm32mp25-timer-counter", },
849852
{},
850853
};
851854
MODULE_DEVICE_TABLE(of, stm32_timer_cnt_of_match);

0 commit comments

Comments
 (0)