October 2017
Intermediate to advanced
586 pages
14h 8m
English
While binding the PWM controller from within the DT, the most important property is #pwm-cells. It represents the number of cells used to represent a PWM device on this controller. If you remember, in the struct pwm_chip structure, the of_xlate hook is used to translate a given PWM specifier. If the hook has not been set, pwm-cells must be set to 2; otherwise, it should be set with the same value as of_pwm_n_cells. The following is an example of a PWM controller node in the DT for an i.MX6 SoC:
pwm3: pwm@02088000 { #pwm-cells = <2>; compatible = "fsl,imx6q-pwm", "fsl,imx27-pwm"; reg = <0x02088000 0x4000>; interrupts = <0 85 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clks IMX6QDL_CLK_IPG>, <&clks IMX6QDL_CLK_PWM3>; clock-names ...