@@ -14,6 +14,16 @@ See the clock consumer binding,
Documentation/devicetree/bindings/clock/clock-bindings.txt
- interrupts: The interrupt for the pwm controller
+Optional properties:
+- pinctrl: For i.MX27 and newer SoCs. Use "pwm" and "gpio" specific pinctrls
+ instead of the "default" to configure the PWM pin to GPIO and PWM function.
+ It allows control over the pin output level when the PWM block is disabled.
+ This is useful if you use the PWM for single purpose and you need inverted
+ polarity of the PWM signal. See "Inverted PWM output" section bellow.
+- pwm-gpios: Specify the GPIO pin that will act as the PWM output. This should
+ be the same pin as is used for normal PWM output. See "Inverted PWM output"
+ section bellow.
+
Example:
pwm1: pwm@53fb4000 {
@@ -25,3 +35,42 @@ pwm1: pwm@53fb4000 {
clock-names = "ipg", "per";
interrupts = <61>;
};
+
+Inverted PWM output
+-------------------
+
+The i.MX SoC has such limitation that whenever a pin is configured as a PWM
+output, the output level on the pin is always low when the PWM block is
+disabled. The low output level is actively driven by the output stage of the
+PWM block and it does not matter what polarity a PWM client (e.g. backlight)
+requested.
+
+To gain control of the output level in PWM disabled state two pinctrl states
+can be used. A "pwm" state and a "gpio" state. In the pwm state the pin is
+configured as a normal PWM output. In the gpio state the pin is configured as
+a GPIO input. In the gpio state the output level is controlled by the pull-up
+setting. This setup assures that the PWM output is at the required level that
+corresponds to duty cycle = 0 when PWM is disabled.
+
+Example:
+
+&pwm1 {
+ pinctrl-names = "pwm", "gpio";
+ pinctrl-0 = <&pinctrl_backlight_pwm>;
+ pinctrl-1 = <&pinctrl_backlight_gpio>;
+ pwm-gpios = <&gpio1 9 GPIO_ACTIVE_LOW>
+}
+
+pinctrl_backlight_gpio: pwm1grp-gpio {
+ fsl,pins = <
+ /* GPIO with 100kOhm pull-up */
+ MX6QDL_PAD_GPIO_9__GPIO1_IO09 0xb000
+ >;
+};
+
+pinctrl_backlight_pwm: pwm1grp-pwm {
+ fsl,pins = <
+ /* PWM output */
+ MX6QDL_PAD_GPIO_9__PWM1_OUT 0x8
+ >;
+};