Re: [PATCH v1 1/3] dt-bindings: pwm: Add binding for Allwinner D1/T113-S3/R329 PWM controller

From: Conor Dooley
Date: Fri Jun 16 2023 - 14:57:17 EST


On Fri, Jun 16, 2023 at 11:02:12AM +0300, Александр Шубин wrote:
> чт, 15 июн. 2023 г. в 19:37, Conor Dooley <conor@xxxxxxxxxx>:
> > On Thu, Jun 15, 2023 at 05:43:56PM +0300, Aleksandr Shubin wrote:
> > > Allwinner's D1, T113-S3 and R329 SoCs have a new pwm
> > > controller witch is different from the previous pwm-sun4i.
> > >
> > > D1 and T113s SoCs have one PWM controller with 8 channels.
> > > R329 SoC has two PWM controllers in both power domains, one of
> > > them has 9 channels (CPUX one) and the other has 6 (CPUS one).
> >
> > It would be good to note that the D1 and T113 are identical in terms of
> > peripherals, they differ only in the architecture of the CPU core, and
> > even share the majority of their DT. Because of that, using the same
> > compatible makes sense.
> > The R329 is a different SoC though, and should have a different
> > compatible string added, especially as there is a difference in the
> > number of channels. It would be fine to use the current compatible for
> > the D1 as a fallback.
> > The allwinner,pwm-channels property should probably only be allowed on
> > the R329 and only allow the values of 6 & 9.
>
>
> Maybe would it be better to allow only 8 channels for D1 and only 6 and 9
> channels for R329?

If you're on a D1, you don't need a dt property to tell you the number
of channels, you already know it to be 8. Couple ways driver could
implement that, for example: if the dt-binding requires the property on
the R329, you could set 8 as the default and overwrite it if the
property exists - which would only be permitted on the R329.
Up to you.

Attachment: signature.asc
Description: PGP signature