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

@ -154,6 +154,7 @@ arduino_spi: &spi0 {
#pwm-cells = <3>;
pinctrl-0 = <&ftm0_default>;
pinctrl-names = "default";
clock-source = "fixed";
};
&uart1 {

View file

@ -174,6 +174,7 @@ arduino_spi: &spi0 {
#pwm-cells = <3>;
pinctrl-0 = <&ftm0_default>;
pinctrl-names = "default";
clock-source = "fixed";
};
&ftm3 {
@ -182,6 +183,7 @@ arduino_spi: &spi0 {
#pwm-cells = <3>;
pinctrl-0 = <&ftm3_default>;
pinctrl-names = "default";
clock-source = "fixed";
};
&uart0 {

View file

@ -209,6 +209,7 @@
#pwm-cells = <3>;
pinctrl-0 = <&ftm3_default>;
pinctrl-names = "default";
clock-source = "fixed";
};
&spi1 {

View file

@ -106,6 +106,7 @@
#pwm-cells = <3>;
pinctrl-0 = <&ftm3_default>;
pinctrl-names = "default";
clock-source = "fixed";
};
&i2c0 {

View file

@ -145,6 +145,7 @@
#pwm-cells = <3>;
pinctrl-0 = <&ftm0_default>;
pinctrl-names = "default";
clock-source = "fixed";
};
@ -155,6 +156,7 @@
#pwm-cells = <3>;
pinctrl-0 = <&ftm3_default>;
pinctrl-names = "default";
clock-source = "fixed";
};
/* LPUART connected to debug header */

View file

@ -226,6 +226,7 @@
#pwm-cells = <3>;
pinctrl-0 = <&ftm0_default>;
pinctrl-names = "default";
clock-source = "fixed";
};
&ftm3 {
@ -234,6 +235,7 @@
#pwm-cells = <3>;
pinctrl-0 = <&ftm3_default>;
pinctrl-names = "default";
clock-source = "fixed";
};
&lpi2c0 {

View file

@ -149,7 +149,8 @@
compatible = "nxp,kinetis-ftm-pwm";
pinctrl-0 = <&ftm0_default>;
pinctrl-names = "default";
prescaler = <128>;
clock-source = "system";
prescaler = <4>;
#pwm-cells = <3>;
status = "okay";
};
@ -158,6 +159,8 @@
compatible = "nxp,kinetis-ftm-pwm";
pinctrl-0 = <&ftm1_default>;
pinctrl-names = "default";
clock-source = "system";
prescaler = <4>;
#pwm-cells = <3>;
status = "okay";
};
@ -166,6 +169,8 @@
compatible = "nxp,kinetis-ftm-pwm";
pinctrl-0 = <&ftm2_default>;
pinctrl-names = "default";
clock-source = "system";
prescaler = <4>;
#pwm-cells = <3>;
status = "okay";
};