2016-03-14 23:32:19

by Nicolas Saenz Julienne

[permalink] [raw]
Subject: [PATCH] gpio: 74x164: add dt support for nxp's 74x594

The chip is also an 8 bit shift register which works out of the box as a GPO
expander with this patch

Signed-off-by: Nicolas Saenz Julienne <[email protected]>
---
Documentation/devicetree/bindings/gpio/gpio-74x164.txt | 4 +++-
drivers/gpio/gpio-74x164.c | 1 +
2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/gpio/gpio-74x164.txt b/Documentation/devicetree/bindings/gpio/gpio-74x164.txt
index cc26080..ce1b223 100644
--- a/Documentation/devicetree/bindings/gpio/gpio-74x164.txt
+++ b/Documentation/devicetree/bindings/gpio/gpio-74x164.txt
@@ -1,7 +1,9 @@
* Generic 8-bits shift register GPIO driver

Required properties:
-- compatible : Should be "fairchild,74hc595"
+- compatible: Should contain one of the following:
+ "fairchild,74hc595"
+ "nxp,74lvc594"
- reg : chip select number
- gpio-controller : Marks the device node as a gpio controller.
- #gpio-cells : Should be two. The first cell is the pin number and
diff --git a/drivers/gpio/gpio-74x164.c b/drivers/gpio/gpio-74x164.c
index c81224f..ebd0d1a 100644
--- a/drivers/gpio/gpio-74x164.c
+++ b/drivers/gpio/gpio-74x164.c
@@ -153,6 +153,7 @@ static int gen_74x164_remove(struct spi_device *spi)

static const struct of_device_id gen_74x164_dt_ids[] = {
{ .compatible = "fairchild,74hc595" },
+ { .compatible = "nxp,74lvc594" },
{},
};
MODULE_DEVICE_TABLE(of, gen_74x164_dt_ids);
--
2.5.0


2016-03-15 15:28:03

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH] gpio: 74x164: add dt support for nxp's 74x594

On Tue, Mar 15, 2016 at 12:32 AM, Nicolas Saenz Julienne
<[email protected]> wrote:
> The chip is also an 8 bit shift register which works out of the box as a GPO
> expander with this patch
>
> Signed-off-by: Nicolas Saenz Julienne <[email protected]>
> ---
> Documentation/devicetree/bindings/gpio/gpio-74x164.txt | 4 +++-
> drivers/gpio/gpio-74x164.c | 1 +
> 2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/gpio/gpio-74x164.txt b/Documentation/devicetree/bindings/gpio/gpio-74x164.txt
> index cc26080..ce1b223 100644
> --- a/Documentation/devicetree/bindings/gpio/gpio-74x164.txt
> +++ b/Documentation/devicetree/bindings/gpio/gpio-74x164.txt
> @@ -1,7 +1,9 @@
> * Generic 8-bits shift register GPIO driver
>
> Required properties:
> -- compatible : Should be "fairchild,74hc595"
> +- compatible: Should contain one of the following:
> + "fairchild,74hc595"
> + "nxp,74lvc594"

Why did you choose the "lvc" variant?

Ideally, you want to put the oldest "manuf,74x594" variant here.
I once read it was Motorola who invented the 7459x parts, to interface with
SPI.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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

2016-03-18 20:26:44

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH] gpio: 74x164: add dt support for nxp's 74x594

On Mon, Mar 14, 2016 at 11:32:10PM +0000, Nicolas Saenz Julienne wrote:
> The chip is also an 8 bit shift register which works out of the box as a GPO
> expander with this patch
>
> Signed-off-by: Nicolas Saenz Julienne <[email protected]>
> ---
> Documentation/devicetree/bindings/gpio/gpio-74x164.txt | 4 +++-
> drivers/gpio/gpio-74x164.c | 1 +
> 2 files changed, 4 insertions(+), 1 deletion(-)

Acked-by: Rob Herring <[email protected]>

