Unverified Commit ef13561d authored by Conor Dooley's avatar Conor Dooley Committed by Mark Brown
Browse files

spi: microchip-core-qspi: fix setting spi bus clock rate



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: stable@vger.kernel.org
Fixes: 8596124c ("spi: microchip-core-qspi: Add support for microchip fpga qspi controllers")
Signed-off-by: default avatarConor Dooley <conor.dooley@microchip.com>
Reviewed-by: default avatarTudor Ambarus <tudor.ambarus@linaro.org>
Link: https://lore.kernel.org/r/20240508-fox-unpiloted-b97e1535627b@spud


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 52b62e7a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -283,6 +283,7 @@ static int mchp_coreqspi_setup_clock(struct mchp_coreqspi *qspi, struct spi_devi
	}

	control = readl_relaxed(qspi->regs + REG_CONTROL);
	control &= ~CONTROL_CLKRATE_MASK;
	control |= baud_rate_val << CONTROL_CLKRATE_SHIFT;
	writel_relaxed(control, qspi->regs + REG_CONTROL);
	control = readl_relaxed(qspi->regs + REG_CONTROL);