devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH v3 1/2]spi: DUAL and QUAD support
       [not found] <1376216117-5864-1-git-send-email-wangyuhang2014@gmail.com>
@ 2013-08-22 12:30 ` Mark Brown
  2013-09-01  9:36 ` [PATCH] spi: quad: fix the name of DT property wangyuhang
  1 sibling, 0 replies; 5+ messages in thread
From: Mark Brown @ 2013-08-22 12:30 UTC (permalink / raw)
  To: wangyuhang
  Cc: sourav.poddar, pekon, tpiepho, spi-devel-general, linux-mtd,
	linux-spi, devicetree

[-- Attachment #1: Type: text/plain, Size: 614 bytes --]

On Sun, Aug 11, 2013 at 06:15:17PM +0800, wangyuhang wrote:

Applied, this looks good thanks.  A few coding style issues which I'll
fix up myself but one thing:

> fix the previous patch some mistake below:
> 1. DT in slave node, use "spi-tx-nbits = <1/2/4>" in place of using
>    "spi-tx-dual, spi-tx-quad" directly, same to rx. So correct the
>    previous way to get the property in @of_register_spi_devices().

This new DT stuff needs to be reviewed on the devicetree list and
documented in the generic SPI bindings.  Can you please send a patch
doing that?

Please also note that the SPI list moved to vger.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] spi: quad: fix the name of DT property
       [not found] <1376216117-5864-1-git-send-email-wangyuhang2014@gmail.com>
  2013-08-22 12:30 ` [PATCH v3 1/2]spi: DUAL and QUAD support Mark Brown
@ 2013-09-01  9:36 ` wangyuhang
  2013-09-01 12:46   ` Mark Brown
  2013-09-03 16:53   ` Stephen Warren
  1 sibling, 2 replies; 5+ messages in thread
From: wangyuhang @ 2013-09-01  9:36 UTC (permalink / raw)
  To: broonie, devicetree, linux-spi, linux-mtd, pekon, tomasz.figa,
	swarren
  Cc: wangyuhang

spi: quad: fix the name of DT property in patch

The previous property name spi-tx-nbits and spi-rx-nbits looks not
human-readable. To make it consistent with other devices, using property
name spi-tx-bus-width and spi-rx-bus-width instead of the previous one
specify the number of data wires that spi controller will work in.
Add the specification in spi-bus.txt.

Signed-off-by: wangyuhang <wangyuhang2014@gmail.com>
---
 Documentation/devicetree/bindings/spi/spi-bus.txt |   10 ++++++++++
 drivers/spi/spi.c                                 |    8 ++++----
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/spi/spi-bus.txt b/Documentation/devicetree/bindings/spi/spi-bus.txt
index 296015e..800dafe 100644
--- a/Documentation/devicetree/bindings/spi/spi-bus.txt
+++ b/Documentation/devicetree/bindings/spi/spi-bus.txt
@@ -55,6 +55,16 @@ contain the following properties.
     		chip select active high
 - spi-3wire       - (optional) Empty property indicating device requires
     		    3-wire mode.
+- spi-tx-bus-width - (optional) The bus width(number of data wires) that
+                      used for MOSI. Defaults to 1 if not present.
+- spi-rx-bus-width - (optional) The bus width(number of data wires) that
+                      used for MISO. Defaults to 1 if not present.
+
+Some SPI controllers and devices support Dual and Quad SPI transfer mode.
+It allows data in SPI system transfered in 2 wires(DUAL) or 4 wires(QUAD).
+Now the value that spi-tx-bus-width and spi-rx-bus-width can receive is
+only 1(SINGLE), 2(DUAL) and 4(QUAD).
+Dual/Quad mode is not allowed when 3-wire mode is used.
 
 If a gpio chipselect is used for the SPI slave the gpio number will be passed
 via the cs_gpio
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 7557f61..0075318 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -870,7 +870,7 @@ static void of_register_spi_devices(struct spi_master *master)
 			spi->mode |= SPI_3WIRE;
 
 		/* Device DUAL/QUAD mode */
-		prop = of_get_property(nc, "spi-tx-nbits", &len);
+		prop = of_get_property(nc, "spi-tx-bus-width", &len);
 		if (prop && len == sizeof(*prop)) {
 			switch (be32_to_cpup(prop)) {
 			case SPI_NBITS_SINGLE:
@@ -883,14 +883,14 @@ static void of_register_spi_devices(struct spi_master *master)
 				break;
 			default:
 				dev_err(&master->dev,
-					"spi-tx-nbits %d not supported\n",
+					"spi-tx-bus-width %d not supported\n",
 					be32_to_cpup(prop));
 				spi_dev_put(spi);
 				continue;
 			}
 		}
 
