[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAG40kxGMu-TSchNezkcC_A97hzPnWU3KxeL-X-hJfPhjr_COyQ@mail.gmail.com>
Date: Thu, 23 May 2024 11:26:07 +0900
From: きくちゃんさん <kikuchan98@...il.com>
To: privatesub2@...il.com
Cc: aou@...s.berkeley.edu, bigunclemax@...il.com, conor+dt@...nel.org,
contact@...kia.org, devicetree@...r.kernel.org, fusibrandon13@...il.com,
jernej.skrabec@...il.com, krzk+dt@...nel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-pwm@...r.kernel.org, linux-riscv@...ts.infradead.org,
linux-sunxi@...ts.linux.dev, mkl@...gutronix.de, p.zabel@...gutronix.de,
palmer@...belt.com, paul.walmsley@...ive.com, robh@...nel.org,
samuel@...lland.org, ukleinek@...nel.org, wens@...e.org
Subject: Re: [PATCH v9 0/3] Add support for Allwinner PWM on D1/T113s/R329 SoCs
Hello Aleksandr,
I had coincidentally developed a PWM driver for the device.
Based on my experience, I find that dynamically changing the coupled
DIV_M value is quite complex.
The current approach has limitations, especially with resolution
changes, which can be unpredictable for users. For example:
1. Enabling channel A automatically selects DIV_M.
2. Enabling coupled channel B with a specific period may result in
poor resolution for channel B, as the DIV_M value depends on the
period of channel A.
3. If channel B is enabled first, channel A may not be enabled if
its period doesn't fit the DIV_M range selected by channel B.
Additionally, using APB as a clock source for the channels would
further complicate the process.
To simplify this, I suggest (maybe for the future) specifying these
values directly in the Device Tree like this:
```
allwinner,pwm-coupled-channel-clock-sources="hosc", "apb", "hosc";
allwinner,pwm-coupled-channel-clock-prescales=<0>, <3>, <8>;
```
This would delegate the complexity to the DT, making the resolution
predictable for users.
As a bonus, it introduces a way to select clock sources for each
coupled channels.
For the meantime, I think it is enough to use fixed "hosc" and <0> for
regular use.
Looking forward to your thoughts.
Best regards,
kikuchan.
Powered by blists - more mailing lists