diff mbox series

[v1,6/8] spi: dw: Add mem_ops

Message ID BY5PR12MB4034E42E0A7A3828064BDAE6DEFD0@BY5PR12MB4034.namprd12.prod.outlook.com
State New
Headers show
Series None | expand

Commit Message

Eugeniy Paltsev March 12, 2020, 4:01 p.m. UTC
Hi Sean,

even after fixing build errors with this patch I still have issues with communications to flash IC.

Now it is detected correctly (JEDEC id is valid) but I have issues with read or write.
I need to look to that more intently. 

---
 Eugeniy Paltsev
diff mbox series

Patch

diff --git a/drivers/spi/designware_spi.c b/drivers/spi/designware_spi.c
index 298d1dbab5..a4e3dbd948 100644
--- a/drivers/spi/designware_spi.c
+++ b/drivers/spi/designware_spi.c
@@ -517,6 +517,8 @@  static int dw_spi_exec_op(struct spi_slave *slave, const struct spi_mem_op *op)
        if (op->dummy.nbytes)
                memset(op_buf + pos, 0xff, op->dummy.nbytes);

+       external_cs_manage(dev, false);
+
        priv->tx = &op_buf;
        priv->tx_end = priv->tx + op_len;
        priv->rx = NULL;
@@ -586,6 +588,8 @@  static int dw_spi_exec_op(struct spi_slave *slave, const struct spi_mem_op *op)
        }

        dw_write(priv, DW_SPI_SER, 0);
+       external_cs_manage(dev, true);
+
        debug("%s: %u bytes xfered\n", __func__, op->data.nbytes);
        return ret;
 }