Re: New default binding for PWM devices? [Was: Re: [PATCH] dt-bindings: timer: xlnx,xps-timer: Make PWM in example usable]

From: Geert Uytterhoeven

Date: Mon Mar 30 2026 - 08:23:47 EST


Hi Uwe,

On Sat, 7 Jun 2025 at 09:23, Uwe Kleine-König
<u.kleine-koenig@xxxxxxxxxxxx> wrote:
> On Fri, Jun 06, 2025 at 09:13:24AM -0500, Rob Herring wrote:
> > reg:
> > > maxItems: 1
> > >
> > > - '#pwm-cells': true
> > > + '#pwm-cells':
> > > + const: 3
> > >
> > > xlnx,count-width:
> > > $ref: /schemas/types.yaml#/definitions/uint32
> > > @@ -82,7 +83,7 @@ examples:
> > > };
> > >
> > > timer@800f0000 {
> > > - #pwm-cells = <0>;
> > > + #pwm-cells = <3>;
> > > clock-names = "s_axi_aclk";
> > > clocks = <&zynqmp_clk 71>;
> > > compatible = "xlnx,xps-timer-1.00.a";
> > >
> > > There is however one concern that I want to get resolved first to
> > > prevent churn:
> > >
> > > In principle I think it's bad that a phandle to a PWM must contain a
> > > period and flags specifying the polarity. For some use cases the period
> > > might not matter or is implicitly given or more than one period length
> > > is relevant.
> >
> > Why can't the period be 0 and no flags set if they aren't needed?
>
> I don't say they cannot, and probably that's the most sane option if
> there is no fixed default period and flags and we're sticking to 3
> cells.

So zero should have been used for drivers/pwm/pwm-argon-fan-hat.c?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds