lkml.org 
[lkml]   [2016]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] spi: spi-ti-qspi: clear wlen field while setting word length.
From
Date
Hi Prahlad,

On Sunday 10 July 2016 01:35 AM, Prahlad V wrote:
> When a word length of 1 byte is selected and writing data of length
> more than QSPI_WLEN_MAX_BYTES, first MAX_BYTES will be transfered
> and remaining will be transfered byte by byte. In that case wlen
> field should be cleared before setting.
>
> Signed-off-by: Prahlad V <prahlad.eee@gmail.com>
> ---
> drivers/spi/spi-ti-qspi.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/spi/spi-ti-qspi.c b/drivers/spi/spi-ti-qspi.c
> index 29ea8d2..6c61f54 100644
> --- a/drivers/spi/spi-ti-qspi.c
> +++ b/drivers/spi/spi-ti-qspi.c
> @@ -276,9 +276,9 @@ static int qspi_write_msg(struct ti_qspi *qspi, struct spi_transfer *t,
> cmd |= QSPI_WLEN(QSPI_WLEN_MAX_BITS);
> } else {
> writeb(*txbuf, qspi->base + QSPI_SPI_DATA_REG);
> - cmd = qspi->cmd | QSPI_WR_SNGL;

qspi->cmd always has WLEN field cleared and set to WLEN = 1 byte (see
ti_qspi_start_transfer_one()). And hence variable 'cmd' will also have
WLEN set to 1 byte.

> xfer_len = wlen;
> - cmd |= QSPI_WLEN(wlen);
> + cmd = ((qspi->cmd & ~QSPI_WLEN_MASK) |
> + QSPI_WLEN(wlen));

So, this won't be necessary.

--
Regards
Vignesh

\
 
 \ /
  Last update: 2016-07-11 07:41    [W:0.165 / U:0.420 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site