Commit graph

672 commits

Author SHA1 Message Date
Khoa Nguyen
db981f65e9 drivers: Add assign event for current core for all Renesas drivers
Add assign event for current core for all Renesas drivers

Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2025-09-11 09:53:13 +02:00
Bill Waters
7973535ec6 drivers: pwm: Infineon: PWM driver improvements and bug fixes
This change makes improvements and bug fixes for the Infineon PWM
driver.  These include:

* Removes hard coded register addresss from driver.
* Addresses issues causing pwm_api and pwm_gpio_loopback tests to
fail, as well as functional failures.
* Restructures device tree file to better represent the hardware
architecture of the tcpwm module.
* Allows configuration of hardware behavior when PWM is disabled.

Signed-off-by: Bill Waters <bill.waters@infineon.com>
2025-09-10 16:38:19 +02:00
Bill Waters
8e1f2c70de drivers: pwm: Infineon: replace cat1 naming with tcpwm
* Changes driver naming to reflect hardware IP being used (TCPWM)
instead of referencing cat1.  Cat1 is an internal infineon
reference which has little meaning to users and is being phased
phased out.

Signed-off-by: Bill Waters <bill.waters@infineon.com>
2025-09-10 16:38:19 +02:00
S Mohamed Fiaz
e8fd6b1a12 driver: pwm: pwm_silabs_siwx91x: Add pm device support for pwm driver
This commit enables the pm device driver support
for the pwm_silabs_siwx91x driver.

Signed-off-by: S Mohamed Fiaz <fiaz.mohamed@silabs.com>
2025-09-08 14:37:36 +02:00
Furkan Akkiz
f94ab07118 drivers: pwm: Fix prescaler configuration
This commit fixes the bug in the prescaler configuration formula.
Prescaler enumarations values are not consecutive numbers, so this
formula does not work correctly. This commit adds prescaler enums into
an array and sets PWM prescaler from this array with using
prescaler_index parameter.

Signed-off-by: Furkan Akkiz <hasanfurkan.akkiz@analog.com>
2025-09-05 17:11:07 +02:00
Benjamin Cabé
89fef8aa6d doc: correct the spelling of "comparison"
s/comparision/comparison/

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-09-03 17:04:13 +02:00
Anisetti Avinash Krishna
e018a7e8dd drivers: pwm: Enable PWM support for PTL-h
Enable PWM support on PTL-h and add 64bit
address support for PWM driver.

Signed-off-by: Anisetti Avinash Krishna <anisetti.avinash.krishna@intel.com>
2025-08-29 19:18:28 -04:00
Raffael Rostagno
382ce7cbd3 drivers: mcpwm: esp32: Fix duty rounding
Duty value in the driver is calculated from timer cycles, which
can introduce precision loss when converting from pwm_set() to
pwm_set_cycles(). To avoid truncating values with a fractional
part ≥ 0.5 and further drifting the effective duty, round the
computed duty to the nearest integer.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2025-08-26 22:08:11 +02:00
Peter Marheine
26ab6d858e soc: rp2350: support PWM channels >8
RP2350 adds four more PWM slices from the eight available on RP2040,
which are only broken out to package pins on RP2350B. This change fixes
the driver to support the correct number of slices on RP2350.

Tested by confirming that PWM can correctly be configured on GPIO 44 of
RP2350B.

Signed-off-by: Peter Marheine <peter@taricorp.net>
2025-08-22 03:32:16 +02:00
Guillaume Gautier
308e219ea5 drivers: pwm: stm32: use kernel clock instead of dedicated function
Now that the timer kernel clocks are defined in device tree, use the
clock get API to fetch the clock frequency instead of calculating the
value in the driver.
Removes the now unused function get_tim_clk.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2025-08-21 13:06:58 +02:00
Tomasz Bursztyka
347fb0a75a drivers: pwm: Use DEVICE_API relevantly on mspm0 driver
It was missing thus it was not possible to get a valid answer
from DEVICE_API_IS().

Signed-off-by: Tomasz Bursztyka <tobu@bang-olufsen.dk>
2025-08-21 06:52:34 +02:00
Hieu Nguyen
8e40b8a057 drivers: pwm: Add PWM support for Renesas RZ/A3UL
Add PWM driver support for Renesas RZ/A3UL

Signed-off-by: Hieu Nguyen <hieu.nguyen.ym@bp.renesas.com>
Signed-off-by: Tien Nguyen <tien.nguyen.zg@renesas.com>
2025-08-15 10:30:49 +01:00
Hieu Nguyen
7aa3266840 drivers: pwm: Add PWM support for Renesas RZ/T2M, N2L, V2L
Add PWM driver support for Renesas RZ/T2M, N2L, V2L

