* [PATCH] usb: dwc2: add optional usb ecc reset bit
@ 2017-11-01 15:34 Dinh Nguyen
2017-11-27 15:27 ` Dinh Nguyen
2017-12-06 6:58 ` John Youn
0 siblings, 2 replies; 3+ messages in thread
From: Dinh Nguyen @ 2017-11-01 15:34 UTC (permalink / raw)
To: johnyoun; +Cc: dinguyen, felipe.balbi, linux-usb, linux-kernel
The dwc2 USB controller in Stratix10 has an additional ECC reset bit that
needs to get de-asserted in order for the controller to work properly.
Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
---
drivers/usb/dwc2/core.h | 1 +
drivers/usb/dwc2/platform.c | 10 ++++++++++
2 files changed, 11 insertions(+)
diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h
index 8367d4f9..a4b5f4e 100644
--- a/drivers/usb/dwc2/core.h
+++ b/drivers/usb/dwc2/core.h
@@ -920,6 +920,7 @@ struct dwc2_hsotg {
int irq;
struct clk *clk;
struct reset_control *reset;
+ struct reset_control *reset_ecc;
unsigned int queuing_high_bandwidth:1;
unsigned int srp_success:1;
diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
index daf0d37..d466e03 100644
--- a/drivers/usb/dwc2/platform.c
+++ b/drivers/usb/dwc2/platform.c
@@ -220,6 +220,15 @@ static int dwc2_lowlevel_hw_init(struct dwc2_hsotg *hsotg)
reset_control_deassert(hsotg->reset);
+ hsotg->reset_ecc = devm_reset_control_get_optional(hsotg->dev, "dwc2-ecc");
+ if (IS_ERR(hsotg->reset_ecc)) {
+ ret = PTR_ERR(hsotg->reset_ecc);
+ dev_err(hsotg->dev, "error getting reset control for ecc %d\n", ret);
+ return ret;
+ }
+
+ reset_control_deassert(hsotg->reset_ecc);
+
/* Set default UTMI width */
hsotg->phyif = GUSBCFG_PHYIF16;
@@ -318,6 +327,7 @@ static int dwc2_driver_remove(struct platform_device *dev)
dwc2_lowlevel_hw_disable(hsotg);
reset_control_assert(hsotg->reset);
+ reset_control_assert(hsotg->reset_ecc);
return 0;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] usb: dwc2: add optional usb ecc reset bit
2017-11-01 15:34 [PATCH] usb: dwc2: add optional usb ecc reset bit Dinh Nguyen
@ 2017-11-27 15:27 ` Dinh Nguyen
2017-12-06 6:58 ` John Youn
1 sibling, 0 replies; 3+ messages in thread
From: Dinh Nguyen @ 2017-11-27 15:27 UTC (permalink / raw)
To: johnyoun; +Cc: felipe.balbi, linux-usb, linux-kernel
Hi John,
was wondering if you have gotten a chance to review this?
Thank,
Dinh
On 11/01/2017 10:34 AM, Dinh Nguyen wrote:
> The dwc2 USB controller in Stratix10 has an additional ECC reset bit that
> needs to get de-asserted in order for the controller to work properly.
>
> Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
> ---
> drivers/usb/dwc2/core.h | 1 +
> drivers/usb/dwc2/platform.c | 10 ++++++++++
> 2 files changed, 11 insertions(+)
>
> diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h
> index 8367d4f9..a4b5f4e 100644
> --- a/drivers/usb/dwc2/core.h
> +++ b/drivers/usb/dwc2/core.h
> @@ -920,6 +920,7 @@ struct dwc2_hsotg {
> int irq;
> struct clk *clk;
> struct reset_control *reset;
> + struct reset_control *reset_ecc;
>
> unsigned int queuing_high_bandwidth:1;
> unsigned int srp_success:1;
> diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
> index daf0d37..d466e03 100644
> --- a/drivers/usb/dwc2/platform.c
> +++ b/drivers/usb/dwc2/platform.c
> @@ -220,6 +220,15 @@ static int dwc2_lowlevel_hw_init(struct dwc2_hsotg *hsotg)
>
> reset_control_deassert(hsotg->reset);
>
> + hsotg->reset_ecc = devm_reset_control_get_optional(hsotg->dev, "dwc2-ecc");
> + if (IS_ERR(hsotg->reset_ecc)) {
> + ret = PTR_ERR(hsotg->reset_ecc);
> + dev_err(hsotg->dev, "error getting reset control for ecc %d\n", ret);
> + return ret;
> + }
> +
> + reset_control_deassert(hsotg->reset_ecc);
> +
> /* Set default UTMI width */
> hsotg->phyif = GUSBCFG_PHYIF16;
>
> @@ -318,6 +327,7 @@ static int dwc2_driver_remove(struct platform_device *dev)
> dwc2_lowlevel_hw_disable(hsotg);
>
> reset_control_assert(hsotg->reset);
> + reset_control_assert(hsotg->reset_ecc);
>
> return 0;
> }
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] usb: dwc2: add optional usb ecc reset bit
2017-11-01 15:34 [PATCH] usb: dwc2: add optional usb ecc reset bit Dinh Nguyen
2017-11-27 15:27 ` Dinh Nguyen
@ 2017-12-06 6:58 ` John Youn
1 sibling, 0 replies; 3+ messages in thread
From: John Youn @ 2017-12-06 6:58 UTC (permalink / raw)
To: Dinh Nguyen, John.Youn@synopsys.com
Cc: felipe.balbi@linux.intel.com, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org
On 11/01/2017 08:35 AM, Dinh Nguyen wrote:
> The dwc2 USB controller in Stratix10 has an additional ECC reset bit that
> needs to get de-asserted in order for the controller to work properly.
>
> Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
> ---
> drivers/usb/dwc2/core.h | 1 +
> drivers/usb/dwc2/platform.c | 10 ++++++++++
> 2 files changed, 11 insertions(+)
>
> diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h
> index 8367d4f9..a4b5f4e 100644
> --- a/drivers/usb/dwc2/core.h
> +++ b/drivers/usb/dwc2/core.h
> @@ -920,6 +920,7 @@ struct dwc2_hsotg {
> int irq;
> struct clk *clk;
> struct reset_control *reset;
> + struct reset_control *reset_ecc;
>
> unsigned int queuing_high_bandwidth:1;
> unsigned int srp_success:1;
> diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
> index daf0d37..d466e03 100644
> --- a/drivers/usb/dwc2/platform.c
> +++ b/drivers/usb/dwc2/platform.c
> @@ -220,6 +220,15 @@ static int dwc2_lowlevel_hw_init(struct dwc2_hsotg *hsotg)
>
> reset_control_deassert(hsotg->reset);
>
> + hsotg->reset_ecc = devm_reset_control_get_optional(hsotg->dev, "dwc2-ecc");
> + if (IS_ERR(hsotg->reset_ecc)) {
> + ret = PTR_ERR(hsotg->reset_ecc);
> + dev_err(hsotg->dev, "error getting reset control for ecc %d\n", ret);
> + return ret;
> + }
> +
> + reset_control_deassert(hsotg->reset_ecc);
> +
> /* Set default UTMI width */
> hsotg->phyif = GUSBCFG_PHYIF16;
>
> @@ -318,6 +327,7 @@ static int dwc2_driver_remove(struct platform_device *dev)
> dwc2_lowlevel_hw_disable(hsotg);
>
> reset_control_assert(hsotg->reset);
> + reset_control_assert(hsotg->reset_ecc);
>
> return 0;
> }
>
Acked-by: John Youn <johnyoun@synopsys.com>
John
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-12-06 6:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-01 15:34 [PATCH] usb: dwc2: add optional usb ecc reset bit Dinh Nguyen
2017-11-27 15:27 ` Dinh Nguyen
2017-12-06 6:58 ` John Youn
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).