Commit e1a4591a authored by Yugi Sasaki's avatar Yugi Sasaki
Browse files

spi-ft232h: Add SEND_IMMEDIATE

Add SEND_IMMEDIAE(0x87) command after the RX and TXRX command
to reduce read-back latency.
parent 8d2d6cd0
......@@ -38,6 +38,7 @@
#define LOOPBACK_ON 0x84
#define LOOPBACK_OFF 0x85
#define TCK_DIVISOR 0x86
#define SEND_IMMEDIATE 0x87
#define DIS_DIV_5 0x8A
#define EN_DIV_5 0x8B
#define EN_3_PHASE 0x8C
......
......@@ -204,10 +204,11 @@ static int ftdi_spi_tx_rx(struct ftdi_spi *priv, struct spi_device *spi,
priv->xfer_buf[1] = stride - 1;
priv->xfer_buf[2] = (stride - 1) >> 8;
memcpy(&priv->xfer_buf[3], tx_offs, stride);
priv->xfer_buf[3 + stride] = SEND_IMMEDIATE;
print_hex_dump_debug("WR: ", DUMP_PREFIX_OFFSET, 16, 1,
priv->xfer_buf, stride + 3, 1);
ret = ops->write_data(priv->intf, priv->xfer_buf, stride + 3);
ret = ops->write_data(priv->intf, priv->xfer_buf, stride + 4);
if (ret < 0) {
dev_err(dev, "%s: xfer failed %d\n", __func__, ret);
goto fail;
......@@ -324,10 +325,10 @@ static int ftdi_spi_rx(struct ftdi_spi *priv, struct spi_transfer *xfer)
priv->xfer_buf[0] = priv->rx_cmd;
priv->xfer_buf[1] = xfer->len - 1;
priv->xfer_buf[2] = (xfer->len - 1) >> 8;
priv->xfer_buf[3] = SEND_IMMEDIATE;
ops->lock(priv->intf);
ret = ops->write_data(priv->intf, priv->xfer_buf, 3);
ret = ops->write_data(priv->intf, priv->xfer_buf, 4);
if (ret < 0)
goto err;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment