Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1434206 > unrolled thread

[PATCH 2/4] spi: Document option to wake a device by toggling CS

Started byapronin@chromium.org
First post2016-06-30 06:00 +0200
Last post2016-07-01 06:40 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/4] spi: Document option to wake a device by toggling CS apronin@chromium.org - 2016-06-30 06:00 +0200
    Re: [PATCH 2/4] spi: Document option to wake a device by toggling CS Geert Uytterhoeven <geert@linux-m68k.org> - 2016-06-30 09:20 +0200
      Re: [PATCH 2/4] spi: Document option to wake a device by toggling CS Doug Anderson <dianders@chromium.org> - 2016-07-01 06:40 +0200

#1434206 — [PATCH 2/4] spi: Document option to wake a device by toggling CS

Fromapronin@chromium.org
Date2016-06-30 06:00 +0200
Subject[PATCH 2/4] spi: Document option to wake a device by toggling CS
Message-ID<rPBiV-4y7-5@gated-at.bofh.it>
From: Andrey Pronin <apronin@chromium.org>

Some SPI devices may go to sleep after a period of inactivity
on SPI. For such devices, if enough time has passed since the
last SPI transaction, toggle CS and wait for the device to
start before communicating with it.

Signed-off-by: Andrey Pronin <apronin@chromium.org>
---
 Documentation/devicetree/bindings/spi/spi-bus.txt | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/Documentation/devicetree/bindings/spi/spi-bus.txt b/Documentation/devicetree/bindings/spi/spi-bus.txt
index 42d5954..1b7ffd4 100644
--- a/Documentation/devicetree/bindings/spi/spi-bus.txt
+++ b/Documentation/devicetree/bindings/spi/spi-bus.txt
@@ -63,6 +63,13 @@ contain the following properties.
                       used for MISO. Defaults to 1 if not present.
 - spi-rx-delay-us  - (optional) Microsecond delay after a read transfer.
 - spi-tx-delay-us  - (optional) Microsecond delay after a write transfer.
+- cs-wake-after-sleep - (optional) Device may go to sleep after a period
+		of SPI inactivity. If this flag is set, toggle CS and
+		wait for it to wake before communicating to it.
+- cs-sleep-delay  - (optional) Delay after which the device may go to
+		sleep if there was no SPI activity (msec).
+- cs-wake-duration - (optional) Time it takes the device to wake up after
+		toggling CS if it went to sleep (msec).
 
 Some SPI controllers and devices support Dual and Quad SPI transfer mode.
 It allows data in the SPI system to be transferred in 2 wires(DUAL) or 4 wires(QUAD).
-- 
2.6.6

[toc] | [next] | [standalone]


#1434286

FromGeert Uytterhoeven <geert@linux-m68k.org>
Date2016-06-30 09:20 +0200
Message-ID<rPEqu-6Dg-21@gated-at.bofh.it>
In reply to#1434206
CC devicetree

On Thu, Jun 30, 2016 at 5:54 AM,  <apronin@chromium.org> wrote:
> From: Andrey Pronin <apronin@chromium.org>
>
> Some SPI devices may go to sleep after a period of inactivity
> on SPI. For such devices, if enough time has passed since the
> last SPI transaction, toggle CS and wait for the device to
> start before communicating with it.
>
> Signed-off-by: Andrey Pronin <apronin@chromium.org>
> ---
>  Documentation/devicetree/bindings/spi/spi-bus.txt | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/spi/spi-bus.txt b/Documentation/devicetree/bindings/spi/spi-bus.txt
> index 42d5954..1b7ffd4 100644
> --- a/Documentation/devicetree/bindings/spi/spi-bus.txt
> +++ b/Documentation/devicetree/bindings/spi/spi-bus.txt
> @@ -63,6 +63,13 @@ contain the following properties.
>                        used for MISO. Defaults to 1 if not present.
>  - spi-rx-delay-us  - (optional) Microsecond delay after a read transfer.
>  - spi-tx-delay-us  - (optional) Microsecond delay after a write transfer.
> +- cs-wake-after-sleep - (optional) Device may go to sleep after a period
> +               of SPI inactivity. If this flag is set, toggle CS and
> +               wait for it to wake before communicating to it.
> +- cs-sleep-delay  - (optional) Delay after which the device may go to
> +               sleep if there was no SPI activity (msec).
> +- cs-wake-duration - (optional) Time it takes the device to wake up after
> +               toggling CS if it went to sleep (msec).
>
>  Some SPI controllers and devices support Dual and Quad SPI transfer mode.
>  It allows data in the SPI system to be transferred in 2 wires(DUAL) or 4 wires(QUAD).
> --
> 2.6.6

