linux icon indicating copy to clipboard operation
linux copied to clipboard

Add AXI PWM generator driver to mainline - MMIO regmap version

Open threexc opened this issue 2 years ago • 7 comments

This is a continuation of the work in https://github.com/analogdevicesinc/linux/pull/2363, with the following changes:

  • use of MMIO regmap and sanity checking of the clk rate as discussed in #2363
  • use of dev_err_probe in the probe and setup functions
  • Some cleanup (mostly with checkpatch and review from @dlech)

I've copied the previous reviewer list and added @pdp7. As before, the axi-pwmgen driver is related to the SPI offload upstreaming that @dlech has been doing in https://github.com/analogdevicesinc/linux/pull/2341 as both are required to upstream drivers like the ad400x.

Checkpatch still throws a warning for a handful of the error messages due to line length, but I have left them intact so they're searchable.

threexc avatar Jan 11 '24 13:01 threexc

Pushed another minor change to fix the binding example.

threexc avatar Jan 11 '24 19:01 threexc

With both reviews I think this is good to go now, but I'll leave it open until next week in case there's any more feedback.

threexc avatar Jan 12 '24 12:01 threexc

I've pushed an update to the branch covering almost everything, except for the question for @acostina and the question about Kconfig dependency (which I want to look more into).

threexc avatar Jan 18 '24 17:01 threexc

Added a change to print out the clk rate if it's invalid and changed the prefix for the _put function. Also pushed another change just now to remove the max register after David pointed out this PR: https://github.com/analogdevicesinc/hdl/pull/1213

The hard limit on number of PWMs was already removed previously.

threexc avatar Jan 19 '24 19:01 threexc

Pushed another version that checks the IP core version by reading AXI_PWMGEN_REG_CORE_VERSION. Based on https://github.com/analogdevicesinc/linux/pull/2404

threexc avatar Jan 22 '24 19:01 threexc

Pushed a new version that checks the CORE_MAGIC value, and uses the correct value (0x601A3471, not 0x504C5347 as per the wiki). I tried updating the wiki page, but I can't seem to find/access the regmap resource that the page is embedding.

threexc avatar Jan 22 '24 20:01 threexc

Latest push changes axi_pwmgen_apply so that it only does all of the rounding if the device is actually enabled. This was a bug that was causing issues when removing and re-initializing the driver.

threexc avatar Jan 23 '24 18:01 threexc

We can probably close this one since discussions are happening on the upstream mailing lists now instead of here.

dlech avatar May 15 '24 16:05 dlech

Good point, closing.

threexc avatar May 15 '24 16:05 threexc