diff mbox

[3/3] usb: gadget: udc: renesas_usb3: add support for R-Car M3-W

Message ID 1501244219-11840-4-git-send-email-yoshihiro.shimoda.uh@renesas.com (mailing list archive)
State Superseded
Delegated to: Geert Uytterhoeven
Headers show

Commit Message

Yoshihiro Shimoda July 28, 2017, 12:16 p.m. UTC
This patch adds support for R-Car M3-W. This patch also adds R-Car
Gen3 generic version's compatible.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
---
 Documentation/devicetree/bindings/usb/renesas_usb3.txt | 16 +++++++++++++---
 drivers/usb/gadget/udc/renesas_usb3.c                  |  8 ++++++++
 2 files changed, 21 insertions(+), 3 deletions(-)

Comments

Rob Herring (Arm) Aug. 3, 2017, 10:28 p.m. UTC | #1
On Fri, Jul 28, 2017 at 09:16:59PM +0900, Yoshihiro Shimoda wrote:
> This patch adds support for R-Car M3-W. This patch also adds R-Car
> Gen3 generic version's compatible.
> 
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> ---
>  Documentation/devicetree/bindings/usb/renesas_usb3.txt | 16 +++++++++++++---
>  drivers/usb/gadget/udc/renesas_usb3.c                  |  8 ++++++++
>  2 files changed, 21 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/usb/renesas_usb3.txt b/Documentation/devicetree/bindings/usb/renesas_usb3.txt
> index 8d52766..e280258 100644
> --- a/Documentation/devicetree/bindings/usb/renesas_usb3.txt
> +++ b/Documentation/devicetree/bindings/usb/renesas_usb3.txt
> @@ -3,20 +3,30 @@ Renesas Electronics USB3.0 Peripheral driver
>  Required properties:
>    - compatible: Must contain one of the following:
>  	- "renesas,r8a7795-usb3-peri"
> +	- "renesas,r8a7796-usb3-peri"
> +	- "renesas,rcar-gen3-usb3-peri" for a generic R-Car Gen3 compatible
> +	  device
> +
> +    When compatible with the generic version, nodes must list the
> +    SoC-specific version corresponding to the platform first
> +    followed by the generic version.
> +
>    - reg: Base address and length of the register for the USB3.0 Peripheral
>    - interrupts: Interrupt specifier for the USB3.0 Peripheral
>    - clocks: clock phandle and specifier pair
>  
> -Example:
> +Example of R-Car H3 ES1.x:
>  	usb3_peri0: usb@ee020000 {
> -		compatible = "renesas,r8a7795-usb3-peri";
> +		compatible = "renesas,r8a7795-usb3-peri",
> +			     "renesas,rcar-gen3-usb3-peri";
>  		reg = <0 0xee020000 0 0x400>;
>  		interrupts = <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>;
>  		clocks = <&cpg CPG_MOD 328>;
>  	};
>  
>  	usb3_peri1: usb@ee060000 {
> -		compatible = "renesas,r8a7795-usb3-peri";
> +		compatible = "renesas,r8a7795-usb3-peri",
> +			     "renesas,rcar-gen3-usb3-peri";
>  		reg = <0 0xee060000 0 0x400>;
>  		interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>;
>  		clocks = <&cpg CPG_MOD 327>;
> diff --git a/drivers/usb/gadget/udc/renesas_usb3.c b/drivers/usb/gadget/udc/renesas_usb3.c
> index aa2b185..45410f3 100644
> --- a/drivers/usb/gadget/udc/renesas_usb3.c
> +++ b/drivers/usb/gadget/udc/renesas_usb3.c
> @@ -2506,6 +2506,14 @@ static void renesas_usb3_init_ram(struct renesas_usb3 *usb3, struct device *dev,
>  		.compatible = "renesas,r8a7795-usb3-peri",
>  		.data = &renesas_usb3_priv_gen3,
>  	},
> +	{
> +		.compatible = "renesas,r8a7796-usb3-peri",
> +		.data = &renesas_usb3_priv_gen3,
> +	},
> +	{
> +		.compatible = "renesas,rcar-gen3-usb3-peri",
> +		.data = &renesas_usb3_priv_gen3,

What's the point of a common fallback if you list all the compatibles in 
the driver?

> +	},
>  	{ },
>  };
>  MODULE_DEVICE_TABLE(of, usb3_of_match);
> -- 
> 1.9.1
>
Yoshihiro Shimoda Aug. 4, 2017, 1:11 a.m. UTC | #2
Hi Rob,

