drivers: pwm: mcux_ftm: allow to select clock source

FTM internal counter can be clocked by one of three clock sources
independent of the module bus clock. This patch introduces a DT property
to perform the clock selection from DT.

DT sources are updated to keep the current clock selection for all boards,
with exception of ucans32k1sic board which is migrated to use system
clock by default, as this seems to be a better choice for most cases.
Some PWM LED samples require slower clock so overlays are added for
those cases.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
This commit is contained in:
Manuel Argüelles 2024-04-16 08:20:47 +07:00 committed by Alberto Escolar
commit 5d2670ac1f
15 changed files with 88 additions and 12 deletions

View file

@ -1,4 +1,4 @@
# Copyright (c) 2017, NXP
# Copyright 2017, 2024 NXP
# SPDX-License-Identifier: Apache-2.0
description: Kinetis FTM PWM
@ -14,6 +14,25 @@ properties:
pinctrl-0:
required: true
clock-source:
type: string
required: true
enum:
- "system"
- "fixed"
- "external"
description: |
Select one of three possible clock sources for the FTM counter:
* system: it's the bus interface clock driving the FTM module. Usually
provides higher timer resolution than the other two clock sources.
* fixed: it's a fixed clock defined by chip integration.
* external: it's a clock that can be accessed externally to the chip and
passes through a sychronizer clocked by the FTM bus interface clock.
This clock source selection is independent of the bus interface clock
driving the FTM module. Refer to the chip specific documentation for
further information.
pwm-cells:
- channel
# period in terms of nanoseconds