All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Lukas Wunner <lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
Cc: Linus Walleij
	<linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Mathias Duckeck
	<m.duckeck-XB/JSsFECOqzQB+pC5nmwQ@public.gmane.org>,
	Phil Elwell <phil-FnsA7b+Nu9XbIbC87yuRow@public.gmane.org>,
	linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>
Subject: Re: [PATCH v2 3/5] dt-bindings: Document common property for daisy-chained devices
Date: Sun, 15 Oct 2017 12:30:53 +0100	[thread overview]
Message-ID: <20171015123053.383653a3@archlinux> (raw)
In-Reply-To: <f0c3b0c5514f74717c5783360b60062dfe9b8c0f.1507797496.git.lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>

On Thu, 12 Oct 2017 12:40:10 +0200
Lukas Wunner <lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org> wrote:

> Many serially-attached GPIO and IIO devices are daisy-chainable.
> 
>     Examples for GPIO devices are Maxim MAX3191x and TI SN65HVS88x:
>     https://datasheets.maximintegrated.com/en/ds/MAX31913.pdf
>     http://www.ti.com/lit/ds/symlink/sn65hvs880.pdf
> 
>     Examples for IIO devices are TI DAC128S085 and TI DAC161S055:
>     http://www.ti.com/lit/ds/symlink/dac128s085.pdf
>     http://www.ti.com/lit/ds/symlink/dac161s055.pdf
> 
> We already have drivers for daisy-chainable devices in the tree but
> their devicetree bindings are somewhat inconsistent and ill-named:
> 
>     The gpio-74x164.c driver uses "registers-number" to convey the
>     number of devices in the daisy-chain.  (Sans vendor prefix,
>     multiple vendors sell compatible versions of this chip.)
> 
>     The gpio-pisosr.c driver takes a different approach and calculates
>     the number of devices in the daisy-chain by dividing the common
>     "ngpios" property (Documentation/devicetree/bindings/gpio/gpio.txt)
>     by 8 (which assumes that each chip has 8 inputs).
> 
> Let's standardize on a common "#daisy-chained-devices" property.
> That name was chosen because it's the term most frequently used in
> datasheets.  (A less frequently used synonym is "cascaded devices".)
> 
> Signed-off-by: Lukas Wunner <lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
Makes sense to me.
Acked-by: Jonathan Cameron <Jonathan.Cameron-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> ---
> Changes v1 -> v2:
> 
> - Newly inserted patch.
> 
>  .../devicetree/bindings/common-properties.txt      | 26 ++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/common-properties.txt b/Documentation/devicetree/bindings/common-properties.txt
> index 697714f8d75c..a3448bfa1c82 100644
> --- a/Documentation/devicetree/bindings/common-properties.txt
> +++ b/Documentation/devicetree/bindings/common-properties.txt
> @@ -1,4 +1,8 @@
>  Common properties
> +=================
> +
> +Endianness
> +----------
>  
>  The Devicetree Specification does not define any properties related to hardware
>  byteswapping, but endianness issues show up frequently in porting Linux to
> @@ -58,3 +62,25 @@ dev: dev@40031000 {
>  	      ...
>  	      little-endian;
>  };
> +
> +Daisy-chained devices
> +---------------------
> +
> +Many serially-attached GPIO and IIO devices are daisy-chainable.  To the
> +host controller, a daisy-chain appears as a single device, but the number
> +of inputs and outputs it provides is the sum of inputs and outputs provided
> +by all of its devices.  The driver needs to know how many devices the
> +daisy-chain comprises to determine the amount of data exchanged, how many
> +inputs and outputs to register and so on.
> +
> +Optional properties:
> + - #daisy-chained-devices: Number of devices in the daisy-chain (default is 1).
> +
> +Example:
> +gpio@0 {
> +	      compatible = "name";
> +	      reg = <0>;
> +	      gpio-controller;
> +	      #gpio-cells = <2>;
> +	      #daisy-chained-devices = <3>;
> +};

--
To unsubscribe from this list: send the line "unsubscribe devicetree" 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:[~2017-10-15 11:30 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-12 10:40 [PATCH v2 0/5] GPIO driver for Maxim MAX3191x Lukas Wunner
2017-10-12 10:40 ` [PATCH v2 3/5] dt-bindings: Document common property for daisy-chained devices Lukas Wunner
     [not found]   ` <f0c3b0c5514f74717c5783360b60062dfe9b8c0f.1507797496.git.lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2017-10-15 11:30     ` Jonathan Cameron [this message]
2017-10-17 20:32     ` Rob Herring
2017-10-19 20:35     ` Linus Walleij
     [not found] ` <cover.1507797496.git.lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2017-10-12 10:40   ` [PATCH v2 4/5] dt-bindings: gpio: max3191x: Document new driver Lukas Wunner
2017-10-17 20:30     ` Rob Herring
     [not found]     ` <57660f421f2080914940806394a9365ac959f5a8.1507797496.git.lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2017-10-19 20:36       ` Linus Walleij
2017-10-12 10:40   ` [PATCH v2 5/5] gpio: Add driver for Maxim MAX3191x industrial serializer Lukas Wunner
2017-10-13 11:11     ` Lukas Wunner
2017-10-13 16:53       ` David Daney
2017-10-13 21:29         ` Lukas Wunner
2017-10-13 22:12           ` David Daney
2017-10-14 11:24             ` Lukas Wunner
2017-10-19 20:41     ` Linus Walleij
2017-10-12 10:40 ` [PATCH v2 1/5] bitops: Introduce assign_bit() Lukas Wunner
2017-10-12 18:30   ` Andrew Morton
2017-10-13 12:44   ` Linus Walleij
2017-10-12 10:40 ` [PATCH v2 2/5] gpio: Introduce ->get_multiple callback Lukas Wunner
2017-10-13 12:46   ` Linus Walleij
2017-10-13 12:48 ` [PATCH v2 0/5] GPIO driver for Maxim MAX3191x Linus Walleij
2017-10-13 12:48   ` Linus Walleij

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=20171015123053.383653a3@archlinux \
    --to=jic23-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org \
    --cc=m.duckeck-XB/JSsFECOqzQB+pC5nmwQ@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=phil-FnsA7b+Nu9XbIbC87yuRow@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@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.