diff mbox

[2/2] usb: renesas_usbhs: Add support for R-Car E2

Message ID 1431941665-3768-3-git-send-email-yoshihiro.shimoda.uh@renesas.com
State Superseded, archived
Headers show

Commit Message

Yoshihiro Shimoda May 18, 2015, 9:34 a.m. UTC
This patch adds a compatible string to support for R-Car E2.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
---
 Documentation/devicetree/bindings/usb/renesas_usbhs.txt | 1 +
 drivers/usb/renesas_usbhs/common.c                      | 6 ++++++
 include/linux/usb/renesas_usbhs.h                       | 1 +
 3 files changed, 8 insertions(+)

Comments

Geert Uytterhoeven May 18, 2015, 9:48 a.m. UTC | #1
Hi Shimoda-san,

On Mon, May 18, 2015 at 11:34 AM, Yoshihiro Shimoda
<yoshihiro.shimoda.uh@renesas.com> wrote:
> This patch adds a compatible string to support for R-Car E2.
>
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> ---
>  Documentation/devicetree/bindings/usb/renesas_usbhs.txt | 1 +
>  drivers/usb/renesas_usbhs/common.c                      | 6 ++++++
>  include/linux/usb/renesas_usbhs.h                       | 1 +
>  3 files changed, 8 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
> index ddbe304..64a4ca6 100644
> --- a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
> +++ b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
> @@ -4,6 +4,7 @@ Required properties:
>    - compatible: Must contain one of the following:
>         - "renesas,usbhs-r8a7790"
>         - "renesas,usbhs-r8a7791"
> +       - "renesas,usbhs-r8a7794"
>    - reg: Base address and length of the register for the USBHS
>    - interrupts: Interrupt specifier for the USBHS
>    - clocks: A list of phandle + clock specifier pairs

For the DT binding part:
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>

> diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c
> index 0f7e850..954357f 100644
> --- a/drivers/usb/renesas_usbhs/common.c
> +++ b/drivers/usb/renesas_usbhs/common.c
> @@ -472,6 +472,10 @@ static const struct of_device_id usbhs_of_match[] = {
>                 .compatible = "renesas,usbhs-r8a7791",
>                 .data = (void *)USBHS_TYPE_R8A7791,
>         },
> +       {
> +               .compatible = "renesas,usbhs-r8a7794",
> +               .data = (void *)USBHS_TYPE_R8A7794,
> +       },
>         { },
>  };
>  MODULE_DEVICE_TABLE(of, usbhs_of_match);
> @@ -500,6 +504,7 @@ static struct renesas_usbhs_platform_info *usbhs_parse_dt(struct device *dev)
>         switch (dparam->type) {
>         case USBHS_TYPE_R8A7790:
>         case USBHS_TYPE_R8A7791:
> +       case USBHS_TYPE_R8A7794:
>                 dparam->has_usb_dmac = 1;
>                 break;
>         default:
> @@ -561,6 +566,7 @@ static int usbhs_probe(struct platform_device *pdev)
>         switch (priv->dparam.type) {
>         case USBHS_TYPE_R8A7790:
>         case USBHS_TYPE_R8A7791:
> +       case USBHS_TYPE_R8A7794:

Given all R-Car Gen2 variants are treated the same...

>                 priv->pfunc = usbhs_rcar2_ops;
>                 if (!priv->dparam.pipe_type) {
>                         priv->dparam.pipe_type = usbhsc_new_pipe_type;
> diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h
> index e438e72..08c62ba 100644
> --- a/include/linux/usb/renesas_usbhs.h
> +++ b/include/linux/usb/renesas_usbhs.h
> @@ -172,6 +172,7 @@ struct renesas_usbhs_driver_param {
>  enum {
>         USBHS_TYPE_R8A7790 = 1,
>         USBHS_TYPE_R8A7791,
> +       USBHS_TYPE_R8A7794,

... perhaps it would be better to just have a single USBHS_TYPE_RCAR_GEN2,
so you don't have to add more enums and case statements?

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 devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Yoshihiro Shimoda May 18, 2015, 10:04 a.m. UTC | #2
Hi Geert-san,

> Sent: Monday, May 18, 2015 6:49 PM

> 

> Hi Shimoda-san,

> 

> On Mon, May 18, 2015 at 11:34 AM, Yoshihiro Shimoda

< snip >
> > diff --git a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt

> b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt

> > index ddbe304..64a4ca6 100644

> > --- a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt

> > +++ b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt

> > @@ -4,6 +4,7 @@ Required properties:

> >    - compatible: Must contain one of the following:

> >         - "renesas,usbhs-r8a7790"

> >         - "renesas,usbhs-r8a7791"

> > +       - "renesas,usbhs-r8a7794"

> >    - reg: Base address and length of the register for the USBHS

> >    - interrupts: Interrupt specifier for the USBHS

> >    - clocks: A list of phandle + clock specifier pairs

> 

> For the DT binding part:

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


Thank you for the Acked-by!

> > diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c

> > index 0f7e850..954357f 100644

> > --- a/drivers/usb/renesas_usbhs/common.c

> > +++ b/drivers/usb/renesas_usbhs/common.c

> > @@ -472,6 +472,10 @@ static const struct of_device_id usbhs_of_match[] = {

> >                 .compatible = "renesas,usbhs-r8a7791",

> >                 .data = (void *)USBHS_TYPE_R8A7791,

> >         },

> > +       {

> > +               .compatible = "renesas,usbhs-r8a7794",

> > +               .data = (void *)USBHS_TYPE_R8A7794,

> > +       },

> >         { },

> >  };

> >  MODULE_DEVICE_TABLE(of, usbhs_of_match);

> > @@ -500,6 +504,7 @@ static struct renesas_usbhs_platform_info *usbhs_parse_dt(struct device *dev)

> >         switch (dparam->type) {

> >         case USBHS_TYPE_R8A7790:

> >         case USBHS_TYPE_R8A7791:

> > +       case USBHS_TYPE_R8A7794:

> >                 dparam->has_usb_dmac = 1;

> >                 break;

> >         default:

> > @@ -561,6 +566,7 @@ static int usbhs_probe(struct platform_device *pdev)

> >         switch (priv->dparam.type) {

> >         case USBHS_TYPE_R8A7790:

> >         case USBHS_TYPE_R8A7791:

> > +       case USBHS_TYPE_R8A7794:

> 

> Given all R-Car Gen2 variants are treated the same...

> 

> >                 priv->pfunc = usbhs_rcar2_ops;

> >                 if (!priv->dparam.pipe_type) {

> >                         priv->dparam.pipe_type = usbhsc_new_pipe_type;

> > diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h

> > index e438e72..08c62ba 100644

> > --- a/include/linux/usb/renesas_usbhs.h

> > +++ b/include/linux/usb/renesas_usbhs.h

> > @@ -172,6 +172,7 @@ struct renesas_usbhs_driver_param {

> >  enum {

> >         USBHS_TYPE_R8A7790 = 1,

> >         USBHS_TYPE_R8A7791,

> > +       USBHS_TYPE_R8A7794,

> 

> ... perhaps it would be better to just have a single USBHS_TYPE_RCAR_GEN2,

> so you don't have to add more enums and case statements?


Thank you for the suggestion. I agree with you.
So, I will fix this patch set [1/2] to just have a USBHS_TYPE_RCAR_GEN2
and modify this patch.

Best regards,
Yoshihiro Shimoda

> 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
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
index ddbe304..64a4ca6 100644
--- a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
+++ b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
@@ -4,6 +4,7 @@  Required properties:
   - compatible: Must contain one of the following:
 	- "renesas,usbhs-r8a7790"
 	- "renesas,usbhs-r8a7791"
+	- "renesas,usbhs-r8a7794"
   - reg: Base address and length of the register for the USBHS
   - interrupts: Interrupt specifier for the USBHS
   - clocks: A list of phandle + clock specifier pairs
diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c
index 0f7e850..954357f 100644
--- a/drivers/usb/renesas_usbhs/common.c
+++ b/drivers/usb/renesas_usbhs/common.c
@@ -472,6 +472,10 @@  static const struct of_device_id usbhs_of_match[] = {
 		.compatible = "renesas,usbhs-r8a7791",
 		.data = (void *)USBHS_TYPE_R8A7791,
 	},
+	{
+		.compatible = "renesas,usbhs-r8a7794",
+		.data = (void *)USBHS_TYPE_R8A7794,
+	},
 	{ },
 };
 MODULE_DEVICE_TABLE(of, usbhs_of_match);
@@ -500,6 +504,7 @@  static struct renesas_usbhs_platform_info *usbhs_parse_dt(struct device *dev)
 	switch (dparam->type) {
 	case USBHS_TYPE_R8A7790:
 	case USBHS_TYPE_R8A7791:
+	case USBHS_TYPE_R8A7794:
 		dparam->has_usb_dmac = 1;
 		break;
 	default:
@@ -561,6 +566,7 @@  static int usbhs_probe(struct platform_device *pdev)
 	switch (priv->dparam.type) {
 	case USBHS_TYPE_R8A7790:
 	case USBHS_TYPE_R8A7791:
+	case USBHS_TYPE_R8A7794:
 		priv->pfunc = usbhs_rcar2_ops;
 		if (!priv->dparam.pipe_type) {
 			priv->dparam.pipe_type = usbhsc_new_pipe_type;
diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h
index e438e72..08c62ba 100644
--- a/include/linux/usb/renesas_usbhs.h
+++ b/include/linux/usb/renesas_usbhs.h
@@ -172,6 +172,7 @@  struct renesas_usbhs_driver_param {
 enum {
 	USBHS_TYPE_R8A7790 = 1,
 	USBHS_TYPE_R8A7791,
+	USBHS_TYPE_R8A7794,
 };
 
 /*