Commit 8f8303ee authored by Vladimir Oltean's avatar Vladimir Oltean Committed by Mark Brown

spi: spi-fsl-dspi: Add comments around dspi_pop_tx and dspi_push_rx functions

Their names are confusing, since dspi_pop_tx prepares a word to be
written to the PUSHR register, and dspi_push_rx gets a word from the
POPR register.
Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Link: https://lore.kernel.org/r/20200304220044.11193-5-olteanv@gmail.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 5542bd79
...@@ -245,6 +245,10 @@ struct fsl_dspi { ...@@ -245,6 +245,10 @@ struct fsl_dspi {
struct fsl_dspi_dma *dma; struct fsl_dspi_dma *dma;
}; };
/*
* Pop one word from the TX buffer for pushing into the
* PUSHR register (TX FIFO)
*/
static u32 dspi_pop_tx(struct fsl_dspi *dspi) static u32 dspi_pop_tx(struct fsl_dspi *dspi)
{ {
u32 txdata = 0; u32 txdata = 0;
...@@ -257,6 +261,7 @@ static u32 dspi_pop_tx(struct fsl_dspi *dspi) ...@@ -257,6 +261,7 @@ static u32 dspi_pop_tx(struct fsl_dspi *dspi)
return txdata; return txdata;
} }
/* Prepare one TX FIFO entry (txdata plus cmd) */
static u32 dspi_pop_tx_pushr(struct fsl_dspi *dspi) static u32 dspi_pop_tx_pushr(struct fsl_dspi *dspi)
{ {
u16 cmd = dspi->tx_cmd, data = dspi_pop_tx(dspi); u16 cmd = dspi->tx_cmd, data = dspi_pop_tx(dspi);
...@@ -269,6 +274,7 @@ static u32 dspi_pop_tx_pushr(struct fsl_dspi *dspi) ...@@ -269,6 +274,7 @@ static u32 dspi_pop_tx_pushr(struct fsl_dspi *dspi)
return cmd << 16 | data; return cmd << 16 | data;
} }
/* Push one word to the RX buffer from the POPR register (RX FIFO) */
static void dspi_push_rx(struct fsl_dspi *dspi, u32 rxdata) static void dspi_push_rx(struct fsl_dspi *dspi, u32 rxdata)
{ {
if (!dspi->rx) if (!dspi->rx)
......
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