Skip to content

pwm: add driver for T-THEAD TH1520 SoC

Jisheng Zhang linux-devicetree linux-pwm linux-riscv lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 5 repliesIn review
  2. v22 patches 4 repliesSuperseded
  3. v12 patches 3 repliesSuperseded

Changes in v3 from the cover letter

- collect Reviewed-by tag
- add CTRL_ prefix for THEAD_PWM_CTRL register bit macros
- use pm_runtime_resume_and_get() instead of pm_runtime_get_sync() and check its return value.
- remove unnecessary casts
- call pm_runtime_put_sync() when pwm channel is disabled
- use devm_pm_runtime_enable() and then drop .remove()
- properly consider if pwm is programmed by bootloader or other pre-linux env.
- simplify thead_pwm_runtime_resume() code as Uwe suggested
- bool ever_started -> u8 channel_ever_started since we have 6 channels
- use 3 for #pwm-cells

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2dt-bindings: pwm: Add T-HEAD PWM controllerDocumentation/devicetree/bindings/pwm/thead,th1520-pwm.yaml+44 -01 reply
2/2pwm: add T-HEAD PWM driverdrivers/pwm/Kconfig drivers/pwm/Makefile drivers/pwm/pwm-thead.c+282 -02 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchRob HerringUwe Kleine-KönigThomas Bonnefille
1/2R-b A-b
2/2T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v3 thread

Cover letter [PATCH v3 0/2] pwm: add driver for T-THEAD TH1520 SoC

T-HEAD SoCs such as the TH1520 contain a PWM controller used to control the LCD backlight, fan and so on. Add the PWM driver support for it.

Since the clk part isn't mainlined, so SoC dts(i) changes are not included in this series. However, it can be tested by using fixed-clock.

since v2:
- collect Reviewed-by tag
- add CTRL_ prefix for THEAD_PWM_CTRL register bit macros
- use pm_runtime_resume_and_get() instead of pm_runtime_get_sync() and check its return value.
- remove unnecessary casts
- call pm_runtime_put_sync() when pwm channel is disabled
- use devm_pm_runtime_enable() and then drop .remove()
- properly consider if pwm is programmed by bootloader or other pre-linux env.
- simplify thead_pwm_runtime_resume() code as Uwe suggested
- bool ever_started -> u8 channel_ever_started since we have 6 channels
- use 3 for #pwm-cells

since v1:
- update commit msg and yaml filename to address Conor's comment
- use devm_clk_get_enabled() and devm_pwmchip_add()
- implement .get_state()
- properly handle overflow
- introduce thead_pwm_from_chip() inline function
- document Limitations
- address pm_runtime_get/put pingpong comment

Jisheng Zhang (2):
dt-bindings: pwm: Add T-HEAD PWM controller
pwm: add T-HEAD PWM driver

 .../bindings/pwm/thead,th1520-pwm.yaml        |  44 +++
 drivers/pwm/Kconfig                           |  11 +
 drivers/pwm/Makefile                          |   1 +
 drivers/pwm/pwm-thead.c                       | 270 ++++++++++++++++++
 4 files changed, 326 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pwm/thead,th1520-pwm.yaml
 create mode 100644 drivers/pwm/pwm-thead.c
Signature · 1 line
2.40.1