aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-microchip-core-qspi.c
Commit message (Collapse)AuthorAgeFilesLines
* spi: microchip-core-qspi: stop checking viability of op->max_freq in ↵Conor Dooley2025-08-291-12/+0
| | | | | | | | | | | | | | | | | | | | | | | supports_op callback In commit 13529647743d9 ("spi: microchip-core-qspi: Support per spi-mem operation frequency switches") the logic for checking the viability of op->max_freq in mchp_coreqspi_setup_clock() was copied into mchp_coreqspi_supports_op(). Unfortunately, op->max_freq is not valid when this function is called during probe but is instead zero. Accordingly, baud_rate_val is calculated to be INT_MAX due to division by zero, causing probe of the attached memory device to fail. Seemingly spi-microchip-core-qspi was the only driver that had such a modification made to its supports_op callback when the per_op_freq capability was added, so just remove it to restore prior functionality. CC: [email protected] Reported-by: Valentina Fernandez <[email protected]> Fixes: 13529647743d9 ("spi: microchip-core-qspi: Support per spi-mem operation frequency switches") Signed-off-by: Conor Dooley <[email protected]> Message-ID: <20250825-during-ploy-939bdd068593@spud> Signed-off-by: Mark Brown <[email protected]>
* spi: microchip-core-qspi: Add regular transfersCyril Jean2025-06-231-18/+199
| | | | | | | | | | | | The driver for CoreQSPI only supports memory operations at present, so add support for regular transfers so that the SD card slot and ADC on the BeagleV Fire can be used. Signed-off-by: Cyril Jean <[email protected]> Co-developed-by: Conor Dooley <[email protected]> Signed-off-by: Conor Dooley <[email protected]> Link: https://patch.msgid.link/20250620-splice-shelter-310771564886@spud Signed-off-by: Mark Brown <[email protected]>
* spi: microchip-core-qspi: remove unused param from mchp_coreqspi_write_op()Conor Dooley2025-06-231-4/+4
| | | | | | | | "word" is unused in mchp_coreqspi_write_op(), so delete it. Signed-off-by: Conor Dooley <[email protected]> Link: https://patch.msgid.link/20250620-starry-excusably-25e6be957d9d@spud Signed-off-by: Mark Brown <[email protected]>
* spi: microchip-core-qspi: set min_speed_hz during probeConor Dooley2025-06-231-0/+1
| | | | | | | | | | | The controller's minimum possible bus clock is 1/30 the rate of the input clock. Naively set the minimum bus clock speed the controller is capable of during probe, assuming that the rate will never reduce further. Signed-off-by: Conor Dooley <[email protected]> Link: https://patch.msgid.link/20250620-drained-widen-ac311bd5f172@spud Signed-off-by: Mark Brown <[email protected]>
* spi: microchip-core-qspi: Support per spi-mem operation frequency switchesMiquel Raynal2025-01-091-4/+22
| | | | | | | | | | | | | | | | | | | | | Every ->exec_op() call correctly configures the spi bus speed to the maximum allowed frequency for the memory using the constant spi default parameter. Since we can now have per-operation constraints, let's use the value that comes from the spi-mem operation structure instead. In case there is no specific limitation for this operation, the default spi device value will be given anyway. This controller however performed a frequency check, which is also observed during the ->check_op() phase. The per-operation frequency capability is thus advertised to the spi-mem core. Cc: Conor Dooley <[email protected]> Cc: Daire McNamara <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://patch.msgid.link/20241224-winbond-6-11-rc1-quad-support-v2-9-ad218dbc406f@bootlin.com Signed-off-by: Mark Brown <[email protected]>
* spi: Switch back to struct platform_driver::remove()Uwe Kleine-König2024-09-291-1/+1
| | | | | | | | | | | | | | | | | | | After commit 0edb555a65d1 ("platform: Make platform_driver::remove() return void") .remove() is (again) the right callback to implement for platform drivers. Convert all platform drivers below drivers/spi to use .remove(), with the eventual goal to drop struct platform_driver::remove_new(). As .remove() and .remove_new() have the same prototypes, conversion is done by just changing the structure member name in the driver initializer. The change for the spi-npcm-fiu stands out in the diffstat because the inconsistent formatting style of the platform_driver initializer is fixed to match the other struct initializer in the file. Signed-off-by: Uwe Kleine-König <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
* spi: microchip-core-qspi: fix setting spi bus clock rateConor Dooley2024-05-091-0/+1
| | | | | | | | | | | | | Before ORing the new clock rate with the control register value read from the hardware, the existing clock rate needs to be masked off as otherwise the existing value will interfere with the new one. CC: [email protected] Fixes: 8596124c4c1b ("spi: microchip-core-qspi: Add support for microchip fpga qspi controllers") Signed-off-by: Conor Dooley <[email protected]> Reviewed-by: Tudor Ambarus <[email protected]> Link: https://lore.kernel.org/r/20240508-fox-unpiloted-b97e1535627b@spud Signed-off-by: Mark Brown <[email protected]>
* spi: Use devm_clk_get_*() helper function toMark Brown2023-09-111-22/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge series from Li Zetao <[email protected]>: Commit 7ef9651e9792 ("clk: Provide new devm_clk helpers for prepared and enabled clocks") provides a new helper function for prepared and enabled clocks when a driver keeps a clock prepared (or enabled) during the whole lifetime of the driver. So where drivers get clocks and enable them immediately, it can be combined into a single function devm_clk_get_*(). Moreover, the unprepare and disable function has been registered to devm_clk_state, and before devm_clk_state is released, the clocks will be unprepareed and disable, so it is unnecessary to unprepare and disable clocks explicitly when remove drivers or in the error handling path.
| * spi: microchip-core-qspi: Use helper function devm_clk_get_enabled()Li Zetao2023-09-111-22/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 7ef9651e9792 ("clk: Provide new devm_clk helpers for prepared and enabled clocks"), devm_clk_get() and clk_prepare_enable() can now be replaced by devm_clk_get_enabled() when driver enables (and possibly prepares) the clocks for the whole lifetime of the device. Moreover, it is no longer necessary to unprepare and disable the clocks explicitly. Reviewed-by: Jonathan Cameron <[email protected]> Signed-off-by: Li Zetao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
* | spi: microchip-core-qspi: switch to use modern nameYang Yingliang2023-09-111-5/+5
|/ | | | | | | | | | Change legacy name master to modern name host or controller. No functional changed. Signed-off-by: Yang Yingliang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
* spi: microchip-core-qspi: Convert to platform remove callback returning voidUwe Kleine-König2023-03-061-4/+2
| | | | | | | | | | | | | | | | | | The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <[email protected]> Reviewed-by: Conor Dooley <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
* spi: microchip-core-qspi: Add support for microchip fpga qspi controllersNaga Sureshkumar Relli2022-08-151-0/+600
Add a driver for Microchip FPGA QSPI controllers. This driver also supports "hard" QSPI controllers on Polarfire SoC. Signed-off-by: Naga Sureshkumar Relli <[email protected]> Reviewed-by: Conor Dooley <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>