61 lines · plain
1Specifying PWM information for devices2======================================3 41) PWM user nodes5-----------------6 7PWM users should specify a list of PWM devices that they want to use8with a property containing a 'pwm-list':9 10 pwm-list ::= <single-pwm> [pwm-list]11 single-pwm ::= <pwm-phandle> <pwm-specifier>12 pwm-phandle : phandle to PWM controller node13 pwm-specifier : array of #pwm-cells specifying the given PWM14 (controller specific)15 16PWM properties should be named "pwms". The exact meaning of each pwms17property must be documented in the device tree binding for each device.18An optional property "pwm-names" may contain a list of strings to label19each of the PWM devices listed in the "pwms" property. If no "pwm-names"20property is given, the name of the user node will be used as fallback.21 22Drivers for devices that use more than a single PWM device can use the23"pwm-names" property to map the name of the PWM device requested by the24pwm_get() call to an index into the list given by the "pwms" property.25 26The following example could be used to describe a PWM-based backlight27device:28 29 pwm: pwm {30 #pwm-cells = <2>;31 };32 33 [...]34 35 bl: backlight {36 pwms = <&pwm 0 5000000>;37 pwm-names = "backlight";38 };39 40Note that in the example above, specifying the "pwm-names" is redundant41because the name "backlight" would be used as fallback anyway.42 43pwm-specifier typically encodes the chip-relative PWM number and the PWM44period in nanoseconds.45 46Optionally, the pwm-specifier can encode a number of flags (defined in47<dt-bindings/pwm/pwm.h>) in a third cell:48- PWM_POLARITY_INVERTED: invert the PWM signal polarity49 50Example with optional PWM specifier for inverse polarity51 52 bl: backlight {53 pwms = <&pwm 0 5000000 PWM_POLARITY_INVERTED>;54 pwm-names = "backlight";55 };56 572) PWM controller nodes58-----------------------59 60See pwm.yaml.61