[PATCH V1 4/5] spi: Add Freescale QuadSpi driver

Huang Shijie shijie8 at gmail.com
Sat Aug 24 09:42:03 EDT 2013


On Fri, Aug 23, 2013 at 05:44:42PM +0100, Mark Brown wrote:
> On Mon, Aug 19, 2013 at 12:10:02PM +0800, Huang Shijie wrote:
> 
> > +static int fsl_qspi_nor_do_one_msg(struct spi_master *master,
> > +		struct spi_message *m)
> > +{
> > +	struct fsl_qspi *q = spi_master_get_devdata(master);
> > +	struct spi_transfer *t;
> > +	int ret = 0;
> > +
> > +	list_for_each_entry(t, &m->transfers, transfer_list) {
> > +		if (t->rx_buf && t->tx_buf) {
> > +			dev_err(q->dev,
> > +				"Can't send and receive simultaneously\n");
> > +			ret = -EINVAL;
> > +			break;
> > +		}
> > +
> > +		if (t->tx_buf) {
> > +			ret = fsl_qspi_nor_tx(q, t);
> > +			if (!ret)
> > +				m->actual_length += t->len;
> > +			continue;
> > +		}
> > +
> > +		if (t->rx_buf) {
> > +			ret = fsl_qspi_nor_rx(q, t);
> > +			if (!ret)
> > +				m->actual_length += t->len;
> > +		}
> > +	}
> 
> The driver should flag SPI_HALF_DUPLEX since it doesn't support
> simultaneous RX and TX.
> 
okay, i will add the flag in the next version.


thanks
Huang Shijie



More information about the linux-arm-kernel mailing list