[PATCH v3 7/9] spi: ti-qspi: Implement the spi_mem interface

Boris Brezillon boris.brezillon at bootlin.com
Thu Apr 26 02:28:55 PDT 2018


On Thu, 26 Apr 2018 14:40:41 +0530
Vignesh R <vigneshr at ti.com> wrote:

> > +static int ti_qspi_exec_mem_op(struct spi_mem *mem,
> > +			       const struct spi_mem_op *op)
> > +{
> > +	struct ti_qspi *qspi = spi_master_get_devdata(mem->spi->master);
> > +	u32 from = 0;
> > +	int ret = 0;
> > +
> > +	/* Only optimize read path. */
> > +	if (!op->data.nbytes || op->data.dir != SPI_MEM_DATA_IN ||
> > +	    !op->addr.nbytes || op->addr.nbytes > 4)
> > +		return -ENOTSUPP;
> > +
> > +	/* Address exceeds MMIO window size, fall back to regular mode. */
> > +	from = op->addr.val;
> > +	if (from + op->data.nbytes > qspi->mmap_size)
> > +		return -ENOTSUPP;
> > +  
> 
> qspi->mmap_size turns out to be 0 if qspi->rx_chan is not NULL
> (in other words when DMA is used)
> Could you squash below diff into this patch?

Will do.

Thanks,

Boris



More information about the linux-mtd mailing list