> -----Original Message-----
> From: Rob Herring
> Sent: Friday, August 4, 2017 7:28 AM
> 
> On Fri, Jul 28, 2017 at 09:16:59PM +0900, Yoshihiro Shimoda wrote:
> > This patch adds support for R-Car M3-W. This patch also adds R-Car
> > Gen3 generic version's compatible.
> >
> > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> > ---
> >  Documentation/devicetree/bindings/usb/renesas_usb3.txt | 16 +++++++++++++---
> >  drivers/usb/gadget/udc/renesas_usb3.c                  |  8 ++++++++
> >  2 files changed, 21 insertions(+), 3 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/usb/renesas_usb3.txt
> b/Documentation/devicetree/bindings/usb/renesas_usb3.txt
> > index 8d52766..e280258 100644
> > --- a/Documentation/devicetree/bindings/usb/renesas_usb3.txt
> > +++ b/Documentation/devicetree/bindings/usb/renesas_usb3.txt
> > @@ -3,20 +3,30 @@ Renesas Electronics USB3.0 Peripheral driver
> >  Required properties:
> >    - compatible: Must contain one of the following:
> >  	- "renesas,r8a7795-usb3-peri"
> > +	- "renesas,r8a7796-usb3-peri"
> > +	- "renesas,rcar-gen3-usb3-peri" for a generic R-Car Gen3 compatible
> > +	  device
> > +
> > +    When compatible with the generic version, nodes must list the
> > +    SoC-specific version corresponding to the platform first
> > +    followed by the generic version.
> > +
> >    - reg: Base address and length of the register for the USB3.0 Peripheral
> >    - interrupts: Interrupt specifier for the USB3.0 Peripheral
> >    - clocks: clock phandle and specifier pair
> >
> > -Example:
> > +Example of R-Car H3 ES1.x:
> >  	usb3_peri0: usb@ee020000 {
> > -		compatible = "renesas,r8a7795-usb3-peri";
> > +		compatible = "renesas,r8a7795-usb3-peri",
> > +			     "renesas,rcar-gen3-usb3-peri";
> >  		reg = <0 0xee020000 0 0x400>;
> >  		interrupts = <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>;
> >  		clocks = <&cpg CPG_MOD 328>;
> >  	};
> >
> >  	usb3_peri1: usb@ee060000 {
> > -		compatible = "renesas,r8a7795-usb3-peri";
> > +		compatible = "renesas,r8a7795-usb3-peri",
> > +			     "renesas,rcar-gen3-usb3-peri";
> >  		reg = <0 0xee060000 0 0x400>;
> >  		interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>;
> >  		clocks = <&cpg CPG_MOD 327>;
> > diff --git a/drivers/usb/gadget/udc/renesas_usb3.c b/drivers/usb/gadget/udc/renesas_usb3.c
> > index aa2b185..45410f3 100644
> > --- a/drivers/usb/gadget/udc/renesas_usb3.c
> > +++ b/drivers/usb/gadget/udc/renesas_usb3.c
> > @@ -2506,6 +2506,14 @@ static void renesas_usb3_init_ram(struct renesas_usb3 *usb3, struct device *dev,
> >  		.compatible = "renesas,r8a7795-usb3-peri",
> >  		.data = &renesas_usb3_priv_gen3,
> >  	},
> > +	{
> > +		.compatible = "renesas,r8a7796-usb3-peri",
> > +		.data = &renesas_usb3_priv_gen3,
> > +	},
> > +	{
> > +		.compatible = "renesas,rcar-gen3-usb3-peri",
> > +		.data = &renesas_usb3_priv_gen3,
> 
> What's the point of a common fallback if you list all the compatibles in
> the driver?

Thank you for the comment!
The renesas,r8a779[56]-usb3-peri don't need anymore.
So, I will fix this patch.

Best regards,
Yoshihiro Shimoda

> > +	},
> >  	{ },
> >  };
> >  MODULE_DEVICE_TABLE(of, usb3_of_match);
> > --
> > 1.9.1
> >
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/usb/renesas_usb3.txt b/Documentation/devicetree/bindings/usb/renesas_usb3.txt
index 8d52766..e280258 100644
--- a/Documentation/devicetree/bindings/usb/renesas_usb3.txt
+++ b/Documentation/devicetree/bindings/usb/renesas_usb3.txt
@@ -3,20 +3,30 @@  Renesas Electronics USB3.0 Peripheral driver
 Required properties:
   - compatible: Must contain one of the following:
 	- "renesas,r8a7795-usb3-peri"
+	- "renesas,r8a7796-usb3-peri"
+	- "renesas,rcar-gen3-usb3-peri" for a generic R-Car Gen3 compatible
+	  device
+
+    When compatible with the generic version, nodes must list the
+    SoC-specific version corresponding to the platform first
+    followed by the generic version.
+
   - reg: Base address and length of the register for the USB3.0 Peripheral
   - interrupts: Interrupt specifier for the USB3.0 Peripheral
   - clocks: clock phandle and specifier pair
 
-Example:
+Example of R-Car H3 ES1.x:
 	usb3_peri0: usb@ee020000 {
-		compatible = "renesas,r8a7795-usb3-peri";
+		compatible = "renesas,r8a7795-usb3-peri",
+			     "renesas,rcar-gen3-usb3-peri";
 		reg = <0 0xee020000 0 0x400>;
 		interrupts = <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&cpg CPG_MOD 328>;
 	};
 
 	usb3_peri1: usb@ee060000 {
-		compatible = "renesas,r8a7795-usb3-peri";
+		compatible = "renesas,r8a7795-usb3-peri",
+			     "renesas,rcar-gen3-usb3-peri";
 		reg = <0 0xee060000 0 0x400>;
 		interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&cpg CPG_MOD 327>;
diff --git a/drivers/usb/gadget/udc/renesas_usb3.c b/drivers/usb/gadget/udc/renesas_usb3.c
index aa2b185..45410f3 100644
--- a/drivers/usb/gadget/udc/renesas_usb3.c
+++ b/drivers/usb/gadget/udc/renesas_usb3.c
@@ -2506,6 +2506,14 @@  static void renesas_usb3_init_ram(struct renesas_usb3 *usb3, struct device *dev,
 		.compatible = "renesas,r8a7795-usb3-peri",
 		.data = &renesas_usb3_priv_gen3,
 	},
+	{
+		.compatible = "renesas,r8a7796-usb3-peri",
+		.data = &renesas_usb3_priv_gen3,
+	},
+	{
+		.compatible = "renesas,rcar-gen3-usb3-peri",
+		.data = &renesas_usb3_priv_gen3,
+	},
 	{ },
 };
 MODULE_DEVICE_TABLE(of, usb3_of_match);