Skip to content

Commit 78b0517

Browse files
Amit Kumar Mahapatrabroonie
authored andcommitted
spi: spi-cadence: Enable spi refclk in slave mode
When spi-cadence is configured as a slave, it requires the SPI refclk to detect the synchronization start condition while communicating with the master. However, the spi-cadence driver never enables the SPI refclk in slave mode, causing the refclk to remain disabled if the "clk_ignore_unused" kernel parameter is not passed through bootargs. As a result, the slave cannot detect data sent by the master, leading to communication failure. Update driver to enable the SPI refclk in both master and slave configurations. Fixes: b1b9051 ("spi: spi-cadence: Add support for Slave mode") Signed-off-by: Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com> Link: https://msgid.link/r/20240617153837.29861-1-amit.kumar-mahapatra@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 6914ee9 commit 78b0517

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

drivers/spi/spi-cadence.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -601,14 +601,14 @@ static int cdns_spi_probe(struct platform_device *pdev)
601601
reset_control_assert(xspi->rstc);
602602
reset_control_deassert(xspi->rstc);
603603

604-
if (!spi_controller_is_target(ctlr)) {
605-
xspi->ref_clk = devm_clk_get_enabled(&pdev->dev, "ref_clk");
606-
if (IS_ERR(xspi->ref_clk)) {
607-
dev_err(&pdev->dev, "ref_clk clock not found.\n");
608-
ret = PTR_ERR(xspi->ref_clk);
609-
goto remove_ctlr;
610-
}
604+
xspi->ref_clk = devm_clk_get_enabled(&pdev->dev, "ref_clk");
605+
if (IS_ERR(xspi->ref_clk)) {
606+
dev_err(&pdev->dev, "ref_clk clock not found.\n");
607+
ret = PTR_ERR(xspi->ref_clk);
608+
goto remove_ctlr;
609+
}
611610

611+
if (!spi_controller_is_target(ctlr)) {
612612
pm_runtime_use_autosuspend(&pdev->dev);
613613
pm_runtime_set_autosuspend_delay(&pdev->dev, SPI_AUTOSUSPEND_TIMEOUT);
614614
pm_runtime_get_noresume(&pdev->dev);

0 commit comments

Comments
 (0)