devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpio: 74x164: add dt support for nxp's 74x594
@ 2016-03-14 23:32 Nicolas Saenz Julienne
       [not found] ` <1457998330-8070-1-git-send-email-nicolassaenzj-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Nicolas Saenz Julienne @ 2016-03-14 23:32 UTC (permalink / raw)
  To: linus.walleij
  Cc: gnurou, devicetree, linux-kernel, linux-gpio, robh+dt,
	pawel.moll, mark.rutland, ijc+devicetree, galak

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 <nicolassaenzj@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] gpio: 74x164: add dt support for nxp's 74x594
       [not found] ` <1457998330-8070-1-git-send-email-nicolassaenzj-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2016-03-15 15:27   ` Geert Uytterhoeven
  2016-03-22 10:42     ` nicolas saenz julienne
  0 siblings, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2016-03-15 15:27 UTC (permalink / raw)
  To: Nicolas Saenz Julienne
  Cc: Linus Walleij, Alexandre Courbot,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-gpio-u79uwXL29TY76Z2rM5mHXA, Rob Herring, Pawel Moll,
	Mark Rutland, Ian Campbell, Kumar Gala

On Tue, Mar 15, 2016 at 12:32 AM, Nicolas Saenz Julienne
<nicolassaenzj-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 <nicolassaenzj-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
>  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 -- geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.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 devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] gpio: 74x164: add dt support for nxp's 74x594
  2016-03-14 23:32 [PATCH] gpio: 74x164: add dt support for nxp's 74x594 Nicolas Saenz Julienne
       [not found] ` <1457998330-8070-1-git-send-email-nicolassaenzj-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2016-03-18 20:26 ` Rob Herring
  2016-03-31  8:26 ` Linus Walleij
  2 siblings, 0 replies; 7+ messages in thread
From: Rob Herring @ 2016-03-18 20:26 UTC (permalink / raw)
  To: Nicolas Saenz Julienne
  Cc: linus.walleij, gnurou, devicetree, linux-kernel, linux-gpio,
	pawel.moll, mark.rutland, ijc+devicetree, galak

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 <nicolassaenzj@gmail.com>
> ---
>  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 <robh@kernel.org>

> 
> 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 majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] gpio: 74x164: add dt support for nxp's 74x594
  2016-03-15 15:27   ` Geert Uytterhoeven
@ 2016-03-22 10:42     ` nicolas saenz julienne
  2016-03-22 10:56       ` Geert Uytterhoeven
  0 siblings, 1 reply; 7+ messages in thread
From: nicolas saenz julienne @ 2016-03-22 10:42 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Linus Walleij, Alexandre Courbot, devicetree, linux-kernel,
	linux-gpio, Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell,
	Kumar Gala

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] gpio: 74x164: add dt support for nxp's 74x594
  2016-03-22 10:42     ` nicolas saenz julienne
@ 2016-03-22 10:56       ` Geert Uytterhoeven
       [not found]         ` <CAMuHMdWTteucxUgBU=d6=bckaZrn0vmr8LYW08UdULEtQYFzpg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2016-03-22 10:56 UTC (permalink / raw)
  To: nicolas saenz julienne
  Cc: Linus Walleij, Alexandre Courbot, devicetree, linux-kernel,
	linux-gpio, Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell,
	Kumar Gala

Hi Nicolas,

On Tue, Mar 22, 2016 at 11:42 AM, nicolas saenz julienne
<nicolassaenzj@gmail.com> 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 -- 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] gpio: 74x164: add dt support for nxp's 74x594
       [not found]         ` <CAMuHMdWTteucxUgBU=d6=bckaZrn0vmr8LYW08UdULEtQYFzpg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2016-03-22 23:16           ` Nicolas Saenz Julienne
  0 siblings, 0 replies; 7+ messages in thread
From: Nicolas Saenz Julienne @ 2016-03-22 23:16 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Linus Walleij, Alexandre Courbot,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-gpio-u79uwXL29TY76Z2rM5mHXA, Rob Herring, Pawel Moll,
	Mark Rutland, Ian Campbell, Kumar Gala

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 -- geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.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
I'll happily do a new version of the patch if the idea is worth it.

	Nicolas
--
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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] gpio: 74x164: add dt support for nxp's 74x594
  2016-03-14 23:32 [PATCH] gpio: 74x164: add dt support for nxp's 74x594 Nicolas Saenz Julienne
       [not found] ` <1457998330-8070-1-git-send-email-nicolassaenzj-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2016-03-18 20:26 ` Rob Herring
@ 2016-03-31  8:26 ` Linus Walleij
  2 siblings, 0 replies; 7+ messages in thread
From: Linus Walleij @ 2016-03-31  8:26 UTC (permalink / raw)
  To: Nicolas Saenz Julienne
  Cc: Alexandre Courbot, devicetree, linux-kernel, linux-gpio,
	Rob Herring, Paweł Moll, Mark Rutland, ijc+devicetree,
	Kumar Gala

On Tue, Mar 15, 2016 at 12:32 AM, Nicolas Saenz Julienne
<nicolassaenzj@gmail.com> 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 <nicolassaenzj@gmail.com>

Patch applied.

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

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-03-31  8:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-14 23:32 [PATCH] gpio: 74x164: add dt support for nxp's 74x594 Nicolas Saenz Julienne
     [not found] ` <1457998330-8070-1-git-send-email-nicolassaenzj-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-03-15 15:27   ` Geert Uytterhoeven
2016-03-22 10:42     ` nicolas saenz julienne
2016-03-22 10:56       ` Geert Uytterhoeven
     [not found]         ` <CAMuHMdWTteucxUgBU=d6=bckaZrn0vmr8LYW08UdULEtQYFzpg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-03-22 23:16           ` Nicolas Saenz Julienne
2016-03-18 20:26 ` Rob Herring
2016-03-31  8:26 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).