The latest development version of this page may be more current than this released 4.0.0 version.

pwm-clock

Vendor: Generic or vendor-independent

Note

An implementation of a driver matching this compatible is available in drivers/clock_control/clock_control_pwm.c.

Description

An external clock signal driven by a PWM pin.

The devicetree must define a clock node:

pwmclock: pwmclock {
    status = "okay";
    compatible = "pwm-clock";
    #clock-cells = <1>;
    pwms = <&pwm_ccu40 2 PWM_HZ(1000000) PWM_POLARITY_NORMAL>;
};

This will create a device node with a clock-controller
API. Internally the device node will use PWM API to start the
clock signals at 1MHz. Note that the PWM_HZ() macro converts the
frequency to time (nanoseconds units). This may result in rounding
errors if the clock frequency is not an integer number of nanoseconds.
The clock frequency can be explicitly set using the clock-frequency
property.

The PWM node may need to be properly configured to generate
the target period (i.e. using prescaler options). See the documentation
for the target PWM driver.

Properties

Properties not inherited from the base binding file.

Name

Type

Details

pwms

phandle-array

This property is required.

clock-frequency

int

Exact output frequency, in case the PWM period is not exact
but was rounded to nanoseconds. This property is optional.

pwm-on-delay

int

Optional blocking delay in micro seconds to make sure that the PWM clock has started after returning from clock_control_on().

#clock-cells

int

Number of items to expect in a Clock specifier

This property is required.

Constant value: 1

Specifier cell names

  • clock cells: id