]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
spi: cadence-qspi: Kill cqspi_jh7110_clk_init
authorMiquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com>
Thu, 5 Feb 2026 18:09:49 +0000 (19:09 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 5 Feb 2026 18:25:27 +0000 (18:25 +0000)
commit324ecc7788c2e21d0d9197a8c015ff75382122d9
tree90ce9fcc5ce8f4601ee897286f8a3e18a071f289
parent2b97f5cd1a956a9ac948ec57775600158988dadd
spi: cadence-qspi: Kill cqspi_jh7110_clk_init

This controller can be fed by either a main "ref" clock, or three clocks
("ref" again, "ahb", "apb"). In practice, it is likely that all
controllers have the same inputs, but a single clock feeds the three
interfaces (ref is used for controlling the external interface, ahb/apb
the internal ones). Handling these clocks is in no way SoC specific,
only the number of expected clocks may change. Plus, we will soon be
adding another controller requiring an AHB and an APB clock as well, so
it is time to align the whole clock handling.

Furthermore, the use of the cqspi_jh7110_clk_init() helper, which
specifically grabs and enables the "ahb" and "apb" clocks, is a bit
convoluted:
- only the JH7110 compatible provides the ->jh7110_clk_init() callback,
- in the probe, if the above callback is set in the driver data, the
  driver does not call the callback (!) but instead calls the helper
  directly (?),
- in the helper, the is_jh7110 boolean is set.

This logic does not make sense. Instead:
- in the probe, set the is_jh7110 boolean based on the compatible,
- collect all available clocks with the "bulk" helper,
- enable the extra clocks if they are available,
- kill the SoC specific cqspi_jh7110_clk_init() helper.

This also allows to group the clock handling instead of depending on the
driver data pointer, which further simplifies the error path and the
remove callback.

Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Miquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com>
Link: https://patch.msgid.link/20260205-schneider-6-19-rc1-qspi-v5-2-843632b3c674@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-cadence-quadspi.c