[v6 1/4] dt-bindings: pwm: Add ASPEED PWM Control documentation

Billy Tsai billy_tsai at aspeedtech.com
Thu Jun 8 18:57:05 AEST 2023


On 08/06/2023 10:21, Billy Tsai wrote:
        >>         On 08/06/2023 09:47, Billy Tsai wrote:
        >>         >>
        >>         >>   >> +
        >>         >>   >> +allOf:
        >>         >>   >> +  - $ref: pwm.yaml#
        >>         >>   >> +
        >>         >>   >> +properties:
        >>         >>   >> +  compatible:
        >>         >>   >> +    enum:
        >>         >>   >> +      - aspeed,ast2600-pwm
        >>         >>   >> +
        >>         >>   >> +  "#pwm-cells":
        >>         >>   >> +    const: 3
        >>         >>
        >>         >>   > 3 cells? For one PWM? What are they?
        >>         >>
        >>         >> channel, period and polarity.
        >>
        >>         > Don't cut my responses. You wrote you have one PWM output, so only one
        >>         > channel. What do you put then in the channel?
        >>
        >> You need to put 0 in the cell of the channel, the example of the dts usage will like following:

        > If you always put 0 isn't this a proof that it's wrong?

No, if your PWM controller only has one pwm output, then it should only be configured as 0.
This is the usage of the pwm-cells property.
https://github.com/torvalds/linux/blob/master/drivers/pwm/core.c#L129-L158
https://github.com/torvalds/linux/blob/master/include/linux/pwm.h#LL299C20-L299C20
All of the pwm driver with npwm = 1 will has the same usage.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/linux-aspeed/attachments/20230608/93652b02/attachment-0001.htm>


More information about the Linux-aspeed mailing list