All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: leroy christophe <christophe.leroy@c-s.fr>
Cc: devicetree@vger.kernel.org,
	Ian Campbell <ian.campbell@citrix.com>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <Mark.Rutland@arm.com>,
	Rob Herring <rob.herring@calxeda.com>,
	linux-spi@vger.kernel.org
Subject: Re: Fwd: [PATCH] SPI: Set SPI bits per words in an OF DeviceTree SPI node
Date: Wed, 07 Aug 2013 10:30:47 -0600	[thread overview]
Message-ID: <52027637.7000309@wwwdotorg.org> (raw)
In-Reply-To: <52026DBA.8000202@c-s.fr>

CCing devicetree and SPI maintainers.

On 08/07/2013 09:54 AM, leroy christophe wrote:
> This patch allows to set up the bits per word together with all other SPI
> parameters in the SPI Node of the OF device tree

The new property needs to be documented somewhere in
Documentation/devicetree/bindings.

> In the node, you then have to include the 'spi-bits' property.
> 
> Exemple:
>     fpga-loader@7 {
>         compatible = "cs,fpga-loader";
>         spi-max-frequency = <10000000>;
>         reg = <7>;
>         spi-cs-high;
>         spi-bits = <16>;
>     };

Shouldn't the driver for cs,fpga-loader be defining how many bit the SPI
transactions should use? If the binding covers HW that can operate at
various bits-per-word, it's reasonable for those individual bindings to
define a property that sets that width, but I'm not convinced it's
reasonable for the SPI core to allow any DT node to specify that, and
presumably override the SPI device's driver's selection.

> --- linux-3.8.13/drivers/spi/spi.c    2013-05-11 22:57:46.000000000 +0200
> +++ linux/drivers/spi/spi.c    2013-08-06 18:19:30.000000000 +0200
> @@ -870,6 +870,11 @@
>           if (of_find_property(nc, "spi-3wire", NULL))
>               spi->mode |= SPI_3WIRE;
>   +        /* Bits per word */
> +        prop = of_get_property(nc, "spi-bits", &len);
> +        if (prop && len >= sizeof(*prop))
> +            spi->bits_per_word = prop[0];
> +


  parent reply	other threads:[~2013-08-07 16:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-07 15:44 [PATCH] SPI: Set SPI bits per words in an OF DeviceTree SPI node Christophe Leroy
2013-08-07 15:44 ` Christophe Leroy
2013-08-07 15:54 ` Fwd: " leroy christophe
2013-08-07 16:27   ` Kumar Gala
2013-08-07 16:30   ` Stephen Warren [this message]
2013-08-14 13:21     ` Fwd: " leroy christophe
2013-08-14 16:19       ` Stephen Warren
2013-08-14 16:29         ` leroy christophe
2013-08-14 16:31           ` Stephen Warren

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=52027637.7000309@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=Mark.Rutland@arm.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=christophe.leroy@c-s.fr \
    --cc=devicetree@vger.kernel.org \
    --cc=ian.campbell@citrix.com \
    --cc=linux-spi@vger.kernel.org \
    --cc=pawel.moll@arm.com \
    --cc=rob.herring@calxeda.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.