| From c62312944cf8a80a0514111c71e04e6ca7e3bc6e Mon Sep 17 00:00:00 2001 |
| From: Huanpeng Xin <huanpeng.xin@unisoc.com> |
| Date: Wed, 4 Dec 2019 15:13:59 +0800 |
| Subject: [PATCH] spi: sprd: Fix the incorrect SPI register |
| |
| commit 5e9c5236b7b86779b53b762f7e66240c3f18314b upstream. |
| |
| The original code used an incorrect SPI register to initialize the SPI |
| controller in sprd_spi_init_hw(), thus fix it. |
| |
| Fixes: e7d973a31c24 ("spi: sprd: Add SPI driver for Spreadtrum SC9860") |
| Signed-off-by: Huanpeng Xin <huanpeng.xin@unisoc.com> |
| Signed-off-by: Baolin Wang <baolin.wang7@gmail.com> |
| Link: https://lore.kernel.org/r/b4f7f89ec0fdc595335687bfbd9f962213bc4a1d.1575443510.git.baolin.wang7@gmail.com |
| Signed-off-by: Mark Brown <broonie@kernel.org> |
| Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> |
| |
| diff --git a/drivers/spi/spi-sprd.c b/drivers/spi/spi-sprd.c |
| index 1b7eebb72c07..12ee921204d8 100644 |
| --- a/drivers/spi/spi-sprd.c |
| +++ b/drivers/spi/spi-sprd.c |
| @@ -674,7 +674,7 @@ static void sprd_spi_init_hw(struct sprd_spi *ss, struct spi_transfer *t) |
| u16 word_delay, interval; |
| u32 val; |
| |
| - val = readl_relaxed(ss->base + SPRD_SPI_CTL7); |
| + val = readl_relaxed(ss->base + SPRD_SPI_CTL0); |
| val &= ~(SPRD_SPI_SCK_REV | SPRD_SPI_NG_TX | SPRD_SPI_NG_RX); |
| /* Set default chip selection, clock phase and clock polarity */ |
| val |= ss->hw_mode & SPI_CPHA ? SPRD_SPI_NG_RX : SPRD_SPI_NG_TX; |
| -- |
| 2.7.4 |
| |