All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Sperl <martin-d5rIkyn9cnPYtjvyW6yDsg@public.gmane.org>
To: Oleksij Rempel <linux-YEK0n+YFykbzxQdaRaTXBw@public.gmane.org>
Cc: fixed-term.Oleksij.Rempel-V5te9oGctAVWk0Htik3J/w@public.gmane.org,
	Geert Uytterhoeven
	<geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>,
	dirk.behme-V5te9oGctAVWk0Htik3J/w@public.gmane.org,
	Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	linux-spi <linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH RFC] spi: add flow controll support
Date: Mon, 29 Feb 2016 14:11:51 +0100	[thread overview]
Message-ID: <667217D5-C576-46CE-A8B3-BD2CF49C5A81@sperl.org> (raw)
In-Reply-To: <1456747459-8559-1-git-send-email-linux-YEK0n+YFykbzxQdaRaTXBw@public.gmane.org>

> 
> On 29.02.2016, at 13:04, Oleksij Rempel <linux-YEK0n+YFykbzxQdaRaTXBw@public.gmane.org> wrote:
> 
> Different HW implement different variants of SPI based flow control (FC).
> To flexible FC implementation a spited it to fallowing common parts:
> Flow control: Request Sequence
> Master CS   |-------2\_____________________|
> Slave  FC   |-----1\_______________________|
> DATA        |-----------3\_________________|
> 
> Flow control: Ready Sequence
> Master CS   |-----1\_______________________|
> Slave  FC   |--------2\____________________|
> DATA        |-----------3\_________________|
> 
> Flow control: ACK End of Data
> Master CS   |______________________/2------|
> Slave  FC   |________________________/3----|
> DATA        |__________________/1----------|
> 
> Flow control: Pause
> Master CS   |_______________________/------|
> Slave  FC   |_______1/-----\3______/-------|
> DATA        |________2/------\4___/--------|

The MAX187/189 SPI-ADC implements a different kind of
flow control that is signaling inline on DATA/MISO:

Master CS   |-----1\_______________________|
MISO/DATA   |------2\____3/----------------|
CONV START  |       ^                      |
DATA READY  |             ^                |

So when CS get asserted (1) 
MISO/DATA becomes dominant low (2) and the ADC conversion starts
  (within 100ns of (1))
When MISO/DATA goes dominant high (3) then the conversion has finished
and the transfer may start.

A flow-control interface should also cover similar cases - or
at least get designed so that such a case can also get handled
by the framework in the future as well.

> +
> +/* spi_fc_probe should be called by spi_device driver. */
> +int spi_fc_probe(struct spi_device *spi)
> ...
> +}
> +EXPORT_SYMBOL_GPL(spi_fc_probe);

Please add kernel doc to the exported methods

Please put per driver changes into a separate patch.

Also missing from the patch(set) is the dt-bindings documentation - 
see Documentation/devicetree/bindings/spi/spi-bus.txt.

Martin
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2016-02-29 13:11 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-29 12:04 [PATCH RFC] spi: add flow controll support Oleksij Rempel
     [not found] ` <1456747459-8559-1-git-send-email-linux-YEK0n+YFykbzxQdaRaTXBw@public.gmane.org>
2016-02-29 12:14   ` Geert Uytterhoeven
     [not found]     ` <56D448E1.6090006@de.bosch.com>
     [not found]       ` <56D448E1.6090006-V5te9oGctAVWk0Htik3J/w@public.gmane.org>
2016-02-29 13:46         ` Geert Uytterhoeven
2016-03-01 14:43         ` [PATCH 1/6] " Oleksij Rempel
     [not found]           ` <1456843400-20696-1-git-send-email-linux-YEK0n+YFykbzxQdaRaTXBw@public.gmane.org>
2016-03-01 14:43             ` [PATCH 2/6] spi: add add flow control test driver Oleksij Rempel
2016-03-01 14:43             ` [PATCH 3/6] DT: add documentation for spi-fc-test driver Oleksij Rempel
     [not found]               ` <1456843400-20696-3-git-send-email-linux-YEK0n+YFykbzxQdaRaTXBw@public.gmane.org>
2016-03-02  2:17                 ` Mark Brown
2016-03-02  6:24                   ` fixed-term.Oleksij.Rempel
2016-03-01 14:43             ` [PATCH 4/6] spi: davinci: set new SPI_FC_* flags Oleksij Rempel
     [not found]               ` <1456843400-20696-4-git-send-email-linux-YEK0n+YFykbzxQdaRaTXBw@public.gmane.org>
2016-03-02  2:16                 ` Mark Brown
2016-03-02  6:25                   ` fixed-term.Oleksij.Rempel
     [not found]                     ` <56D68754.3090405-V5te9oGctAVWk0Htik3J/w@public.gmane.org>
2016-03-02 10:48                       ` Mark Brown
2016-03-02  6:57                   ` fixed-term.Oleksij.Rempel
2016-03-01 14:43             ` [PATCH 5/6] spi: sun4i: " Oleksij Rempel
2016-03-01 14:43             ` [PATCH 6/6] spi: bitbang: " Oleksij Rempel
2016-03-02  1:32             ` [PATCH 1/6] spi: add flow controll support Mark Brown
2016-03-02  2:46             ` Mark Brown
2016-03-02  6:48               ` fixed-term.Oleksij.Rempel
     [not found]                 ` <56D68CD7.8000203-V5te9oGctAVWk0Htik3J/w@public.gmane.org>
2016-03-02 10:55                   ` Mark Brown
2016-03-02 11:21                     ` fixed-term.Oleksij.Rempel
2016-03-02 12:26             ` Martin Sperl
2016-03-02 14:26               ` fixed-term.Oleksij.Rempel
2016-02-29 13:11   ` Martin Sperl [this message]

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=667217D5-C576-46CE-A8B3-BD2CF49C5A81@sperl.org \
    --to=martin-d5rikyn9cnpytjvyw6ydsg@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=dirk.behme-V5te9oGctAVWk0Htik3J/w@public.gmane.org \
    --cc=fixed-term.Oleksij.Rempel-V5te9oGctAVWk0Htik3J/w@public.gmane.org \
    --cc=geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org \
    --cc=linux-YEK0n+YFykbzxQdaRaTXBw@public.gmane.org \
    --cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /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.