diff mbox

[v2,1/2] dt-bindings: GPIO: Add generic serializer binding

Message ID 1453739851-31839-2-git-send-email-afd@ti.com
State New
Headers show

Commit Message

Andrew Davis Jan. 25, 2016, 4:37 p.m. UTC
Add binding for generic parallel-in/serial-out shift register devices
used as GPIO.

Signed-off-by: Andrew F. Davis <afd@ti.com>
---
 .../devicetree/bindings/gpio/gpio-pisosr.txt       | 34 ++++++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/gpio/gpio-pisosr.txt

Comments

Rob Herring (Arm) Jan. 25, 2016, 7:37 p.m. UTC | #1
On Mon, Jan 25, 2016 at 10:37:30AM -0600, Andrew F. Davis wrote:
> Add binding for generic parallel-in/serial-out shift register devices
> used as GPIO.
> 
> Signed-off-by: Andrew F. Davis <afd@ti.com>
> ---
>  .../devicetree/bindings/gpio/gpio-pisosr.txt       | 34 ++++++++++++++++++++++
>  1 file changed, 34 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/gpio/gpio-pisosr.txt

One nit, otherwise:

Acked-by: Rob Herring <robh@kernel.org>

> 
> diff --git a/Documentation/devicetree/bindings/gpio/gpio-pisosr.txt b/Documentation/devicetree/bindings/gpio/gpio-pisosr.txt
> new file mode 100644
> index 0000000..e69e8ec
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/gpio/gpio-pisosr.txt
> @@ -0,0 +1,34 @@
> +Generic Parallel-in/Serial-out Shift Register GPIO Driver
> +
> +This binding describes generic parallel-in/serial-out shift register
> +devices that can be used for GPI (General Purpose Input). This includes
> +SN74165 serial-out shift registers and the SN65HVS88x series of
> +industrial serializers.
> +
> +Required properties:
> + - compatible		: Should be "pisosr-gpio".
> + - gpio-controller	: Marks the device node as a GPIO controller.
> + - #gpio-cells		: Should be two. For consumer use see gpio.txt.
> +
> +Optional properties:
> + - ngpios		: Number of GPIO lines, default is 8.
> + - load-gpios		: GPIO pin specifier attached to load enable, this
> +			  pin is pulsed before reading from the device to
> +			  load input pin values into the the device.
> +
> +For other required and optional properties of SPI slave
> +nodes please refer to ../spi/spi-bus.txt.
> +
> +Example:
> +
> +	sn65hvs882@0 {

should be gpio@0

> +		compatible = "pisosr-gpio";
> +		gpio-controller;
> +		#gpio-cells = <2>;
> +
> +		load-gpios = <&gpio2 23 GPIO_ACTIVE_LOW>;
> +
> +		reg = <0>;
> +		spi-max-frequency = <1000000>;
> +		spi-cpol;
> +	};
> -- 
> 2.7.0
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Linus Walleij Jan. 28, 2016, 10:59 a.m. UTC | #2
On Mon, Jan 25, 2016 at 5:37 PM, Andrew F. Davis <afd@ti.com> wrote:

> Add binding for generic parallel-in/serial-out shift register devices
> used as GPIO.
>
> Signed-off-by: Andrew F. Davis <afd@ti.com>
(...)
> +Required properties:
> + - compatible          : Should be "pisosr-gpio".

As mentioned I'd like some vendor examples here with dual strings.
"ti,foo", "pisosr-gpio"; is fine.

> +       sn65hvs882@0 {

Fix Rob's comment.

> +               compatible = "pisosr-gpio";

And a dual-string in the example.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rob Herring Jan. 28, 2016, 4:56 p.m. UTC | #3
On Thu, Jan 28, 2016 at 4:59 AM, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Mon, Jan 25, 2016 at 5:37 PM, Andrew F. Davis <afd@ti.com> wrote:
>
>> Add binding for generic parallel-in/serial-out shift register devices
>> used as GPIO.
>>
>> Signed-off-by: Andrew F. Davis <afd@ti.com>
> (...)
>> +Required properties:
>> + - compatible          : Should be "pisosr-gpio".
>
> As mentioned I'd like some vendor examples here with dual strings.
> "ti,foo", "pisosr-gpio"; is fine.

I acked it despite this because I've concluded it is not all that
useful in this case given you can have a variety of number of bits,
can chain together chips, etc. and the opportunity for screwing up or
differentiating this circuit in some way is really outside of the
logic chips themselves. You'd probably want to know the board not the
IC in this case.

The only reason I can think of to know the specific logic chip is if
different versions of IC can be populated and they have different
logic levels requiring regulator programming. We can cross that when
someone adds a supply. Of course, you could just as easily change
supply constraints as compatible strings in that case.

Rob
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/gpio/gpio-pisosr.txt b/Documentation/devicetree/bindings/gpio/gpio-pisosr.txt
new file mode 100644
index 0000000..e69e8ec
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/gpio-pisosr.txt
@@ -0,0 +1,34 @@ 
+Generic Parallel-in/Serial-out Shift Register GPIO Driver
+
+This binding describes generic parallel-in/serial-out shift register
+devices that can be used for GPI (General Purpose Input). This includes
+SN74165 serial-out shift registers and the SN65HVS88x series of
+industrial serializers.
+
+Required properties:
+ - compatible		: Should be "pisosr-gpio".
+ - gpio-controller	: Marks the device node as a GPIO controller.
+ - #gpio-cells		: Should be two. For consumer use see gpio.txt.
+
+Optional properties:
+ - ngpios		: Number of GPIO lines, default is 8.
+ - load-gpios		: GPIO pin specifier attached to load enable, this
+			  pin is pulsed before reading from the device to
+			  load input pin values into the the device.
+
+For other required and optional properties of SPI slave
+nodes please refer to ../spi/spi-bus.txt.
+
+Example:
+
+	sn65hvs882@0 {
+		compatible = "pisosr-gpio";
+		gpio-controller;
+		#gpio-cells = <2>;
+
+		load-gpios = <&gpio2 23 GPIO_ACTIVE_LOW>;
+
+		reg = <0>;
+		spi-max-frequency = <1000000>;
+		spi-cpol;
+	};