linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Add support for Microchip's pwm fpga core
@ 2022-06-13 11:17 Conor Dooley
  2022-06-13 11:17 ` [PATCH v2 1/2] pwm: add microchip soft ip corePWM driver Conor Dooley
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Conor Dooley @ 2022-06-13 11:17 UTC (permalink / raw)
  To: Thierry Reding, Uwe Kleine-König, Lee Jones
  Cc: Daire McNamara, linux-kernel, linux-pwm, linux-riscv, Conor Dooley

Hey Uwe,
Got a v2 for you...
I added some comments explaining the calculations and a documentation link
so hopefully things are a bit easier to follow.

Code wise, I went through and sorted out a bunch of issues that cycling
through the different periods/duties threw up. Along the way I found
some other problems - especially with the longer periods which I have
fixed. I also added a write to the sync register in the apply function,
which will resolve to a NOP for channels without "shadow registers".

Other than that, I managed to ditch the mchp_core_pwm_registers struct
entirely but had to add a short delay before reading back the registers
in order to compute the duty.

Thanks,
Conor.

Changes from v1:
- account for edge "quirk" while inverted
- block changing enabled channels' period
- document the hardware/driver limitations
- rearrange get_state() more logically
- fix cast sizes in get_state()
- fix remove() and probe error paths
- delete mchp_core_pwm_registers
- simplify .apply() logic
- don't warn in calculate_base()
- fix period calculation
- fix duty cycle calculation
- add COREPWM prefix to defines
- add a documentation link

Conor Dooley (2):
  pwm: add microchip soft ip corePWM driver
  MAINTAINERS: add pwm to PolarFire SoC entry

 MAINTAINERS                      |   1 +
 drivers/pwm/Kconfig              |  10 +
 drivers/pwm/Makefile             |   1 +
 drivers/pwm/pwm-microchip-core.c | 310 +++++++++++++++++++++++++++++++
 4 files changed, 322 insertions(+)
 create mode 100644 drivers/pwm/pwm-microchip-core.c


base-commit: 61114e734ccb804bc12561ab4020745e02c468c2
-- 
2.36.1


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

end of thread, other threads:[~2022-06-15 19:21 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-13 11:17 [PATCH v2 0/2] Add support for Microchip's pwm fpga core Conor Dooley
2022-06-13 11:17 ` [PATCH v2 1/2] pwm: add microchip soft ip corePWM driver Conor Dooley
2022-06-14 10:25   ` kernel test robot
2022-06-14 10:34     ` Conor.Dooley
2022-06-14 12:13       ` Uwe Kleine-König
2022-06-14 12:16         ` Conor.Dooley
2022-06-14 12:34   ` Uwe Kleine-König
2022-06-14 12:38     ` Conor.Dooley
2022-06-15 19:14   ` kernel test robot
2022-06-15 19:20     ` Conor.Dooley
2022-06-13 11:18 ` [PATCH v2 2/2] MAINTAINERS: add pwm to PolarFire SoC entry Conor Dooley
2022-06-13 11:56 ` [PATCH v2 0/2] Add support for Microchip's pwm fpga core Conor.Dooley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).