spi: dw-mid: change magic numbers to the constants
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 2 Oct 2014 13:31:07 +0000 (16:31 +0300)
committerMark Brown <broonie@kernel.org>
Thu, 2 Oct 2014 16:06:26 +0000 (17:06 +0100)
Instead of using magic numbers in the code we create a bit map definition of
the DMACR register and use it.

There is no functional change.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-dw-mid.c
drivers/spi/spi-dw.h

index ecae30fe28affccab3083a2ecac1f5c130562811..7bdf93747e5f11759fabe8ea83fcb7d3f7b553fc 100644 (file)
@@ -124,9 +124,9 @@ static int mid_spi_dma_transfer(struct dw_spi *dws, int cs_change)
                dw_writew(dws, DW_SPI_DMARDLR, 0xf);
                dw_writew(dws, DW_SPI_DMATDLR, 0x10);
                if (dws->tx_dma)
-                       dma_ctrl |= 0x2;
+                       dma_ctrl |= SPI_DMA_TDMAE;
                if (dws->rx_dma)
-                       dma_ctrl |= 0x1;
+                       dma_ctrl |= SPI_DMA_RDMAE;
                dw_writew(dws, DW_SPI_DMACR, dma_ctrl);
                spi_enable_chip(dws, 1);
        }
index 089fc4ba3aceddba8dac4e14a1d0398f8e6473fb..83a103a764817c62ea96cab2aa951332c5ca53c5 100644 (file)
 #define SPI_INT_RXFI                   (1 << 4)
 #define SPI_INT_MSTI                   (1 << 5)
 
+/* Bit fields in DMACR */
+#define SPI_DMA_RDMAE                  (1 << 0)
+#define SPI_DMA_TDMAE                  (1 << 1)
+
 /* TX RX interrupt level threshold, max can be 256 */
 #define SPI_INT_THRESHOLD              32