]> git.sur5r.net Git - u-boot/commitdiff
spi: Use mode instead of op_mode_tx
authorJagan Teki <jteki@openedev.com>
Sun, 13 Dec 2015 14:40:33 +0000 (20:10 +0530)
committerJagan Teki <jteki@openedev.com>
Wed, 13 Jan 2016 13:17:25 +0000 (18:47 +0530)
Used mode member from spi_slave{} instead of op_mode_tx.

Cc: Simon Glass <sjg@chromium.org>
Tested-by: Jagan Teki <jteki@openedev.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Jagan Teki <jteki@openedev.com>
drivers/mtd/spi/sf_probe.c
drivers/mtd/spi/spi_flash.c
drivers/spi/ich.c
include/spi.h

index 0cafc291230c2aba8a76576d242b158e73dbd4fa..3519ffdc77406414401c4561a5ebd055dcc734e2 100644 (file)
@@ -128,7 +128,7 @@ static int spi_flash_std_write(struct udevice *dev, u32 offset, size_t len,
 
 #if defined(CONFIG_SPI_FLASH_SST)
        if (flash->flags & SNOR_F_SST_WR) {
-               if (flash->spi->op_mode_tx & SPI_OPM_TX_BP)
+               if (flash->spi->mode & SPI_TX_BP)
                        return sst_write_bp(flash, offset, len, buf);
                else
                        return sst_write_wp(flash, offset, len, buf);
index 7755c4d6fef474a5af45f8c772c135994998805c..59e91ec071982b4b8c870cd45852b70b0aeebe7f 100644 (file)
@@ -968,7 +968,7 @@ int spi_flash_scan(struct spi_flash *flash)
        flash->write = spi_flash_cmd_write_ops;
 #if defined(CONFIG_SPI_FLASH_SST)
        if (flash->flags & SNOR_F_SST_WR) {
-               if (spi->op_mode_tx & SPI_OPM_TX_BP)
+               if (spi->mode & SPI_TX_BP)
                        flash->write = sst_write_bp;
                else
                        flash->write = sst_write_wp;
@@ -1042,7 +1042,7 @@ int spi_flash_scan(struct spi_flash *flash)
        }
 
        /* Not require to look for fastest only two write cmds yet */
-       if (params->flags & WR_QPP && spi->op_mode_tx & SPI_OPM_TX_QPP)
+       if (params->flags & WR_QPP && spi->mode & SPI_TX_QPP)
                flash->write_cmd = CMD_QUAD_PAGE_PROGRAM;
        else
                /* Go for default supported write cmd */
index f85af9c9fb9528bef4ec3ebd4ad10693c1be8188..64322dd2bba4f677f489339bda2520cc86d81dc4 100644 (file)
@@ -753,7 +753,7 @@ static int ich_spi_child_pre_probe(struct udevice *dev)
         */
        if (plat->ich_version == 7) {
                slave->op_mode_rx = SPI_OPM_RX_AS;
-               slave->op_mode_tx = SPI_OPM_TX_BP;
+               slave->mode = SPI_TX_BP;
        }
 
        return 0;
index 05202d05c5192db0115c78bd66848f337737d27e..67521721ee076a9a07653b4ecb6af0419116deaa 100644 (file)
@@ -23,6 +23,8 @@
 #define        SPI_LOOP        0x20                    /* loopback mode */
 #define        SPI_SLAVE       0x40                    /* slave mode */
 #define        SPI_PREAMBLE    0x80                    /* Skip preamble bytes */
+#define SPI_TX_BP      0x100                   /* transmit with 1 wire byte */
+#define SPI_TX_QPP     0x200                   /* transmit with 4 wires */
 
 /* SPI transfer flags */
 #define SPI_XFER_BEGIN         0x01    /* Assert CS before transfer */
 #define SPI_XFER_ONCE          (SPI_XFER_BEGIN | SPI_XFER_END)
 #define SPI_XFER_U_PAGE        (1 << 5)
 
-/* SPI TX operation modes */
-#define SPI_OPM_TX_QPP         (1 << 0)
-#define SPI_OPM_TX_BP          (1 << 1)
-
 /* SPI RX operation modes */
 #define SPI_OPM_RX_AS          (1 << 0)
 #define SPI_OPM_RX_AF          (1 << 1)
@@ -107,7 +105,6 @@ struct dm_spi_slave_platdata {
  * @cs:                        ID of the chip select connected to the slave.
  * @mode:              SPI mode to use for this slave (see SPI mode flags)
  * @op_mode_rx:                SPI RX operation mode.
- * @op_mode_tx:                SPI TX operation mode.
  * @wordlen:           Size of SPI word in number of bits
  * @max_write_size:    If non-zero, the maximum number of bytes which can
  *                     be written at once, excluding command bytes.
@@ -126,7 +123,6 @@ struct spi_slave {
 #endif
        uint mode;
        u8 op_mode_rx;
-       u8 op_mode_tx;
        unsigned int wordlen;
        unsigned int max_write_size;
        void *memory_map;