Signed-off-by: Hieu Nguyen <hieu.nguyen.ym@bp.renesas.com>
Signed-off-by: Tien Nguyen <tien.nguyen.zg@renesas.com>
2025-08-14 10:40:07 +03:00
Khoa Nguyen
3aa72e4e9e drivers: Update p_context for all Renesas drivers
The p_context no longer has the const type, so all
Renesas-supported drivers need to be updated accordingly.

Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2025-08-08 11:52:13 +03:00
Emilio Benavente
8467f557f9 drviers: pwm: Update flexio pwm update duty cycle
Updated the nxp flexio pwm driver to account
for when the duty cycle is 100% or 0%.
We switch off the counter of the flexio and
manually set the GPIO High or Low. Otherwise
Flexio Peripheral with default to a 50% duty
cycle behavior.
Factored out timerOutput variable.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2025-08-07 20:54:15 -04:00
Raffael Rostagno
f9260ae2e5 drivers: pwm: ledc: esp32: Fix RC_FAST and REF_TICK
Depending on clock config init, some devices might be initialized
with RC_FAST clock enabled but not calibrated. Logic to detect if
clock is calibrated was fixed for this reason. Also, logic to set
RC_FAST and REF_TICK for devices with timer specific clocks (ESP32
and ESP32-S2) was also fixed.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2025-07-30 17:30:50 -04:00
Bjarki Arge Andreasen
2b0d1ae4d0 soc: nordic: nrf54h: transition from gpd to zephyr pinctrl and pds
Transition nrf54h away from the soc specific gpd
(global power domain) driver which mixed power domains, pinctrl
and gpio pin retention into a non scalable solution, forcing soc
specific logic to bleed into nrf drivers.

The new solution uses zephyrs PM_DEVICE based power domains to
properly model the hardware layout of device and pin power domains,
and moves pin retention logic out of drivers into pinctrl and
gpio, which are the components which manage pins (pads).

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2025-07-29 09:03:37 -04:00
Michał Bainczyk
2e06c4ed20 drivers: nrf: add build asserts for memory-regions property
Add build asserts for "memory-regions" property in nrf drivers which is
required on targets with DMM for saadc, pdm, pwm, twim, twim_rtio, twis,
tdm, uarte, spim and spis. On targets where the property is not required
the assertion macro expands to nothing.

Signed-off-by: Michał Bainczyk <michal.bainczyk@nordicsemi.no>
2025-07-28 04:27:25 -04:00
Stoyan Bogdanov
ff2328522a drivers: pwm: Add support for cc23x0 LGPT PWM
Add PWM support for LGPT0, LGPT1, LGPT2 and LGPT3 for cc23x0 SoC.

Signed-off-by: Stoyan Bogdanov <sbogdanov@baylibre.com>
2025-07-21 07:26:18 -04:00
Saravanan Sekar
e051ec23ca drivers: pwm: Add a support for TI MSPM0 PWM capture
TI MSPM0 timer module has capture block used to capture timings of input
signal. Add a support for TI MSPM0 PWM capture.

Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
2025-07-21 07:25:10 -04:00
Hao Luo
4b3565d958 drivers: pwm: Add support for Apollo510 pwm
This commit adds support for Apollo510 pwm driver

Signed-off-by: Hao Luo <hluo@ambiq.com>
2025-07-19 15:31:08 -04:00
Hao Luo
eea4aa9f52 drivers: pwm: changed ambiq ctimer variable names
changed variable names from timer to ctimer

Signed-off-by: Hao Luo <hluo@ambiq.com>
2025-07-19 15:31:08 -04:00
Richard Wheatley
902005e0ef drivers: add assert to check for max children in timer
check for max number of children in timer.

Signed-off-by: Richard Wheatley <richard.wheatley@ambiq.com>
2025-07-19 15:31:08 -04:00
Richard Wheatley
7cd378d9c9 dts: bindings: move clk-source to parent
Move clk-source from pwm to timer
change associated files to match

Signed-off-by: Richard Wheatley <richard.wheatley@ambiq.com>
2025-07-19 15:31:08 -04:00
Richard Wheatley
e81a241678 driver: pwm: create ambiq pwm driver
Restructured counter and timer.
CTimer/Timer is now parent to pwm and counter.
Created PWM driver and tied to pwm and pwm-led

