aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-microchip-core-qspi.c
diff options
context:
space:
mode:
authorConor Dooley <[email protected]>2024-05-08 15:46:51 +0000
committerMark Brown <[email protected]>2024-05-09 04:59:19 +0000
commitef13561d2b163ac0ae6befa53bca58a26dc3320b (patch)
tree3c5b547fea271f8eb307b12b926681cc4653fcd6 /drivers/spi/spi-microchip-core-qspi.c
parentspi: stm32: enable controller before asserting CS (diff)
downloadkernel-ef13561d2b163ac0ae6befa53bca58a26dc3320b.tar.gz
kernel-ef13561d2b163ac0ae6befa53bca58a26dc3320b.zip
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: [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]>
Diffstat (limited to 'drivers/spi/spi-microchip-core-qspi.c')
-rw-r--r--drivers/spi/spi-microchip-core-qspi.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/spi/spi-microchip-core-qspi.c b/drivers/spi/spi-microchip-core-qspi.c
index 03d125a71fd9..09f16471c537 100644
--- a/drivers/spi/spi-microchip-core-qspi.c
+++ b/drivers/spi/spi-microchip-core-qspi.c
@@ -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);