mpc8xxx_spi->tx_len = mpc8xxx_spi->rxskip;
mpc8xxx_spi->rx_len = t->len - mpc8xxx_spi->rxskip;
mpc8xxx_spi->rx = t->rx_buf + mpc8xxx_spi->rxskip;
+ if (t->rx_nbits == SPI_NBITS_DUAL)
+ spcom |= SPCOM_DO;
}
fsl_espi_write_reg(mpc8xxx_spi, ESPI_SPCOM, spcom);
int ret;
mspi->rxskip = fsl_espi_check_rxskip_mode(m);
+ if (trans->rx_nbits == SPI_NBITS_DUAL && !mspi->rxskip) {
+ dev_err(mspi->dev, "Dual output mode requires RXSKIP mode!\n");
+ return -EINVAL;
+ }
+
fsl_espi_copy_to_buf(m, mspi);
fsl_espi_setup_transfer(spi, trans);
struct spi_message *m)
{
struct mpc8xxx_spi *mspi = spi_master_get_devdata(m->spi->master);
- unsigned int delay_usecs = 0;
+ unsigned int delay_usecs = 0, rx_nbits = 0;
struct spi_transfer *t, trans = {};
int ret;
list_for_each_entry(t, &m->transfers, transfer_list) {
if (t->delay_usecs > delay_usecs)
delay_usecs = t->delay_usecs;
+ if (t->rx_nbits > rx_nbits)
+ rx_nbits = t->rx_nbits;
}
t = list_first_entry(&m->transfers, struct spi_transfer,
trans.delay_usecs = delay_usecs;
trans.tx_buf = mspi->local_buf;
trans.rx_buf = mspi->local_buf;
+ trans.rx_nbits = rx_nbits;
if (trans.len)
ret = fsl_espi_trans(m, &trans);
mpc8xxx_spi_probe(dev, mem, irq);
+ master->mode_bits |= SPI_RX_DUAL;
master->bits_per_word_mask = SPI_BPW_RANGE_MASK(4, 16);
master->setup = fsl_espi_setup;
master->cleanup = fsl_espi_cleanup;