[toc] | [prev] | [next] | [standalone]


#1435006

FromDoug Anderson <dianders@chromium.org>
Date2016-07-01 06:40 +0200
Message-ID<rPYpb-24z-11@gated-at.bofh.it>
In reply to#1434286
Hi,

On Thu, Jun 30, 2016 at 12:12 AM, Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
> CC devicetree

And Rob and Mark...

 ./scripts/get_maintainer.pl -f
Documentation/devicetree/bindings/spi/spi-bus.txt

Mark Brown <broonie@kernel.org> (maintainer:SPI SUBSYSTEM)
Rob Herring <robh+dt@kernel.org> (maintainer:OPEN FIRMWARE AND
FLATTENED DEVICE TREE BINDINGS)
Mark Rutland <mark.rutland@arm.com> (maintainer:OPEN FIRMWARE AND
FLATTENED DEVICE TREE BINDINGS)
linux-spi@vger.kernel.org (open list:SPI SUBSYSTEM)
devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED
DEVICE TREE BINDINGS)
linux-kernel@vger.kernel.org (open list)


> On Thu, Jun 30, 2016 at 5:54 AM,  <apronin@chromium.org> wrote:
>> From: Andrey Pronin <apronin@chromium.org>
>>
>> Some SPI devices may go to sleep after a period of inactivity
>> on SPI. For such devices, if enough time has passed since the
>> last SPI transaction, toggle CS and wait for the device to
>> start before communicating with it.
>>
>> Signed-off-by: Andrey Pronin <apronin@chromium.org>
>> ---
>>  Documentation/devicetree/bindings/spi/spi-bus.txt | 7 +++++++
>>  1 file changed, 7 insertions(+)

Overall note is that devicetree bindings patches should be _before_
the code that uses them, so you should swap patch #1 and patch #2.

>>
>> diff --git a/Documentation/devicetree/bindings/spi/spi-bus.txt b/Documentation/devicetree/bindings/spi/spi-bus.txt
>> index 42d5954..1b7ffd4 100644
>> --- a/Documentation/devicetree/bindings/spi/spi-bus.txt
>> +++ b/Documentation/devicetree/bindings/spi/spi-bus.txt
>> @@ -63,6 +63,13 @@ contain the following properties.
>>                        used for MISO. Defaults to 1 if not present.
>>  - spi-rx-delay-us  - (optional) Microsecond delay after a read transfer.
>>  - spi-tx-delay-us  - (optional) Microsecond delay after a write transfer.
>> +- cs-wake-after-sleep - (optional) Device may go to sleep after a period
>> +               of SPI inactivity. If this flag is set, toggle CS and
>> +               wait for it to wake before communicating to it.

You probably also need a property for how long it needs to be asserted
when you "toggle" it?

>> +- cs-sleep-delay  - (optional) Delay after which the device may go to
>> +               sleep if there was no SPI activity (msec).
>> +- cs-wake-duration - (optional) Time it takes the device to wake up after
>> +               toggling CS if it went to sleep (msec).

I believe that from your code the second two properties are both
required if the first property is set.  That should be in the
bindings.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web