Signed-off-by: Richard Wheatley <richard.wheatley@ambiq.com>
2025-07-19 15:31:08 -04:00
Guillaume Gautier
70b910981d drivers: pwm: stm32: fix four channel pwm capture
With the four-channel-capture-support property enabled, the STM32 PWM
driver was missing every other frames during PWM capture.

The counter values are now reset just after getting the pulse and the
period of the cycle, instead of waiting the next interrupt to do so, and
thus missing a cycle.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2025-07-10 16:01:23 -05:00
Fabrice DJIATSA
24af0c8ee1 drivers: pwm: stm32: add stm32h7rs bus prescalers
The clock tree of the STM32H7RS series uses the ppre1
and ppre2 naming convention instead of apb1_prescaler
and apb2_prescaler for bus prescaler.

Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
2025-07-08 13:40:50 -05:00
Pieter De Gendt
d4139d3d8d drivers: pwm: Place device APIs in linker sections
Use DEVICE_API macro to place driver API instances into a linker section.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-06-27 10:09:32 -05:00
Steven Chang
7ce78aa294 drivers: pwm: pwm driver
Add pwm driver for ENE KB106X

Signed-off-by: Steven Chang <steven@ene.com.tw>
2025-06-27 10:57:20 +02:00
Saravanan Sekar
f7df5e84e3 drivers: pwm: Add a support for TI MSPM0 Timer PWM
TI MSPM0 SoC series has General Purpose Timer and Advanced control timers
with Compare block which is used to generate time expiry and output
waveform like PWM. Add driver support for MSPM0 PWM output.

Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
2025-06-27 10:57:05 +02:00
Aksel Skauge Mellbye
fccc0a7544 drivers: pwm: silabs: Add TIMER PWM driver for Series 2
Add PWM driver for the Timer peripheral on Series 2.
The TIMER uses the high-frequency EM01 Group A clock, and has
a 16- or 32-bit counter. It supports PWM period and pulse capture
on channel 0, and PWM output on all channels.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2025-06-25 14:07:40 +02:00
Aksel Skauge Mellbye
566fc7a7db drivers: pwm: silabs: Add LETIMER PWM driver for Series 2
Add PWM driver for the Low Energy Timer peripheral on Series 2.
The LETIMER runs at up to 32 kHz and has a 24-bit counter. It
only supports PWM output, it does not support input capture.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2025-06-25 14:07:40 +02:00
Phi Tran
d8ab33ae96 drivers: pwm: Add support for PWM driver on RSK_RX130_512KB
This is initial commit to support PWM driver
on Renesas RX130 with MTU modules.

Signed-off-by: Phi Tran <phi.tran.jg@bp.renesas.com>
2025-06-25 10:52:34 +02:00
Benjamin Cabé
6c4ed097ff drivers: pwm: Fix priority handling for Renesas RA
Fixed a typo causing interrupt priority from DT to be ignored.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-06-19 14:00:21 +02:00
Benjamin Cabé
cd78920785 drivers: pwm: adopt SHELL_HELP
Adopt SHELL_HELP macro for pwm_shell

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-06-13 10:17:55 -07:00
Bjarki Arge Andreasen
979a565289 drivers: clock_control: nrf2: align with hw binding names
Currently there is a mismatch between the naming of the hardware and
the drivers targetting the hardware. nrf2_ is used instead of
the actual bindings names, like nrf2_audiopll instead of
nrfs_audiopll. This makes it hard to map drivers to the hardware
they are targetting.

There is historical reason for some of this, namely the same binding
name was used for different hardware, which is why nrf2_ was used
on newer platforms. This is no longer the case though, so drivers
and configs can be named according to the hardware without conflict.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2025-06-13 11:12:43 +02:00
Khanh Nguyen
c6de306949 drivers: pwm: Update Renesas RA PWM driver to integrate Renesas ELC
Update the Renesas RA PWM driver to integration
with the Renesas Event Link Controller.

Signed-off-by: Khanh Nguyen <khanh.nguyen.wz@bp.renesas.com>
2025-06-13 10:09:35 +02:00
Krzysztof Chruściński
0261d7d96d drivers: pwm: nrfx: Add option to glitch free 100% duty cycle
IDLEOUT presence in PWM means that there are 3 sources from which
PWM pin can be driven:
- GPIO setting when PWM peripheral is disabled.
- IDLEOUT setting when PWM is enabled.
- PWM Sequence when it is in use.

