lkml.org 
[lkml]   [2018]   [Aug]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2] spi: dw: support 4-16 bits per word
On Fri, Aug 17, 2018 at 6:32 PM Trent Piepho <tpiepho@impinj.com> wrote:
>
> On Fri, 2018-08-17 at 09:01 +0200, Simon Goldschmidt wrote:
> > The spi-dw driver currently only supports 8 or 16 bits per word.
> >
> > Since the hardware supports 4-16 bits per word, adapt the driver
> > to also support this.
> >
> >
>
> > @@ -307,15 +307,13 @@ static int dw_spi_transfer_one(struct spi_controller *master,
> > +
> > + if ((transfer->bits_per_word < 4) || (transfer->bits_per_word > 16))
> > return -EINVAL;
> > - }
>
> You don't need this check as the spi core validates the transfer
> against master->bits_per_word_mask.

Ok.

>
> > master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_LOOP;
> > - master->bits_per_word_mask = SPI_BPW_MASK(8) | SPI_BPW_MASK(16);
> > + master->bits_per_word_mask = SPI_BPW_RANGE_MASK(4, 16);
> > master->bus_num = dws->bus_num;
> >

\
 
 \ /
  Last update: 2018-08-18 10:38    [W:0.083 / U:10.600 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site