]> www.infradead.org Git - users/jedix/linux-maple.git/commit
pwm: stm32-lp: Add support for stm32mp25
authorFabrice Gasnier <fabrice.gasnier@foss.st.com>
Tue, 29 Apr 2025 12:51:30 +0000 (14:51 +0200)
committerLee Jones <lee@kernel.org>
Tue, 13 May 2025 10:13:56 +0000 (11:13 +0100)
commit3f51b232c1da8e59eb562f1d81533334827a4799
treef3f954410435724f8f7d3853740b936b39a6f01f
parent5414bc8c57c41038b1994cd21a2cc0b8415c1544
pwm: stm32-lp: Add support for stm32mp25

Add support for STM32MP25 SoC. A new compatible has been added to the
dt-bindings. It represents handle new features, registers and bits
diversity.
It isn't used currently in the driver, as matching is done by retrieving
MFD parent data.

New dedicated capture/compare channels has been added: e.g. a new compare
register for channel 2. Some controls (polarity / cc channel enable) are
handled in CCMR register on this new variant (instead of wavepol bit).

So, Low-power timer can now have up to two PWM outputs. Use device data
from the MFD parent to configure the number of PWM channels e.g. 'npwm'.

Update current get_state() and apply() ops to support either:
- one PWM channel (as on older revision, or LPTIM5 on STM32MP25)
- two PWM channels (e.g. LPTIM1/2/3/4 on STM32MP25 that has the full
  feature set)
Introduce new routines to manage common prescaler, reload register and
global enable bit.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Acked-by: Uwe Kleine-König <ukleinek@kernel.org>
Link: https://lore.kernel.org/r/20250429125133.1574167-5-fabrice.gasnier@foss.st.com
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/pwm/pwm-stm32-lp.c