IDLEOUT setting cannot be changed after enabling PWM so it is
configured to the initial state of the pin. It means that if duty
cycle is 100%, GPIO output is set to 1 but initial pin state was 0
(IDLEOUT setting) there will be a glitch between disabling a PWM
sequence and disabling a PWM peripheral.

By default, PWM driver tries to disable PWM peripheral if all channels
are 0% or 100% duty cycle to safe power. When IDLEOUT feature is
present there will be a short glitch on channels with 100% duty cycle.

In order to avoid that CONFIG_PWM_NRFX_NO_GLITCH_DUTY_100 option is
added (enabled by default). When option is enabled 100% duty cycle
is achieved by PWM sequence and not by driving a GPIO pin. It will
consume more power in cases where all channels are 0% or 100% with
at least one channel set to 100% duty cycle.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-06-10 10:24:16 -04:00
Benjamin Cabé
c83fbaee14 drivers: pwm: remove duplicate macro definition
Removed duplicate definition of TIM_CC1E macro

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-06-09 14:52:45 -07:00
Fin Maaß
238f05c782 drivers: pwm: nxp: fix value of DT_ENUM_HAS_VALUE
make value of DT_ENUM_HAS_VALUE lowercase.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-06-06 20:10:40 +01:00
45e55d639d drivers: pwm: fix an off-by-one error in the CH32V PWM driver
The period is the reload register plus 1. Adjust. Note that the
earlier code handles the cases where the pulse time is zero or equal
to the period.

Signed-off-by: Michael Hope <michaelh@juju.nz>
2025-06-06 14:48:00 +01:00
Raffael Rostagno
00372dd6a9 drivers: pwm: ledc: esp32: Enable RC_FAST clock source
RC_FAST needs to be enabled and calibrated in order to be used
as clock source. Otherwise, clock source is selected but no
PWM is generated.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2025-06-05 15:09:17 -05:00
31fe70805f modules: hal_wch: update the HAL to pull in CH32V00x support
Now that the HAL has been commited, pick it and fix the related build
errors.

Signed-off-by: Michael Hope <michaelh@juju.nz>
2025-06-02 13:30:04 +02:00
Sven Depoorter
ff3d5f89a2 drivers: pwm: pwm_nrf_sw: use shutdown task if available
Add a workaround for NRF52 anomaly 78: "High current consumption when
using timer STOP task only. Use the SHUTDOWN task instead."

Signed-off-by: Sven Depoorter <svndepoorter@gmail.com>
2025-05-31 07:04:01 -04:00
Tu Nguyen Van
0e132ecd86 drivers: pwm: update variable and marco name in RTD 2.0.1
eMios_Icu_Ip_IndexInChState is changed to
eMios_Icu_Ip_u8IndexInChState and EMIOS_ICU_BUS_F
is removed in RTD 2.0.1

Signed-off-by: Tu Nguyen Van <tu.nguyenvan@nxp.com>
2025-05-28 05:54:38 +02:00
5c2e2b7edc drivers: wch: fix the ch32vfun.h path after the recent HAL update
https://github.com/zephyrproject-rtos/zephyr/pull/87125 renamed the
`ch32vfun.h` header but missed some of the drivers. Fix.

Signed-off-by: Michael Hope <michaelh@juju.nz>
2025-05-28 05:54:28 +02:00
cyliang tw
a5f8645038 drivers: pwm: support for numaker m55m1x
Modify Nuvoton numaker pwm driver for m55m1x series.
Add pwm nodes in m55m1x.dtsi

Signed-off-by: cyliang tw <cyliang@nuvoton.com>
2025-05-14 11:04:17 +01:00
Ruibin Chang
265a0b991a drivers/pwm/it51xxx: implement pwm driver
Implement pwm driver for ITE it51xxx series chip.

Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw>
2025-05-07 08:17:12 +01:00
John Batch
b1950615bd driver: pwm: infineon: Use PWM buffer updates
Change PWM to use buffers registers instead of writing period
and compare directly.  This addressses an issue when updating
period to a value less than current counter, as demonstrated
in the blinky_pwm sample running on the CYW920829M2EVK_02
board.

Signed-off-by: John Batch <john.batch@infineon.com>
2025-05-06 02:36:04 +02:00
b1aadb6729 drivers: pwm: add a CH32V00x General-prupose Timer Module (GPTM) driver
The GPTM is a general purpose module with a 16 bit prescaler, 16 bit
counter, and 4 compare units that can be used for PWM generation.

Use the same style as gd32 where the timer is a counter and the PWM
mode is a child node.

Signed-off-by: Michael Hope <michaelh@juju.nz>
2025-05-05 21:56:38 +02:00