spi: dw: Fix typo in few registers name
authorWan Ahmad Zainie <wan.ahmad.zainie.wan.mohamad@intel.com>
Tue, 5 May 2020 13:06:12 +0000 (21:06 +0800)
committerMark Brown <broonie@kernel.org>
Tue, 5 May 2020 14:07:57 +0000 (15:07 +0100)
This patch will fix typo in the register name used in the source code,
to be consistent with the register name used in the databook.

Databook: DW_apb_ssi_databook.pdf version 4.01a

Signed-off-by: Wan Ahmad Zainie <wan.ahmad.zainie.wan.mohamad@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20200505130618.554-2-wan.ahmad.zainie.wan.mohamad@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-dw.c
drivers/spi/spi-dw.h

index 2b79c5a983c021c0549661b798e90e749407c402..72a1c99ce9e6b48ab931a51463ead25afeb1fc5d 100644 (file)
@@ -47,9 +47,9 @@ static ssize_t dw_spi_show_regs(struct file *file, char __user *user_buf,
        len += scnprintf(buf + len, SPI_REGS_BUFSIZE - len,
                        "=================================\n");
        len += scnprintf(buf + len, SPI_REGS_BUFSIZE - len,
-                       "CTRL0: \t\t0x%08x\n", dw_readl(dws, DW_SPI_CTRL0));
+                       "CTRLR0: \t0x%08x\n", dw_readl(dws, DW_SPI_CTRLR0));
        len += scnprintf(buf + len, SPI_REGS_BUFSIZE - len,
-                       "CTRL1: \t\t0x%08x\n", dw_readl(dws, DW_SPI_CTRL1));
+                       "CTRLR1: \t0x%08x\n", dw_readl(dws, DW_SPI_CTRLR1));
        len += scnprintf(buf + len, SPI_REGS_BUFSIZE - len,
                        "SSIENR: \t0x%08x\n", dw_readl(dws, DW_SPI_SSIENR));
        len += scnprintf(buf + len, SPI_REGS_BUFSIZE - len,
@@ -57,9 +57,9 @@ static ssize_t dw_spi_show_regs(struct file *file, char __user *user_buf,
        len += scnprintf(buf + len, SPI_REGS_BUFSIZE - len,
                        "BAUDR: \t\t0x%08x\n", dw_readl(dws, DW_SPI_BAUDR));
        len += scnprintf(buf + len, SPI_REGS_BUFSIZE - len,
-                       "TXFTLR: \t0x%08x\n", dw_readl(dws, DW_SPI_TXFLTR));
+                       "TXFTLR: \t0x%08x\n", dw_readl(dws, DW_SPI_TXFTLR));
        len += scnprintf(buf + len, SPI_REGS_BUFSIZE - len,
-                       "RXFTLR: \t0x%08x\n", dw_readl(dws, DW_SPI_RXFLTR));
+                       "RXFTLR: \t0x%08x\n", dw_readl(dws, DW_SPI_RXFTLR));
        len += scnprintf(buf + len, SPI_REGS_BUFSIZE - len,
                        "TXFLR: \t\t0x%08x\n", dw_readl(dws, DW_SPI_TXFLR));
        len += scnprintf(buf + len, SPI_REGS_BUFSIZE - len,
@@ -304,7 +304,7 @@ static int dw_spi_transfer_one(struct spi_controller *master,
                        (((spi->mode & SPI_LOOP) ? 1 : 0) << SPI_SRL_OFFSET))
                | (chip->tmode << SPI_TMOD_OFFSET);
 
-       dw_writel(dws, DW_SPI_CTRL0, cr0);
+       dw_writel(dws, DW_SPI_CTRLR0, cr0);
 
        /* Check if current transfer is a DMA transaction */
        if (master->can_dma && master->can_dma(master, spi, transfer))
@@ -325,7 +325,7 @@ static int dw_spi_transfer_one(struct spi_controller *master,
                }
        } else {
                txlevel = min_t(u16, dws->fifo_len / 2, dws->len / dws->n_bytes);
-               dw_writel(dws, DW_SPI_TXFLTR, txlevel);
+               dw_writel(dws, DW_SPI_TXFTLR, txlevel);
 
                /* Set the interrupt mask */
                imask |= SPI_INT_TXEI | SPI_INT_TXOI |
@@ -397,11 +397,11 @@ static void spi_hw_init(struct device *dev, struct dw_spi *dws)
                u32 fifo;
 
                for (fifo = 1; fifo < 256; fifo++) {
-                       dw_writel(dws, DW_SPI_TXFLTR, fifo);
-                       if (fifo != dw_readl(dws, DW_SPI_TXFLTR))
+                       dw_writel(dws, DW_SPI_TXFTLR, fifo);
+                       if (fifo != dw_readl(dws, DW_SPI_TXFTLR))
                                break;
                }
-               dw_writel(dws, DW_SPI_TXFLTR, 0);
+               dw_writel(dws, DW_SPI_TXFTLR, 0);
 
                dws->fifo_len = (fifo == 1) ? 0 : fifo;
                dev_dbg(dev, "Detected FIFO size: %u bytes\n", dws->fifo_len);
index 44ef18187c15ec4d6f64ad86510de88c229dc84d..6c34720b1b1df2e29075edd603990e978769fcb2 100644 (file)
@@ -6,14 +6,14 @@
 #include <linux/scatterlist.h>
 
 /* Register offsets */
-#define DW_SPI_CTRL                  0x00
-#define DW_SPI_CTRL                  0x04
+#define DW_SPI_CTRLR0                  0x00
+#define DW_SPI_CTRLR1                  0x04
 #define DW_SPI_SSIENR                  0x08
 #define DW_SPI_MWCR                    0x0c
 #define DW_SPI_SER                     0x10
 #define DW_SPI_BAUDR                   0x14
-#define DW_SPI_TXFLTR                  0x18
-#define DW_SPI_RXFLTR                  0x1c
+#define DW_SPI_TXFTLR                  0x18
+#define DW_SPI_RXFTLR                  0x1c
 #define DW_SPI_TXFLR                   0x20
 #define DW_SPI_RXFLR                   0x24
 #define DW_SPI_SR                      0x28