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


Groups > linux.kernel > #1289864 > unrolled thread

[PATCH 0/2] gpio: Add driver for SPI serializers

Started by"Andrew F. Davis" <afd@ti.com>
First post2015-12-11 20:50 +0100
Last post2015-12-11 22:50 +0100
Articles 13 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/2] gpio: Add driver for SPI serializers "Andrew F. Davis" <afd@ti.com> - 2015-12-11 20:50 +0100
    [PATCH 1/2] dt-bindings: GPIO: Add generic serializer binding "Andrew F. Davis" <afd@ti.com> - 2015-12-11 20:50 +0100
      Re: [PATCH 1/2] dt-bindings: GPIO: Add generic serializer binding Linus Walleij <linus.walleij@linaro.org> - 2015-12-11 22:50 +0100
        Re: [PATCH 1/2] dt-bindings: GPIO: Add generic serializer binding "Andrew F. Davis" <afd@ti.com> - 2015-12-14 17:50 +0100
          Re: [PATCH 1/2] dt-bindings: GPIO: Add generic serializer binding Rob Herring <robh+dt@kernel.org> - 2015-12-14 23:40 +0100
            Re: [PATCH 1/2] dt-bindings: GPIO: Add generic serializer binding "Andrew F. Davis" <afd@ti.com> - 2015-12-15 00:30 +0100
              Re: [PATCH 1/2] dt-bindings: GPIO: Add generic serializer binding Rob Herring <robh+dt@kernel.org> - 2015-12-16 17:40 +0100
                Re: [PATCH 1/2] dt-bindings: GPIO: Add generic serializer binding "Andrew F. Davis" <afd@ti.com> - 2015-12-30 18:10 +0100
              Re: [PATCH 1/2] dt-bindings: GPIO: Add generic serializer binding Linus Walleij <linus.walleij@linaro.org> - 2015-12-22 11:00 +0100
                Re: [PATCH 1/2] dt-bindings: GPIO: Add generic serializer binding "Andrew F. Davis" <afd@ti.com> - 2015-12-30 18:10 +0100
          Re: [PATCH 1/2] dt-bindings: GPIO: Add generic serializer binding Geert Uytterhoeven <geert@linux-m68k.org> - 2015-12-17 09:30 +0100
          Re: [PATCH 1/2] dt-bindings: GPIO: Add generic serializer binding Geert Uytterhoeven <geert@linux-m68k.org> - 2015-12-17 09:30 +0100
    Re: [PATCH 0/2] gpio: Add driver for SPI serializers Linus Walleij <linus.walleij@linaro.org> - 2015-12-11 22:50 +0100

#1289864 — [PATCH 0/2] gpio: Add driver for SPI serializers

From"Andrew F. Davis" <afd@ti.com>
Date2015-12-11 20:50 +0100
Subject[PATCH 0/2] gpio: Add driver for SPI serializers
Message-ID<qEBRv-mG-7@gated-at.bofh.it>
Hello all,

This series adds a GPI(General Purpose Input) driver for generic
parallel-in/serial-out shift registers, such as the SN65HVS882
that this driver was tested on. This should also work for the rest
of the SN65HVS88x series as well as other 74x165 style devices.

Thanks,
Andrew

Andrew F. Davis (2):
  dt-bindings: GPIO: Add generic serializer binding
  gpio: Add driver for SPI serializers

 .../devicetree/bindings/gpio/gpio-pisosr.txt       |  34 ++++
 drivers/gpio/Kconfig                               |   6 +
 drivers/gpio/Makefile                              |   1 +
 drivers/gpio/gpio-pisosr.c                         | 182 +++++++++++++++++++++
 4 files changed, 223 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/gpio/gpio-pisosr.txt
 create mode 100644 drivers/gpio/gpio-pisosr.c

-- 
2.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1289867 — [PATCH 1/2] dt-bindings: GPIO: Add generic serializer binding

From"Andrew F. Davis" <afd@ti.com>
Date2015-12-11 20:50 +0100
Subject[PATCH 1/2] dt-bindings: GPIO: Add generic serializer binding
Message-ID<qEBRw-mG-37@gated-at.bofh.it>
In reply to#1289864
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

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;
+	};
-- 
2.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


#1289931 — Re: [PATCH 1/2] dt-bindings: GPIO: Add generic serializer binding

FromLinus Walleij <linus.walleij@linaro.org>
Date2015-12-11 22:50 +0100
SubjectRe: [PATCH 1/2] dt-bindings: GPIO: Add generic serializer binding
Message-ID<qEDJE-1yy-3@gated-at.bofh.it>
In reply to#1289867
On Fri, Dec 11, 2015 at 8:46 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>

> +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".

I think it should also define compatible strings on the "vendor,device"
format apart from the generic compatible. Sooner or later we may need
to differentiate them and then that comes in handy.

> + - 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.

If you didn't do "pisosr-gpio" but instead "foo,sn74165", maybe you
don't need to have this in the device tree but instead it can be
determined from the compatible string?

In that case do that.

> + - 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.

OK seems necessary.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


#1291346 — Re: [PATCH 1/2] dt-bindings: GPIO: Add generic serializer binding

From"Andrew F. Davis" <afd@ti.com>
Date2015-12-14 17:50 +0100
SubjectRe: [PATCH 1/2] dt-bindings: GPIO: Add generic serializer binding
Message-ID<qFEtY-di-21@gated-at.bofh.it>
In reply to#1289931
On 12/11/2015 03:48 PM, Linus Walleij wrote:
> On Fri, Dec 11, 2015 at 8:46 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>
>
>> +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".
>
> I think it should also define compatible strings on the "vendor,device"
> format apart from the generic compatible. Sooner or later we may need
> to differentiate them and then that comes in handy.
>

Would it be better to wait until/if this issue arises? This driver
targets the generic features, as these parts are very generic and
have been produced by many companies since the 70s I'm not sure
if privileging any of them makes much sense.

What I'm worried about looks to have happened with the gpio-74x164
driver, this is kind of the companion device to mine (74164 / 74165)
and should work with any 74164 compatible shift register (possibly 100s
of versions of them), but the compatible string that was added is
"fairchild,74hc595", a relatively new device by a single manufacturer.
The problem this has is then that boards will use this compatible string
even if the parts are not actually the Fairchild version, just to get
the match, when they should be using a generic string.

>> + - 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.
>
> If you didn't do "pisosr-gpio" but instead "foo,sn74165", maybe you
> don't need to have this in the device tree but instead it can be
> determined from the compatible string?
>
> In that case do that.
>

These devices can be daisy-chained together, so three 8bit registers
look exactly like one 24bit register. The only way to know this is
from the physical wiring of the board, not from the part number.

Thanks,
Andrew

>> + - 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.
>
> OK seems necessary.
>
> Yours,
> Linus Walleij
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


#1291642 — Re: [PATCH 1/2] dt-bindings: GPIO: Add generic serializer binding

FromRob Herring <robh+dt@kernel.org>
Date2015-12-14 23:40 +0100
SubjectRe: [PATCH 1/2] dt-bindings: GPIO: Add generic serializer binding
Message-ID<qFJWH-3Ss-53@gated-at.bofh.it>
In reply to#1291346
On Mon, Dec 14, 2015 at 10:41 AM, Andrew F. Davis <afd@ti.com> wrote:
> On 12/11/2015 03:48 PM, Linus Walleij wrote:
>>
>> On Fri, Dec 11, 2015 at 8:46 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>
>>
>>
>>> +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".
>>
>>
>> I think it should also define compatible strings on the "vendor,device"
>> format apart from the generic compatible. Sooner or later we may need
>> to differentiate them and then that comes in handy.
>>
>
> Would it be better to wait until/if this issue arises? This driver
> targets the generic features, as these parts are very generic and
> have been produced by many companies since the 70s I'm not sure
> if privileging any of them makes much sense.
>
> What I'm worried about looks to have happened with the gpio-74x164
> driver, this is kind of the companion device to mine (74164 / 74165)
> and should work with any 74164 compatible shift register (possibly 100s
> of versions of them), but the compatible string that was added is
> "fairchild,74hc595", a relatively new device by a single manufacturer.
> The problem this has is then that boards will use this compatible string
> even if the parts are not actually the Fairchild version, just to get
> the match, when they should be using a generic string.

I agree the generic version is fine (or find who made the first part
;)). What "pisosr" is is not very obvious though. Having 74165 in the
compatible would make it somewhat more obvious it is a standard logic
part.

>>> +Optional properties:
>>> + - ngpios              : Number of GPIO lines, default is 8.
>>
>>
>> If you didn't do "pisosr-gpio" but instead "foo,sn74165", maybe you
>> don't need to have this in the device tree but instead it can be
>> determined from the compatible string?
>>
>> In that case do that.
>>
>
> These devices can be daisy-chained together, so three 8bit registers
> look exactly like one 24bit register. The only way to know this is
> from the physical wiring of the board, not from the part number.

Then you should say it must be multiple of 8 (or are there other lengths?).

Rob
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


#1291677 — Re: [PATCH 1/2] dt-bindings: GPIO: Add generic serializer binding

From"Andrew F. Davis" <afd@ti.com>
Date2015-12-15 00:30 +0100
SubjectRe: [PATCH 1/2] dt-bindings: GPIO: Add generic serializer binding
Message-ID<qFKJ4-4oW-11@gated-at.bofh.it>
In reply to#1291642
On 12/14/2015 04:36 PM, Rob Herring wrote:
> On Mon, Dec 14, 2015 at 10:41 AM, Andrew F. Davis <afd@ti.com> wrote:
>> On 12/11/2015 03:48 PM, Linus Walleij wrote:
>>>
>>> On Fri, Dec 11, 2015 at 8:46 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>
>>>
>>>
>>>> +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".
>>>
>>>
>>> I think it should also define compatible strings on the "vendor,device"
>>> format apart from the generic compatible. Sooner or later we may need
>>> to differentiate them and then that comes in handy.
>>>
>>
>> Would it be better to wait until/if this issue arises? This driver
>> targets the generic features, as these parts are very generic and
>> have been produced by many companies since the 70s I'm not sure
>> if privileging any of them makes much sense.
>>
>> What I'm worried about looks to have happened with the gpio-74x164
>> driver, this is kind of the companion device to mine (74164 / 74165)
>> and should work with any 74164 compatible shift register (possibly 100s
>> of versions of them), but the compatible string that was added is
>> "fairchild,74hc595", a relatively new device by a single manufacturer.
>> The problem this has is then that boards will use this compatible string
>> even if the parts are not actually the Fairchild version, just to get
>> the match, when they should be using a generic string.
>
> I agree the generic version is fine (or find who made the first part
> ;)). What "pisosr" is is not very obvious though. Having 74165 in the
> compatible would make it somewhat more obvious it is a standard logic
> part.
>

A quick search shows shift-registers being made from vacuum tubes for
the Colossus! Those might work with this driver if you could match the
voltage to an SPI bus... :)

I agree about the name not being very good, but I'm not sure about
74165 ether as it is also just a single part number. The idea was to
have a non-part number compatible string for any shift-register you
can hook to the SPI line. That way when we have boards with a sn65x882
or something we wont have to call it a 74165. But I guess that's why
it's a "compatible:" string, and not "is-a:" string.

>>>> +Optional properties:
>>>> + - ngpios              : Number of GPIO lines, default is 8.
>>>
>>>
>>> If you didn't do "pisosr-gpio" but instead "foo,sn74165", maybe you
>>> don't need to have this in the device tree but instead it can be
>>> determined from the compatible string?
>>>
>>> In that case do that.
>>>
>>
>> These devices can be daisy-chained together, so three 8bit registers
>> look exactly like one 24bit register. The only way to know this is
>> from the physical wiring of the board, not from the part number.
>
> Then you should say it must be multiple of 8 (or are there other lengths?).
>

Some are 4bit, you can even just hook a single flip-flop to the SPI bus for
a single bit (or multiples) of input.

Andrew

> Rob
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


#1293092 — Re: [PATCH 1/2] dt-bindings: GPIO: Add generic serializer binding

FromRob Herring <robh+dt@kernel.org>
Date2015-12-16 17:40 +0100
SubjectRe: [PATCH 1/2] dt-bindings: GPIO: Add generic serializer binding
Message-ID<qGnhp-4bq-31@gated-at.bofh.it>
In reply to#1291677
On Mon, Dec 14, 2015 at 5:19 PM, Andrew F. Davis <afd@ti.com> wrote:
> On 12/14/2015 04:36 PM, Rob Herring wrote:
>>
>> On Mon, Dec 14, 2015 at 10:41 AM, Andrew F. Davis <afd@ti.com> wrote:
>>>
>>> On 12/11/2015 03:48 PM, Linus Walleij wrote:
>>>>
>>>>
>>>> On Fri, Dec 11, 2015 at 8:46 PM, Andrew F. Davis <afd@ti.com> wrote:

[...]

>>>>> + - compatible          : Should be "pisosr-gpio".
>>>>
>>>>
>>>>
>>>> I think it should also define compatible strings on the "vendor,device"
>>>> format apart from the generic compatible. Sooner or later we may need
>>>> to differentiate them and then that comes in handy.
>>>>
>>>
>>> Would it be better to wait until/if this issue arises? This driver
>>> targets the generic features, as these parts are very generic and
>>> have been produced by many companies since the 70s I'm not sure
>>> if privileging any of them makes much sense.
>>>
>>> What I'm worried about looks to have happened with the gpio-74x164
>>> driver, this is kind of the companion device to mine (74164 / 74165)
>>> and should work with any 74164 compatible shift register (possibly 100s
>>> of versions of them), but the compatible string that was added is
>>> "fairchild,74hc595", a relatively new device by a single manufacturer.
>>> The problem this has is then that boards will use this compatible string
>>> even if the parts are not actually the Fairchild version, just to get
>>> the match, when they should be using a generic string.
>>
>>
>> I agree the generic version is fine (or find who made the first part
>> ;)). What "pisosr" is is not very obvious though. Having 74165 in the
>> compatible would make it somewhat more obvious it is a standard logic
>> part.
>>
>
> A quick search shows shift-registers being made from vacuum tubes for
> the Colossus! Those might work with this driver if you could match the
> voltage to an SPI bus... :)
>
> I agree about the name not being very good, but I'm not sure about
> 74165 ether as it is also just a single part number. The idea was to
> have a non-part number compatible string for any shift-register you
> can hook to the SPI line. That way when we have boards with a sn65x882
> or something we wont have to call it a 74165. But I guess that's why
> it's a "compatible:" string, and not "is-a:" string.

If there are a couple then I think it is okay. If there are 10s then
maybe not. Perhaps logic-pisosr or discrete-pisosr?

>>>>> +Optional properties:
>>>>> + - ngpios              : Number of GPIO lines, default is 8.
>>>>
>>>>
>>>>
>>>> If you didn't do "pisosr-gpio" but instead "foo,sn74165", maybe you
>>>> don't need to have this in the device tree but instead it can be
>>>> determined from the compatible string?
>>>>
>>>> In that case do that.
>>>>
>>>
>>> These devices can be daisy-chained together, so three 8bit registers
>>> look exactly like one 24bit register. The only way to know this is
>>> from the physical wiring of the board, not from the part number.
>>
>>
>> Then you should say it must be multiple of 8 (or are there other
>> lengths?).
>>
>
> Some are 4bit, you can even just hook a single flip-flop to the SPI bus for
> a single bit (or multiples) of input.

One would hope you would just connect the CS signal directly to that
input for 1-bit... I guess you could be out of GPIOs and only have a
free output only CS signal.

Rob
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


#1299425 — Re: [PATCH 1/2] dt-bindings: GPIO: Add generic serializer binding

From"Andrew F. Davis" <afd@ti.com>
Date2015-12-30 18:10 +0100
SubjectRe: [PATCH 1/2] dt-bindings: GPIO: Add generic serializer binding
Message-ID<qLsq6-YR-7@gated-at.bofh.it>
In reply to#1293092
On 12/16/2015 10:29 AM, Rob Herring wrote:
> On Mon, Dec 14, 2015 at 5:19 PM, Andrew F. Davis <afd@ti.com> wrote:
>> On 12/14/2015 04:36 PM, Rob Herring wrote:
>>>
>>> On Mon, Dec 14, 2015 at 10:41 AM, Andrew F. Davis <afd@ti.com> wrote:
>>>>
>>>> On 12/11/2015 03:48 PM, Linus Walleij wrote:
>>>>>
>>>>>
>>>>> On Fri, Dec 11, 2015 at 8:46 PM, Andrew F. Davis <afd@ti.com> wrote:
>
> [...]
>
>>>>>> + - compatible          : Should be "pisosr-gpio".
>>>>>
>>>>>
>>>>>
>>>>> I think it should also define compatible strings on the "vendor,device"
>>>>> format apart from the generic compatible. Sooner or later we may need
>>>>> to differentiate them and then that comes in handy.
>>>>>
>>>>
>>>> Would it be better to wait until/if this issue arises? This driver
>>>> targets the generic features, as these parts are very generic and
>>>> have been produced by many companies since the 70s I'm not sure
>>>> if privileging any of them makes much sense.
>>>>
>>>> What I'm worried about looks to have happened with the gpio-74x164
>>>> driver, this is kind of the companion device to mine (74164 / 74165)
>>>> and should work with any 74164 compatible shift register (possibly 100s
>>>> of versions of them), but the compatible string that was added is
>>>> "fairchild,74hc595", a relatively new device by a single manufacturer.
>>>> The problem this has is then that boards will use this compatible string
>>>> even if the parts are not actually the Fairchild version, just to get
>>>> the match, when they should be using a generic string.
>>>
>>>
>>> I agree the generic version is fine (or find who made the first part
>>> ;)). What "pisosr" is is not very obvious though. Having 74165 in the
>>> compatible would make it somewhat more obvious it is a standard logic
>>> part.
>>>
>>
>> A quick search shows shift-registers being made from vacuum tubes for
>> the Colossus! Those might work with this driver if you could match the
>> voltage to an SPI bus... :)
>>
>> I agree about the name not being very good, but I'm not sure about
>> 74165 ether as it is also just a single part number. The idea was to
>> have a non-part number compatible string for any shift-register you
>> can hook to the SPI line. That way when we have boards with a sn65x882
>> or something we wont have to call it a 74165. But I guess that's why
>> it's a "compatible:" string, and not "is-a:" string.
>
> If there are a couple then I think it is okay. If there are 10s then
> maybe not. Perhaps logic-pisosr or discrete-pisosr?
>

My concern as well, there are a lot of them, and every device doesn't
need its own string, so why privilege the name of any that don't have
anything different.

I'd like to leave the named ones for odd cases that needs special
handling.

>>>>>> +Optional properties:
>>>>>> + - ngpios              : Number of GPIO lines, default is 8.
>>>>>
>>>>>
>>>>>
>>>>> If you didn't do "pisosr-gpio" but instead "foo,sn74165", maybe you
>>>>> don't need to have this in the device tree but instead it can be
>>>>> determined from the compatible string?
>>>>>
>>>>> In that case do that.
>>>>>
>>>>
>>>> These devices can be daisy-chained together, so three 8bit registers
>>>> look exactly like one 24bit register. The only way to know this is
>>>> from the physical wiring of the board, not from the part number.
>>>
>>>
>>> Then you should say it must be multiple of 8 (or are there other
>>> lengths?).
>>>
>>
>> Some are 4bit, you can even just hook a single flip-flop to the SPI bus for
>> a single bit (or multiples) of input.
>
> One would hope you would just connect the CS signal directly to that
> input for 1-bit... I guess you could be out of GPIOs and only have a
> free output only CS signal.
>

Interesting use-case idea :), I'm more worried about a device with any
prime number of pins where multiples will fail, not that I have ever
seen one.

Andrew

> Rob
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


#1296668 — Re: [PATCH 1/2] dt-bindings: GPIO: Add generic serializer binding

FromLinus Walleij <linus.walleij@linaro.org>
Date2015-12-22 11:00 +0100
SubjectRe: [PATCH 1/2] dt-bindings: GPIO: Add generic serializer binding
Message-ID<qIrTB-2h1-27@gated-at.bofh.it>
In reply to#1291677
On Tue, Dec 15, 2015 at 12:19 AM, Andrew F. Davis <afd@ti.com> wrote:
> [Rob]
>> I agree the generic version is fine (or find who made the first part
>> ;)). What "pisosr" is is not very obvious though. Having 74165 in the
>> compatible would make it somewhat more obvious it is a standard logic
>> part.
>>
>
> A quick search shows shift-registers being made from vacuum tubes for
> the Colossus! Those might work with this driver if you could match the
> voltage to an SPI bus... :)
>
> I agree about the name not being very good, but I'm not sure about
> 74165 ether as it is also just a single part number.

We can add many compatible strings so it's not an issue.
"ti,74165" works for me as TI invented the 74xx series.

> The idea was to
> have a non-part number compatible string for any shift-register you
> can hook to the SPI line.

Again, one does not exclude the other. I'm happy with a generic
compatible *and* "ti,74165".

> That way when we have boards with a sn65x882
> or something we wont have to call it a 74165. But I guess that's why
> it's a "compatible:" string, and not "is-a:" string.

Compatible ranges from the specific to the more generic
so compatible = "ti,74165", "pisosr"; is just fine. Something
will match if there is a suitable driver. The OS may choose to
provide something part-specific or something more generic.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


#1299426 — Re: [PATCH 1/2] dt-bindings: GPIO: Add generic serializer binding

From"Andrew F. Davis" <afd@ti.com>
Date2015-12-30 18:10 +0100
SubjectRe: [PATCH 1/2] dt-bindings: GPIO: Add generic serializer binding
Message-ID<qLsq7-YR-25@gated-at.bofh.it>
In reply to#1296668
On 12/22/2015 03:51 AM, Linus Walleij wrote:
> On Tue, Dec 15, 2015 at 12:19 AM, Andrew F. Davis <afd@ti.com> wrote:
>> [Rob]
>>> I agree the generic version is fine (or find who made the first part
>>> ;)). What "pisosr" is is not very obvious though. Having 74165 in the
>>> compatible would make it somewhat more obvious it is a standard logic
>>> part.
>>>
>>
>> A quick search shows shift-registers being made from vacuum tubes for
>> the Colossus! Those might work with this driver if you could match the
>> voltage to an SPI bus... :)
>>
>> I agree about the name not being very good, but I'm not sure about
>> 74165 ether as it is also just a single part number.
>
> We can add many compatible strings so it's not an issue.
> "ti,74165" works for me as TI invented the 74xx series.
>

Free advertising for our parts :)

>> The idea was to
>> have a non-part number compatible string for any shift-register you
>> can hook to the SPI line.
>
> Again, one does not exclude the other. I'm happy with a generic
> compatible *and* "ti,74165".
>
>> That way when we have boards with a sn65x882
>> or something we wont have to call it a 74165. But I guess that's why
>> it's a "compatible:" string, and not "is-a:" string.
>
> Compatible ranges from the specific to the more generic
> so compatible = "ti,74165", "pisosr"; is just fine. Something
> will match if there is a suitable driver. The OS may choose to
> provide something part-specific or something more generic.
>

And so we won't need to have "ti,74165" in the driver itself,
if we just have "pisosr", then dts files can use what ever they
like to correctly identify the part then fall back to pisosr.

compatible = "company,random_numbers_of_exact_part_actually_on_board", "pisosr";

Andrew

> Yours,
> Linus Walleij
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


#1293667 — Re: [PATCH 1/2] dt-bindings: GPIO: Add generic serializer binding

FromGeert Uytterhoeven <geert@linux-m68k.org>
Date2015-12-17 09:30 +0100
SubjectRe: [PATCH 1/2] dt-bindings: GPIO: Add generic serializer binding
Message-ID<qGC6J-5hw-1@gated-at.bofh.it>
In reply to#1291346
On Thu, Dec 17, 2015 at 9:28 AM, Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
> Given the limitations of the '164 for SPI, is the same true for '165, and
> should it be "[...]74[...]597" instead?

Forget it, this driver is not about SPI.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


#1293669 — Re: [PATCH 1/2] dt-bindings: GPIO: Add generic serializer binding

FromGeert Uytterhoeven <geert@linux-m68k.org>
Date2015-12-17 09:30 +0100
SubjectRe: [PATCH 1/2] dt-bindings: GPIO: Add generic serializer binding
Message-ID<qGC6J-5hw-3@gated-at.bofh.it>
In reply to#1291346
On Mon, Dec 14, 2015 at 5:41 PM, Andrew F. Davis <afd@ti.com> wrote:
> What I'm worried about looks to have happened with the gpio-74x164
> driver, this is kind of the companion device to mine (74164 / 74165)
> and should work with any 74164 compatible shift register (possibly 100s
> of versions of them), but the compatible string that was added is
> "fairchild,74hc595", a relatively new device by a single manufacturer.

In hindsight, that probably should have been "motorola,mc74hc595" instead.
Recently I read that Motorola invented the 74hc59x for their "new" SPI bus
as that time, as the 74164 is not 100% SPI-compatible.

Given the limitations of the '164 for SPI, is the same true for '165, and
should it be "[...]74[...]597" instead?

> The problem this has is then that boards will use this compatible string
> even if the parts are not actually the Fairchild version, just to get
> the match, when they should be using a generic string.

They're all supposed to be "compatible".
Personally, I wouldn't object to just "74595", cfr. "ns16550a".

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


#1289932

FromLinus Walleij <linus.walleij@linaro.org>
Date2015-12-11 22:50 +0100
Message-ID<qEDJE-1yy-1@gated-at.bofh.it>
In reply to#1289864
On Fri, Dec 11, 2015 at 8:46 PM, Andrew F. Davis <afd@ti.com> wrote:

> This series adds a GPI(General Purpose Input) driver for generic
> parallel-in/serial-out shift registers, such as the SN65HVS882
> that this driver was tested on. This should also work for the rest
> of the SN65HVS88x series as well as other 74x165 style devices.

Pretty interesting, I'd like you to CC SPI maintainer Mark Brown
on this patch series, and the SPI mailing list.

Looking closer at the code.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web