Skip to content

Commit ef13561

Browse files
ConchuODbroonie
authored andcommitted
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: 8596124 ("spi: microchip-core-qspi: Add support for microchip fpga qspi controllers") Signed-off-by: Conor Dooley <conor.dooley@microchip.com> Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org> Link: https://lore.kernel.org/r/20240508-fox-unpiloted-b97e1535627b@spud Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 52b62e7 commit ef13561

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/spi/spi-microchip-core-qspi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ static int mchp_coreqspi_setup_clock(struct mchp_coreqspi *qspi, struct spi_devi
283283
}
284284

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

0 commit comments

Comments
 (0)