-		prop = of_get_property(nc, "spi-rx-nbits", &len);
+		prop = of_get_property(nc, "spi-rx-bus-width", &len);
 		if (prop && len == sizeof(*prop)) {
 			switch (be32_to_cpup(prop)) {
 			case SPI_NBITS_SINGLE:
@@ -903,7 +903,7 @@ static void of_register_spi_devices(struct spi_master *master)
 				break;
 			default:
 				dev_err(&master->dev,
-					"spi-rx-nbits %d not supported\n",
+					"spi-rx-bus-width %d not supported\n",
 					be32_to_cpup(prop));
 				spi_dev_put(spi);
 				continue;
-- 
1.7.9.5


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] spi: quad: fix the name of DT property
  2013-09-01  9:36 ` [PATCH] spi: quad: fix the name of DT property wangyuhang
@ 2013-09-01 12:46   ` Mark Brown
  2013-09-03 16:53   ` Stephen Warren
  1 sibling, 0 replies; 5+ messages in thread
From: Mark Brown @ 2013-09-01 12:46 UTC (permalink / raw)
  To: wangyuhang; +Cc: devicetree, swarren, tomasz.figa, linux-spi, linux-mtd, pekon


[-- Attachment #1.1: Type: text/plain, Size: 648 bytes --]

On Sun, Sep 01, 2013 at 05:36:21PM +0800, wangyuhang wrote:
> spi: quad: fix the name of DT property in patch
> 
> The previous property name spi-tx-nbits and spi-rx-nbits looks not
> human-readable. To make it consistent with other devices, using property
> name spi-tx-bus-width and spi-rx-bus-width instead of the previous one
> specify the number of data wires that spi controller will work in.
> Add the specification in spi-bus.txt.

Applied, thanks - if there's disagreement about the DT bindings (or
indeed other problems) then I can not send this in the final pull
request but if it is OK I wanted it to be in -next on Monday.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 144 bytes --]

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] spi: quad: fix the name of DT property
  2013-09-01  9:36 ` [PATCH] spi: quad: fix the name of DT property wangyuhang
  2013-09-01 12:46   ` Mark Brown
@ 2013-09-03 16:53   ` Stephen Warren
  2013-09-03 23:01     ` Mark Brown
  1 sibling, 1 reply; 5+ messages in thread
From: Stephen Warren @ 2013-09-03 16:53 UTC (permalink / raw)
  To: wangyuhang; +Cc: devicetree, tomasz.figa, linux-spi, broonie, linux-mtd, pekon

On 09/01/2013 03:36 AM, wangyuhang wrote:
> spi: quad: fix the name of DT property in patch
> 
> The previous property name spi-tx-nbits and spi-rx-nbits looks not
> human-readable. To make it consistent with other devices, using property
> name spi-tx-bus-width and spi-rx-bus-width instead of the previous one
> specify the number of data wires that spi controller will work in.
> Add the specification in spi-bus.txt.

> diff --git a/Documentation/devicetree/bindings/spi/spi-bus.txt b/Documentation/devicetree/bindings/spi/spi-bus.txt

>  - spi-3wire       - (optional) Empty property indicating device requires
>      		    3-wire mode.
> +- spi-tx-bus-width - (optional) The bus width(number of data wires) that
> +                      used for MOSI. Defaults to 1 if not present.
> +- spi-rx-bus-width - (optional) The bus width(number of data wires) that
> +                      used for MISO. Defaults to 1 if not present.

The binding,
Acked-by: Stephen Warren <swarren@nvidia.com>

I would have preferred my original wording rather than the unqualified
"MOSI"/"MISO", since the meaning of those terms depends on whether
you're looking at the host controller or the device, but I guess we can
assume that since this is documentation for the host controller binding,
the naming is in terms of the host controller's signals.


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] spi: quad: fix the name of DT property
  2013-09-03 16:53   ` Stephen Warren
@ 2013-09-03 23:01     ` Mark Brown
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2013-09-03 23:01 UTC (permalink / raw)
  To: Stephen Warren
  Cc: devicetree, tomasz.figa, linux-spi, linux-mtd, pekon, wangyuhang


[-- Attachment #1.1: Type: text/plain, Size: 449 bytes --]

On Tue, Sep 03, 2013 at 10:53:11AM -0600, Stephen Warren wrote:

> I would have preferred my original wording rather than the unqualified
> "MOSI"/"MISO", since the meaning of those terms depends on whether
> you're looking at the host controller or the device, but I guess we can

No, MOSI and MISO have fixed meanings at all ends - they expand to
Master Out Slave In and Master In Slave Out so it's always clear which
side should be transmitting.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 144 bytes --]

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-09-03 23:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1376216117-5864-1-git-send-email-wangyuhang2014@gmail.com>
2013-08-22 12:30 ` [PATCH v3 1/2]spi: DUAL and QUAD support Mark Brown
2013-09-01  9:36 ` [PATCH] spi: quad: fix the name of DT property wangyuhang
2013-09-01 12:46   ` Mark Brown
2013-09-03 16:53   ` Stephen Warren
2013-09-03 23:01     ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).