#include <asm/io.h>
#include <asm/arch/timers.h>
#include <dm/device_compat.h>
+#include <linux/bitfield.h>
#include <linux/time.h>
#define CCMR_CHANNEL_SHIFT 8
{
struct stm32_timers_plat *plat = dev_get_plat(dev_get_parent(dev));
struct stm32_pwm_priv *priv = dev_get_priv(dev);
- u32 ccer;
+ u32 ccer, val;
+
+ if (plat->ipidr) {
+ /* Simply read from HWCFGR the number of complementary outputs (MP25). */
+ val = readl(plat->base + TIM_HWCFGR1);
+ priv->have_complementary_output = !!FIELD_GET(TIM_HWCFGR1_NB_OF_DT, val);
+ return;
+ }
/*
* If complementary bit doesn't exist writing 1 will have no
static const struct udevice_id stm32_pwm_ids[] = {
{ .compatible = "st,stm32-pwm" },
+ { .compatible = "st,stm32mp25-pwm" },
{ }
};