Commit b66d8a99 authored by Federico Vaga's avatar Federico Vaga

sw:drv:spi: add debug message on TX/RX

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent e02bbfc4
......@@ -159,6 +159,8 @@ static void spi_ocores_tx_set(struct spi_ocores *sp,
return;
sp->write(sp, val, SPI_OCORES_TX(idx));
dev_dbg(&sp->master->dev, "%s {index: %d data: 0x%x}\n",
__func__, idx, val);
}
/**
......@@ -166,11 +168,17 @@ static void spi_ocores_tx_set(struct spi_ocores *sp,
*/
static uint32_t spi_ocores_rx_get(struct spi_ocores *sp, unsigned int idx)
{
uint32_t val;
if (WARN(idx > 3, "Invalid RX register index %d (min:0, max: 3)\n",
idx))
return 0;
return sp->read(sp, SPI_OCORES_RX(idx));
val = sp->read(sp, SPI_OCORES_RX(idx));
dev_dbg(&sp->master->dev, "%s {index: %d data: 0x%x}\n",
__func__, idx, val);
return val;
}
/**
......
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