Add AXI PWM generator driver to mainline - MMIO regmap version
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.
Pushed another minor change to fix the binding example.
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.
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).
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.
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
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.
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.
We can probably close this one since discussions are happening on the upstream mailing lists now instead of here.
Good point, closing.