All of lore.kernel.org
 help / color / mirror / Atom feed
From: Trent Piepho <tpiepho@impinj.com>
To: "linux-spi@vger.kernel.org" <linux-spi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"simon.k.r.goldschmidt@gmail.com"
	<simon.k.r.goldschmidt@gmail.com>,
	"andy.shevchenko@gmail.com" <andy.shevchenko@gmail.com>,
	"broonie@kernel.org" <broonie@kernel.org>
Subject: Re: [PATCH v2] spi: dw: support 4-16 bits per word
Date: Fri, 17 Aug 2018 16:32:31 +0000	[thread overview]
Message-ID: <1534523550.2283.397.camel@impinj.com> (raw)
In-Reply-To: <20180817070105.1725-1-simon.k.r.goldschmidt@gmail.com>

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;
> 

  parent reply	other threads:[~2018-08-17 16:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-08  7:14 [PATCH] spi: dw: support 4-16 bits per word Simon Goldschmidt
2018-08-08  9:45 ` Andy Shevchenko
2018-08-08 11:58   ` Simon Goldschmidt
2018-08-08 12:26     ` Andy Shevchenko
2018-08-17  7:01 ` [PATCH v2] " Simon Goldschmidt
2018-08-17 11:17   ` Andy Shevchenko
2018-08-17 16:32   ` Trent Piepho [this message]
2018-08-18  8:37     ` Simon Goldschmidt
2018-09-04 19:49   ` [PATCH v3] " Simon Goldschmidt
2018-09-06 11:09     ` Mark Brown
2018-09-06 11:23       ` Simon Goldschmidt
2018-09-06 13:23         ` Mark Brown
2018-09-06 13:37           ` Simon Goldschmidt
2018-09-06 11:10     ` Applied "spi: dw: support 4-16 bits per word" to the spi tree Mark Brown
2018-09-06 11:10       ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1534523550.2283.397.camel@impinj.com \
    --to=tpiepho@impinj.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=simon.k.r.goldschmidt@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.