[v6,03/13] usb: dwc3: dwc3-of-simple: Add support for dwc3 of Hisilicon Soc Platform
diff mbox series

Message ID 20190420064019.57522-4-chenyu56@huawei.com
State New, archived
Headers show
Series
  • Add support for usb on Hikey960
Related show

Commit Message

Chen Yu April 20, 2019, 6:40 a.m. UTC
This patch adds support for the poweron and shutdown of dwc3 core
on Hisilicon Soc Platform.

Cc: Felipe Balbi <balbi@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: John Stultz <john.stultz@linaro.org>
Signed-off-by: Yu Chen <chenyu56@huawei.com>
---
 drivers/usb/dwc3/dwc3-of-simple.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Rob Herring April 25, 2019, 9:36 p.m. UTC | #1
On Sat, Apr 20, 2019 at 02:40:09PM +0800, Yu Chen wrote:
> This patch adds support for the poweron and shutdown of dwc3 core
> on Hisilicon Soc Platform.
> 
> Cc: Felipe Balbi <balbi@kernel.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: John Stultz <john.stultz@linaro.org>
> Signed-off-by: Yu Chen <chenyu56@huawei.com>
> ---
>  drivers/usb/dwc3/dwc3-of-simple.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/dwc3/dwc3-of-simple.c b/drivers/usb/dwc3/dwc3-of-simple.c
> index 4c2771c5e727..0ed09d876542 100644
> --- a/drivers/usb/dwc3/dwc3-of-simple.c
> +++ b/drivers/usb/dwc3/dwc3-of-simple.c
> @@ -98,7 +98,8 @@ static int dwc3_of_simple_probe(struct platform_device *pdev)
>  	 * Some controllers need to toggle the usb3-otg reset before trying to
>  	 * initialize the PHY, otherwise the PHY times out.
>  	 */
> -	if (of_device_is_compatible(np, "rockchip,rk3399-dwc3"))
> +	if (of_device_is_compatible(np, "rockchip,rk3399-dwc3") ||
> +			of_device_is_compatible(np, "hisilicon,hi3660-dwc3"))
>  		simple->need_reset = true;

Fine, I guess, but really this flag should be moved to the match table 
so we aren't doing compatible matching twice.

>  
>  	if (of_device_is_compatible(np, "amlogic,meson-axg-dwc3") ||
> @@ -243,6 +244,7 @@ static const struct of_device_id of_dwc3_simple_match[] = {
>  	{ .compatible = "amlogic,meson-axg-dwc3" },
>  	{ .compatible = "amlogic,meson-gxl-dwc3" },
>  	{ .compatible = "allwinner,sun50i-h6-dwc3" },
> +	{ .compatible = "hisilicon,hi3660-dwc3" },
>  	{ /* Sentinel */ }
>  };
>  MODULE_DEVICE_TABLE(of, of_dwc3_simple_match);
> -- 
> 2.15.0-rc2
>

Patch
diff mbox series

diff --git a/drivers/usb/dwc3/dwc3-of-simple.c b/drivers/usb/dwc3/dwc3-of-simple.c
index 4c2771c5e727..0ed09d876542 100644
--- a/drivers/usb/dwc3/dwc3-of-simple.c
+++ b/drivers/usb/dwc3/dwc3-of-simple.c
@@ -98,7 +98,8 @@  static int dwc3_of_simple_probe(struct platform_device *pdev)
 	 * Some controllers need to toggle the usb3-otg reset before trying to
 	 * initialize the PHY, otherwise the PHY times out.
 	 */
-	if (of_device_is_compatible(np, "rockchip,rk3399-dwc3"))
+	if (of_device_is_compatible(np, "rockchip,rk3399-dwc3") ||
+			of_device_is_compatible(np, "hisilicon,hi3660-dwc3"))
 		simple->need_reset = true;
 
 	if (of_device_is_compatible(np, "amlogic,meson-axg-dwc3") ||
@@ -243,6 +244,7 @@  static const struct of_device_id of_dwc3_simple_match[] = {
 	{ .compatible = "amlogic,meson-axg-dwc3" },
 	{ .compatible = "amlogic,meson-gxl-dwc3" },
 	{ .compatible = "allwinner,sun50i-h6-dwc3" },
+	{ .compatible = "hisilicon,hi3660-dwc3" },
 	{ /* Sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, of_dwc3_simple_match);