diff mbox

gpio: rcar: Add r8a7793 and r8a7794 support

Message ID 1415352219-26644-1-git-send-email-ykaneko0929@gmail.com
State Superseded
Headers show

Commit Message

Yoshihiro Kaneko Nov. 7, 2014, 9:23 a.m. UTC
From: Hisashi Nakamura <hisashi.nakamura.ak@renesas.com>

The device tree probing for R-Car M2-N (r8a7793) and R-Car E2 (r8a7794)
is added.

Signed-off-by: Hisashi Nakamura <hisashi.nakamura.ak@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
---

This patch is based on for-next branch of Linus Walleij's gpio tree.

 Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt |  4 +++-
 drivers/gpio/gpio-rcar.c                                     | 11 +++++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

Comments

Geert Uytterhoeven Nov. 7, 2014, 9:43 a.m. UTC | #1
Hi Kaneko-san,

On Fri, Nov 7, 2014 at 10:23 AM, Yoshihiro Kaneko <ykaneko0929@gmail.com> wrote:
> --- a/drivers/gpio/gpio-rcar.c
> +++ b/drivers/gpio/gpio-rcar.c
> @@ -1,6 +1,7 @@
>  /*
>   * Renesas R-Car GPIO Support
>   *
> + *  Copyright (C) 2014 Renesas Electronics Corporation
>   *  Copyright (C) 2013 Magnus Damm
>   *
>   * This program is free software; you can redistribute it and/or modify
> @@ -327,6 +328,16 @@ static const struct of_device_id gpio_rcar_of_table[] = {
>                         .has_both_edge_trigger = true,
>                 },
>         }, {
> +               .compatible = "renesas,gpio-r8a7793",
> +               .data = (void *)&(const struct gpio_rcar_info) {
> +                       .has_both_edge_trigger = true,
> +               },
> +       }, {
> +               .compatible = "renesas,gpio-r8a7794",
> +               .data = (void *)&(const struct gpio_rcar_info) {
> +                       .has_both_edge_trigger = true,
> +               },

Given we now have 4 identical copies of the above struct gpio_rcar_info,
I think it starts to make sense to create

        static struct gpio_rcar_info gpio_rcar_info_gen2 = {
                .has_both_edge_trigger = true;
        };

and just reference that one from gpio_rcar_of_table[].
While at it, you can do the same for R-Car Gen 1 for consistency.

> +       }, {

Otherwise:

Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>

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-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Yoshihiro Kaneko Nov. 7, 2014, 10:49 a.m. UTC | #2
Hi Geert-san,

2014-11-07 18:43 GMT+09:00 Geert Uytterhoeven <geert@linux-m68k.org>:
> Hi Kaneko-san,
>
> On Fri, Nov 7, 2014 at 10:23 AM, Yoshihiro Kaneko <ykaneko0929@gmail.com> wrote:
>> --- a/drivers/gpio/gpio-rcar.c
>> +++ b/drivers/gpio/gpio-rcar.c
>> @@ -1,6 +1,7 @@
>>  /*
>>   * Renesas R-Car GPIO Support
>>   *
>> + *  Copyright (C) 2014 Renesas Electronics Corporation
>>   *  Copyright (C) 2013 Magnus Damm
>>   *
>>   * This program is free software; you can redistribute it and/or modify
>> @@ -327,6 +328,16 @@ static const struct of_device_id gpio_rcar_of_table[] = {
>>                         .has_both_edge_trigger = true,
>>                 },
>>         }, {
>> +               .compatible = "renesas,gpio-r8a7793",
>> +               .data = (void *)&(const struct gpio_rcar_info) {
>> +                       .has_both_edge_trigger = true,
>> +               },
>> +       }, {
>> +               .compatible = "renesas,gpio-r8a7794",
>> +               .data = (void *)&(const struct gpio_rcar_info) {
>> +                       .has_both_edge_trigger = true,
>> +               },
>
> Given we now have 4 identical copies of the above struct gpio_rcar_info,
> I think it starts to make sense to create
>
>         static struct gpio_rcar_info gpio_rcar_info_gen2 = {
>                 .has_both_edge_trigger = true;
>         };
>
> and just reference that one from gpio_rcar_of_table[].
> While at it, you can do the same for R-Car Gen 1 for consistency.

Is the following what you intended?

+static const struct gpio_rcar_info gpio_rcar_info_gen2 = {
+       .has_both_edge_trigger = true,
+};
+
 static const struct of_device_id gpio_rcar_of_table[] = {
        {
                .compatible = "renesas,gpio-r8a7790",
-               .data = (void *)&(const struct gpio_rcar_info) {
-                       .has_both_edge_trigger = true,
-               },
+               .data = &gpio_rcar_info_gen2,
        }, {
                .compatible = "renesas,gpio-r8a7791",
-               .data = (void *)&(const struct gpio_rcar_info) {
-                       .has_both_edge_trigger = true,
-               },
+               .data = &gpio_rcar_info_gen2,
+       }, {
+               .compatible = "renesas,gpio-r8a7793",
+               .data = &gpio_rcar_info_gen2,
+       }, {
+               .compatible = "renesas,gpio-r8a7794",
+               .data = &gpio_rcar_info_gen2,
        }, {
                .compatible = "renesas,gpio-rcar",
                .data = (void *)&(const struct gpio_rcar_info) {
                        .has_both_edge_trigger = false,
                },


Thanks,
Kaneko

>
>> +       }, {
>
> Otherwise:
>
> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
> 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-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Geert Uytterhoeven Nov. 7, 2014, 10:51 a.m. UTC | #3
Hi Kaneko-san,

On Fri, Nov 7, 2014 at 11:49 AM, Yoshihiro Kaneko <ykaneko0929@gmail.com> wrote:
>> Given we now have 4 identical copies of the above struct gpio_rcar_info,
>> I think it starts to make sense to create
>>
>>         static struct gpio_rcar_info gpio_rcar_info_gen2 = {
>>                 .has_both_edge_trigger = true;
>>         };
>>
>> and just reference that one from gpio_rcar_of_table[].
>> While at it, you can do the same for R-Car Gen 1 for consistency.
>
> Is the following what you intended?

Yes, thank you very much.

Please add a similar struct for R-Car Gen1.

> +static const struct gpio_rcar_info gpio_rcar_info_gen2 = {
> +       .has_both_edge_trigger = true,
> +};
> +
>  static const struct of_device_id gpio_rcar_of_table[] = {
>         {
>                 .compatible = "renesas,gpio-r8a7790",
> -               .data = (void *)&(const struct gpio_rcar_info) {
> -                       .has_both_edge_trigger = true,
> -               },
> +               .data = &gpio_rcar_info_gen2,
>         }, {
>                 .compatible = "renesas,gpio-r8a7791",
> -               .data = (void *)&(const struct gpio_rcar_info) {
> -                       .has_both_edge_trigger = true,
> -               },
> +               .data = &gpio_rcar_info_gen2,
> +       }, {
> +               .compatible = "renesas,gpio-r8a7793",
> +               .data = &gpio_rcar_info_gen2,
> +       }, {
> +               .compatible = "renesas,gpio-r8a7794",
> +               .data = &gpio_rcar_info_gen2,
>         }, {
>                 .compatible = "renesas,gpio-rcar",
>                 .data = (void *)&(const struct gpio_rcar_info) {
>                         .has_both_edge_trigger = false,
>                 },

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-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Yoshihiro Kaneko Nov. 7, 2014, 11:17 a.m. UTC | #4
Hi Geert-san,

2014-11-07 19:51 GMT+09:00 Geert Uytterhoeven <geert@linux-m68k.org>:
> Hi Kaneko-san,
>
> On Fri, Nov 7, 2014 at 11:49 AM, Yoshihiro Kaneko <ykaneko0929@gmail.com> wrote:
>>> Given we now have 4 identical copies of the above struct gpio_rcar_info,
>>> I think it starts to make sense to create
>>>
>>>         static struct gpio_rcar_info gpio_rcar_info_gen2 = {
>>>                 .has_both_edge_trigger = true;
>>>         };
>>>
>>> and just reference that one from gpio_rcar_of_table[].
>>> While at it, you can do the same for R-Car Gen 1 for consistency.
>>
>> Is the following what you intended?
>
> Yes, thank you very much.
>
> Please add a similar struct for R-Car Gen1.

I'm not sure about R-Car Gen1.
Is it the following things?

+static const struct gpio_rcar_info gpio_rcar_info_gen1 = {
+       .has_both_edge_trigger = false,
+};
[...]
        }, {
                .compatible = "renesas,gpio-rcar",
-               .data = (void *)&(const struct gpio_rcar_info) {
-                       .has_both_edge_trigger = false,
-               },
+               .data = &gpio_rcar_info_gen1,
        }, {


Thanks,
Kaneko

>
>> +static const struct gpio_rcar_info gpio_rcar_info_gen2 = {
>> +       .has_both_edge_trigger = true,
>> +};
>> +
>>  static const struct of_device_id gpio_rcar_of_table[] = {
>>         {
>>                 .compatible = "renesas,gpio-r8a7790",
>> -               .data = (void *)&(const struct gpio_rcar_info) {
>> -                       .has_both_edge_trigger = true,
>> -               },
>> +               .data = &gpio_rcar_info_gen2,
>>         }, {
>>                 .compatible = "renesas,gpio-r8a7791",
>> -               .data = (void *)&(const struct gpio_rcar_info) {
>> -                       .has_both_edge_trigger = true,
>> -               },
>> +               .data = &gpio_rcar_info_gen2,
>> +       }, {
>> +               .compatible = "renesas,gpio-r8a7793",
>> +               .data = &gpio_rcar_info_gen2,
>> +       }, {
>> +               .compatible = "renesas,gpio-r8a7794",
>> +               .data = &gpio_rcar_info_gen2,
>>         }, {
>>                 .compatible = "renesas,gpio-rcar",
>>                 .data = (void *)&(const struct gpio_rcar_info) {
>>                         .has_both_edge_trigger = false,
>>                 },
>
> 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-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Geert Uytterhoeven Nov. 7, 2014, 11:24 a.m. UTC | #5
Hi Kaneko-san,

On Fri, Nov 7, 2014 at 12:17 PM, Yoshihiro Kaneko <ykaneko0929@gmail.com> wrote:
> 2014-11-07 19:51 GMT+09:00 Geert Uytterhoeven <geert@linux-m68k.org>:
>> On Fri, Nov 7, 2014 at 11:49 AM, Yoshihiro Kaneko <ykaneko0929@gmail.com> wrote:
>>>> Given we now have 4 identical copies of the above struct gpio_rcar_info,
>>>> I think it starts to make sense to create
>>>>
>>>>         static struct gpio_rcar_info gpio_rcar_info_gen2 = {
>>>>                 .has_both_edge_trigger = true;
>>>>         };
>>>>
>>>> and just reference that one from gpio_rcar_of_table[].
>>>> While at it, you can do the same for R-Car Gen 1 for consistency.
>>>
>>> Is the following what you intended?
>>
>> Yes, thank you very much.
>>
>> Please add a similar struct for R-Car Gen1.
>
> I'm not sure about R-Car Gen1.
> Is it the following things?
>
> +static const struct gpio_rcar_info gpio_rcar_info_gen1 = {
> +       .has_both_edge_trigger = false,
> +};
> [...]
>         }, {
>                 .compatible = "renesas,gpio-rcar",
> -               .data = (void *)&(const struct gpio_rcar_info) {
> -                       .has_both_edge_trigger = false,
> -               },
> +               .data = &gpio_rcar_info_gen1,
>         }, {

Yes, that looks fine to me.

Thanks.

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-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Yoshihiro Kaneko Nov. 7, 2014, 11:31 a.m. UTC | #6
Hi Geert-san,

2014-11-07 20:24 GMT+09:00 Geert Uytterhoeven <geert@linux-m68k.org>:
> Hi Kaneko-san,
>
> On Fri, Nov 7, 2014 at 12:17 PM, Yoshihiro Kaneko <ykaneko0929@gmail.com> wrote:
>> 2014-11-07 19:51 GMT+09:00 Geert Uytterhoeven <geert@linux-m68k.org>:
>>> On Fri, Nov 7, 2014 at 11:49 AM, Yoshihiro Kaneko <ykaneko0929@gmail.com> wrote:
>>>>> Given we now have 4 identical copies of the above struct gpio_rcar_info,
>>>>> I think it starts to make sense to create
>>>>>
>>>>>         static struct gpio_rcar_info gpio_rcar_info_gen2 = {
>>>>>                 .has_both_edge_trigger = true;
>>>>>         };
>>>>>
>>>>> and just reference that one from gpio_rcar_of_table[].
>>>>> While at it, you can do the same for R-Car Gen 1 for consistency.
>>>>
>>>> Is the following what you intended?
>>>
>>> Yes, thank you very much.
>>>
>>> Please add a similar struct for R-Car Gen1.
>>
>> I'm not sure about R-Car Gen1.
>> Is it the following things?
>>
>> +static const struct gpio_rcar_info gpio_rcar_info_gen1 = {
>> +       .has_both_edge_trigger = false,
>> +};
>> [...]
>>         }, {
>>                 .compatible = "renesas,gpio-rcar",
>> -               .data = (void *)&(const struct gpio_rcar_info) {
>> -                       .has_both_edge_trigger = false,
>> -               },
>> +               .data = &gpio_rcar_info_gen1,
>>         }, {
>
> Yes, that looks fine to me.

Many thanks!
I'll update this patch.

Thanks,
Kaneko


>
> Thanks.
>
> 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-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/renesas,gpio-rcar.txt b/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
index 941a26a..38fb86f 100644
--- a/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
+++ b/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
@@ -6,7 +6,9 @@  Required Properties:
     - "renesas,gpio-r8a7778": for R8A7778 (R-Mobile M1) compatible GPIO controller.
     - "renesas,gpio-r8a7779": for R8A7779 (R-Car H1) compatible GPIO controller.
     - "renesas,gpio-r8a7790": for R8A7790 (R-Car H2) compatible GPIO controller.
-    - "renesas,gpio-r8a7791": for R8A7791 (R-Car M2) compatible GPIO controller.
+    - "renesas,gpio-r8a7791": for R8A7791 (R-Car M2-W) compatible GPIO controller.
+    - "renesas,gpio-r8a7793": for R8A7793 (R-Car M2-N) compatible GPIO controller.
+    - "renesas,gpio-r8a7794": for R8A7794 (R-Car E2) compatible GPIO controller.
     - "renesas,gpio-rcar": for generic R-Car GPIO controller.
 
   - reg: Base address and length of each memory resource used by the GPIO
diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c
index ef71ca8..947654e 100644
--- a/drivers/gpio/gpio-rcar.c
+++ b/drivers/gpio/gpio-rcar.c
@@ -1,6 +1,7 @@ 
 /*
  * Renesas R-Car GPIO Support
  *
+ *  Copyright (C) 2014 Renesas Electronics Corporation
  *  Copyright (C) 2013 Magnus Damm
  *
  * This program is free software; you can redistribute it and/or modify
@@ -327,6 +328,16 @@  static const struct of_device_id gpio_rcar_of_table[] = {
 			.has_both_edge_trigger = true,
 		},
 	}, {
+		.compatible = "renesas,gpio-r8a7793",
+		.data = (void *)&(const struct gpio_rcar_info) {
+			.has_both_edge_trigger = true,
+		},
+	}, {
+		.compatible = "renesas,gpio-r8a7794",
+		.data = (void *)&(const struct gpio_rcar_info) {
+			.has_both_edge_trigger = true,
+		},
+	}, {
 		.compatible = "renesas,gpio-rcar",
 		.data = (void *)&(const struct gpio_rcar_info) {
 			.has_both_edge_trigger = false,