public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v9 0/3] Add support for Allwinner PWM on D1/T113s/R329 SoCs
@ 2024-05-23  2:26 きくちゃんさん
  2024-05-23  3:04 ` John Watts
  0 siblings, 1 reply; 7+ messages in thread
From: きくちゃんさん @ 2024-05-23  2:26 UTC (permalink / raw)
  To: privatesub2
  Cc: aou, bigunclemax, conor+dt, contact, devicetree, fusibrandon13,
	jernej.skrabec, krzk+dt, linux-arm-kernel, linux-kernel,
	linux-pwm, linux-riscv, linux-sunxi, mkl, p.zabel, palmer,
	paul.walmsley, robh, samuel, ukleinek, wens

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.

^ permalink raw reply	[flat|nested] 7+ messages in thread
* [PATCH v9 0/3] Add support for Allwinner PWM on D1/T113s/R329 SoCs
@ 2024-05-20 18:42 Aleksandr Shubin
  2024-10-08 15:10 ` Chris Morgan
  0 siblings, 1 reply; 7+ messages in thread
From: Aleksandr Shubin @ 2024-05-20 18:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Aleksandr Shubin, Uwe Kleine-König, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	Philipp Zabel, John Watts, Marc Kleine-Budde, Maksim Kiselev,
	Cheo Fusi, linux-pwm, devicetree, linux-arm-kernel, linux-sunxi,
	linux-riscv


v2:
 - fix dt-bindings
 - fix a remark in the driver

v3:
 - fix dt-bindings
 - fix sunxi-d1s-t113.dtsi

v4:
 - fix a remark in the driver

v5:
 - dropped unused varibale in the driver
 - fix dt-bindings

v6:
 - add apb0 clock

v7:
 - fix a remark in the driver
 - add maintainer

v8:
 - fix compile driver for 6.8-rc

v9:
 - fix a remark in the driver
 - fix dt-bindings
 - rename apb0 -> apb

Aleksandr Shubin (3):
  dt-bindings: pwm: Add binding for Allwinner D1/T113-S3/R329 PWM
    controller
  pwm: Add Allwinner's D1/T113-S3/R329 SoCs PWM support
  riscv: dts: allwinner: d1: Add pwm node

 .../bindings/pwm/allwinner,sun20i-pwm.yaml    |  84 ++++
 .../boot/dts/allwinner/sunxi-d1s-t113.dtsi    |  12 +
 drivers/pwm/Kconfig                           |  10 +
 drivers/pwm/Makefile                          |   1 +
 drivers/pwm/pwm-sun20i.c                      | 387 ++++++++++++++++++
 5 files changed, 494 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pwm/allwinner,sun20i-pwm.yaml
 create mode 100644 drivers/pwm/pwm-sun20i.c

-- 
2.25.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-10-08 15:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-23  2:26 [PATCH v9 0/3] Add support for Allwinner PWM on D1/T113s/R329 SoCs きくちゃんさん
2024-05-23  3:04 ` John Watts
2024-05-23  5:30   ` きくちゃんさん
2024-05-23  5:54     ` John Watts
2024-05-24 11:32       ` きくちゃんさん
  -- strict thread matches above, loose matches on Subject: below --
2024-05-20 18:42 Aleksandr Shubin
2024-10-08 15:10 ` Chris Morgan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox