[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1534523550.2283.397.camel@impinj.com>
Date: Fri, 17 Aug 2018 16:32:31 +0000
From: Trent Piepho <tpiepho@...inj.com>
To: "linux-spi@...r.kernel.org" <linux-spi@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"simon.k.r.goldschmidt@...il.com" <simon.k.r.goldschmidt@...il.com>,
"andy.shevchenko@...il.com" <andy.shevchenko@...il.com>,
"broonie@...nel.org" <broonie@...nel.org>
Subject: Re: [PATCH v2] spi: dw: support 4-16 bits per word
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.
> 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;
>
Powered by blists - more mailing lists