clk: axi-clkgen: wrap limits in a struct and keep copy on the state object
authorAlexandru Ardelean <alexandru.ardelean@analog.com>
Thu, 3 Dec 2020 07:40:36 +0000 (09:40 +0200)
committerStephen Boyd <sboyd@kernel.org>
Thu, 17 Dec 2020 09:52:54 +0000 (01:52 -0800)
commitac1ee86a9cdb002b0c130cfbad668dd992a0596a
treeb19551523d759db2df7a94393566e2d0cb401f22
parentbd91abb218e0ac4a7402d6c25d383e2a706bb511
clk: axi-clkgen: wrap limits in a struct and keep copy on the state object

Up until the these limits were global/hard-coded, since they are typically
limits of the fabric.

However, since this is an FPGA generated clock, this may run on setups
where one clock is on a fabric, and another one synthesized on another
fabric connected via PCIe (or some other inter-connect, and then these
limits need to be adjusted for each instance of the AXI CLKGEN.

This change wraps the current constants in 'axi_clkgen_limits' struct and
the 'axi_clkgen' instance keeps a copy of these limits, which is
initialized at probe from the default limits.

The limits are stored on the device-tree OF table, so that we can adjust
them via the compatible string.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20201203074037.26940-1-alexandru.ardelean@analog.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/clk-axi-clkgen.c