drivers: pwm: mcux_ftm: use device tree for obtaining clock frequency

Use clock specified in the device tree for obtaining the source clock
frequency for the pwm_mcux_ftm driver instead of relying on having an
NXP Kinetis MCG clock available in all SoCs supporting FlexTimer (FTM)
modules.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This commit is contained in:
Henrik Brix Andersen 2019-05-19 23:42:28 +02:00 committed by Maureen Helm
commit 84c74993d4
7 changed files with 65 additions and 13 deletions

View file

@ -2,6 +2,7 @@
#include <arm/armv7-m.dtsi>
#include <dt-bindings/clock/kinetis_sim.h>
#include <dt-bindings/clock/kinetis_mcg.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/i2c/i2c.h>
@ -46,9 +47,11 @@
};
mcg: clock-controller@40064000 {
compatible = "nxp,k64f-mcg";
compatible = "nxp,kinetis-mcg";
reg = <0x40064000 0xd>;
label = "MCG";
system-clock-frequency = <120000000>;
#clock-cells = <1>;
};
clock-controller@40065000 {
@ -338,6 +341,7 @@
compatible = "nxp,kinetis-ftm";
reg = <0x40038000 0x98>;
interrupts = <42 0>;
clocks = <&mcg KINETIS_MCG_FIXED_FREQ_CLK>;
label = "PWM_0";
status = "disabled";
#pwm-cells = <2>;
@ -347,6 +351,7 @@
compatible = "nxp,kinetis-ftm";
reg = <0x40039000 0x98>;
interrupts = <43 0>;
clocks = <&mcg KINETIS_MCG_FIXED_FREQ_CLK>;
label = "PWM_1";
status = "disabled";
#pwm-cells = <2>;
@ -356,6 +361,7 @@
compatible = "nxp,kinetis-ftm";
reg = <0x4003a000 0x98>;
interrupts = <44 0>;
clocks = <&mcg KINETIS_MCG_FIXED_FREQ_CLK>;
label = "PWM_2";
status = "disabled";
#pwm-cells = <2>;
@ -365,6 +371,7 @@
compatible = "nxp,kinetis-ftm";
reg = <0x400b9000 0x98>;
interrupts = <71 0>;
clocks = <&mcg KINETIS_MCG_FIXED_FREQ_CLK>;
label = "PWM_3";
status = "disabled";
#pwm-cells = <2>;