mbox series

[v6,00/10] Designware PWM driver updates for OF

Message ID 20221020151610.59443-1-ben.dooks@sifive.com
Headers show
Series Designware PWM driver updates for OF | expand

Message

Ben Dooks Oct. 20, 2022, 3:16 p.m. UTC
This is an updated version of the Designware PWM driver updates
for OF support, which now splits the driver into PCI and OF parts
as well as tries to sort out the review comments.

Hopefully this can now be queued for the next kernel version.

v6:
 - fix removal ordering of DWC_PERIOD_NS
v5:
 - fixed kconfig string error
 - merged pwm-nr into main of code
 - split of code from pci code
 - updated pwm-nr capping
 - fix duplicate error reporting in of-code
 - fix return in of-probe
 - remove unecessary remove function as devm_ functions sort this
 - fixed ordering of properties
 - added missing reg item
 - fixed missing split of the two clock sources.
 - get bus clock in of code
v4:
 - split pci and of into new modules
 - fixup review comments
 - fix typos in dt-bindings
v3:
- change the compatible name
- squash down pwm count patch
- fixup patch naming
v2:
- fix #pwm-cells count to be 3
- fix indetation 
- merge the two clock patches
- add HAS_IOMEM as a config dependency


Ben Dooks (10):
  dt-bindings: pwm: Document Synopsys DesignWare
    snps,pwm-dw-apb-timers-pwm2
  pwm: dwc: allow driver to be built with COMPILE_TEST
  pwm: dwc: change &pci->dev to dev in probe
  pwm: dwc: move memory alloc to own function
  pwm: dwc: use devm_pwmchip_add
  pwm: dwc: split pci out of core driver
  pwm: dwc: make timer clock configurable
  pwm: dwc: add of/platform support
  pwm: dwc: add PWM bit unset in get_state call
  pwm: dwc: use clock rate in hz to avoid rounding issues

 .../bindings/pwm/snps,dw-apb-timers-pwm2.yaml |  68 ++++++
 drivers/pwm/Kconfig                           |  24 +-
 drivers/pwm/Makefile                          |   2 +
 drivers/pwm/pwm-dwc-of.c                      |  76 +++++++
 drivers/pwm/pwm-dwc-pci.c                     | 134 +++++++++++
 drivers/pwm/pwm-dwc.c                         | 210 ++++--------------
 drivers/pwm/pwm-dwc.h                         |  59 +++++
 7 files changed, 402 insertions(+), 171 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/pwm/snps,dw-apb-timers-pwm2.yaml
 create mode 100644 drivers/pwm/pwm-dwc-of.c
 create mode 100644 drivers/pwm/pwm-dwc-pci.c
 create mode 100644 drivers/pwm/pwm-dwc.h

Comments

Jarkko Nikula Oct. 24, 2022, 8:39 a.m. UTC | #1
Hi

On 10/20/22 18:16, Ben Dooks wrote:
> This is an updated version of the Designware PWM driver updates
> for OF support, which now splits the driver into PCI and OF parts
> as well as tries to sort out the review comments.
> 
> Hopefully this can now be queued for the next kernel version.
> 
> v6:
>   - fix removal ordering of DWC_PERIOD_NS

I did a quick test on our HW and PWM was counting as before.

Tested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Ben Dooks Oct. 24, 2022, 3:40 p.m. UTC | #2
On 24/10/2022 09:39, Jarkko Nikula wrote:
> Hi
> 
> On 10/20/22 18:16, Ben Dooks wrote:
>> This is an updated version of the Designware PWM driver updates
>> for OF support, which now splits the driver into PCI and OF parts
>> as well as tries to sort out the review comments.
>>
>> Hopefully this can now be queued for the next kernel version.
>>
>> v6:
>>   - fix removal ordering of DWC_PERIOD_NS
> 
> I did a quick test on our HW and PWM was counting as before.
> 
> Tested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>

Ok, great to hear, thank you.

I guess I should sort out putting a v7 out this week with all
the updated comments.
Ben Dooks Nov. 8, 2022, 11:19 a.m. UTC | #3
On 24/10/2022 09:39, Jarkko Nikula wrote:
> Hi
> 
> On 10/20/22 18:16, Ben Dooks wrote:
>> This is an updated version of the Designware PWM driver updates
>> for OF support, which now splits the driver into PCI and OF parts
>> as well as tries to sort out the review comments.
>>
>> Hopefully this can now be queued for the next kernel version.
>>
>> v6:
>>   - fix removal ordering of DWC_PERIOD_NS
> 
> I did a quick test on our HW and PWM was counting as before.
> 
> Tested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>

Just to follow up on this, should I post a v7 of this (given
I think it is all just updates for review/tested) ?
Uwe Kleine-König Nov. 8, 2022, 11:48 a.m. UTC | #4
On Tue, Nov 08, 2022 at 11:19:44AM +0000, Ben Dooks wrote:
> On 24/10/2022 09:39, Jarkko Nikula wrote:
> > Hi
> > 
> > On 10/20/22 18:16, Ben Dooks wrote:
> > > This is an updated version of the Designware PWM driver updates
> > > for OF support, which now splits the driver into PCI and OF parts
> > > as well as tries to sort out the review comments.
> > > 
> > > Hopefully this can now be queued for the next kernel version.
> > > 
> > > v6:
> > >   - fix removal ordering of DWC_PERIOD_NS
> > 
> > I did a quick test on our HW and PWM was counting as before.
> > 
> > Tested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
> 
> Just to follow up on this, should I post a v7 of this (given
> I think it is all just updates for review/tested) ?

Just to add the tags doesn't justify a resend.

Reviewing this is in my todo list, I hope to come to it later this week.

Best regards
Uwe