Skip to content
Permalink
Browse files

drivers: clock_control_mcux_sim: add support for clkout

Add support for CLKOUT source selection and divider as found on the
NXP Kinetis KE1xF SoC series.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
  • Loading branch information...
henrikbrixandersen authored and MaureenHelm committed May 10, 2019
1 parent 56dfb62 commit d4b9c0d60040aa75cb9c3f6b427eb5e13412d7ec
Showing with 21 additions and 0 deletions.
  1. +9 −0 drivers/clock_control/clock_control_mcux_sim.c
  2. +12 −0 dts/bindings/arm/nxp,kinetis-sim.yaml
@@ -45,6 +45,15 @@ static int mcux_sim_get_subsys_rate(struct device *dev,

static int mcux_sim_init(struct device *dev)
{
#ifdef DT_SIM_CLKOUT_DIVIDER
SIM->CHIPCTL = (SIM->CHIPCTL & ~SIM_CHIPCTL_CLKOUTDIV_MASK)
| SIM_CHIPCTL_CLKOUTDIV(DT_SIM_CLKOUT_DIVIDER);
#endif
#ifdef DT_SIM_CLKOUT_SOURCE
SIM->CHIPCTL = (SIM->CHIPCTL & ~SIM_CHIPCTL_CLKOUTSEL_MASK)
| SIM_CHIPCTL_CLKOUTSEL(DT_SIM_CLKOUT_SOURCE);
#endif

return 0;
}

@@ -30,6 +30,18 @@ properties:
description: Human readable string describing the device (used by Zephyr for API name)
generation: define

clkout-source:
type: int
category: optional
description: clkout clock source
generation: define

clkout-divider:
type: int
category: optional
description: clkout divider
generation: define

"#cells":
- name
- offset

0 comments on commit d4b9c0d

Please sign in to comment.
You can’t perform that action at this time.