>
> diff --git a/Documentation/devicetree/bindings/gpio/gpio-74x164.txt b/Documentation/devicetree/bindings/gpio/gpio-74x164.txt
> index cc26080..ce1b223 100644
> --- a/Documentation/devicetree/bindings/gpio/gpio-74x164.txt
> +++ b/Documentation/devicetree/bindings/gpio/gpio-74x164.txt
> @@ -1,7 +1,9 @@
> * Generic 8-bits shift register GPIO driver
>
> Required properties:
> -- compatible : Should be "fairchild,74hc595"
> +- compatible: Should contain one of the following:
> + "fairchild,74hc595"
> + "nxp,74lvc594"
> - reg : chip select number
> - gpio-controller : Marks the device node as a gpio controller.
> - #gpio-cells : Should be two. The first cell is the pin number and
> diff --git a/drivers/gpio/gpio-74x164.c b/drivers/gpio/gpio-74x164.c
> index c81224f..ebd0d1a 100644
> --- a/drivers/gpio/gpio-74x164.c
> +++ b/drivers/gpio/gpio-74x164.c
> @@ -153,6 +153,7 @@ static int gen_74x164_remove(struct spi_device *spi)
>
> static const struct of_device_id gen_74x164_dt_ids[] = {
> { .compatible = "fairchild,74hc595" },
> + { .compatible = "nxp,74lvc594" },
> {},
> };
> MODULE_DEVICE_TABLE(of, gen_74x164_dt_ids);
> --
> 2.5.0
>
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html

2016-03-22 10:57:10

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH] gpio: 74x164: add dt support for nxp's 74x594

Hi Nicolas,

On Tue, Mar 22, 2016 at 11:42 AM, nicolas saenz julienne
<[email protected]> wrote:
>> Why did you choose the "lvc" variant?
> Well to be honest the HW people did and it's all I could test with. I don't
> know much about these naming schemes, apart from the intuition it has to do
> with frequency and line levels.
>
>> Ideally, you want to put the oldest "manuf,74x594" variant here.
> What do you mean by oldest? What would you suggest? it's funny because the chip
> is going to be used on a new product that is meant to be produced for years.

For DT bindings, it doesn't matter who manufactured the part, or which
technology was used (TTL, HC, LVC, ...).

Logically, the shiny new parts are compatible with the old ones, from as early
as the 1960s.

Especially for standard logic glue, where you can source parts from several
manufacturers, and which are available in many different technologies, it
doesn't make much sense to have all combinations in the DT bindings.

https://en.wikipedia.org/wiki/7400_series

Now, which one to pick?
Given the precedence set by the existing compatible value "fairchild,74hc595",
perhaps the most logical one to add is "fairchild,74hc594"?

Or can we just drop the manufacturer?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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

2016-03-22 11:11:10

by Nicolas Saenz Julienne

[permalink] [raw]
Subject: Re: [PATCH] gpio: 74x164: add dt support for nxp's 74x594

Hi sorry for the late response but I was on vacation.
>
> Why did you choose the "lvc" variant?
Well to be honest the HW people did and it's all I could test with. I don't
know much about these naming schemes, apart from the intuition it has to do
with frequency and line levels.

> Ideally, you want to put the oldest "manuf,74x594" variant here.
What do you mean by oldest? What would you suggest? it's funny because the chip
is going to be used on a new product that is meant to be produced for years.

> I once read it was Motorola who invented the 7459x parts, to interface with
> SPI.
>
> Gr{oetje,eeting}s,
>
> Geert
>
Thanks for your comments!
Nicolas

2016-03-22 23:16:15

by Nicolas Saenz Julienne

[permalink] [raw]
Subject: Re: [PATCH] gpio: 74x164: add dt support for nxp's 74x594

Hi Geert, thanks for your reply.

On Tue, Mar 22, 2016 at 11:56:51AM +0100, Geert Uytterhoeven wrote:
[..]
> For DT bindings, it doesn't matter who manufactured the part, or which
> technology was used (TTL, HC, LVC, ...).
>
> Logically, the shiny new parts are compatible with the old ones, from as early
> as the 1960s.
>
> Especially for standard logic glue, where you can source parts from several
> manufacturers, and which are available in many different technologies, it
> doesn't make much sense to have all combinations in the DT bindings.
>
> https://en.wikipedia.org/wiki/7400_series
That did the trick.

>
> Now, which one to pick?
> Given the precedence set by the existing compatible value "fairchild,74hc595",
> perhaps the most logical one to add is "fairchild,74hc594"?
>
> Or can we just drop the manufacturer?
Well as you say DT doesn't care for technology nor manufacturer. I'd go for
dropping the manufacturer and adding an "x" for the technology (i.e. 74x595).
I saw that the binding is being used on some boards is there any rule against
changing bindings that are already being used?

>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
>
> 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
I'll happily do a new version of the patch if the idea is worth it.

Nicolas

2016-03-31 08:26:59

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH] gpio: 74x164: add dt support for nxp's 74x594

On Tue, Mar 15, 2016 at 12:32 AM, Nicolas Saenz Julienne
<[email protected]> wrote:

> The chip is also an 8 bit shift register which works out of the box as a GPO
> expander with this patch
>
> Signed-off-by: Nicolas Saenz Julienne <[email protected]>

Patch applied.

I'm not a compatible-string minimalist. Add as many as you
like.

Yours,
Linus Walleij