usb: dwc2: Add reset control to dwc2
Subsystems (2)
PATCH RESEND 1/1 usb: dwc2: Add reset control to dwc2
From: Dinh Nguyen <[email protected]>
Allow for platforms that have a reset controller driver in place to bring the USB IP out of reset.
---
v7: Use devm_reset_control_get_optional()
v6: fix 80 line checkpatch warning in dev_err print
v5: updated error conditions for not finding the reset property
v4: use dev_dbg() if not a -EPROBE_DEFER
v3: fix compile error
v2: move to lowlevel_hw_init()
--- drivers/usb/dwc2/core.h | 1 + drivers/usb/dwc2/platform.c | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+)
drivers/usb/dwc2/core.h +1 -0
@@ -837,6 +837,7 @@ struct dwc2_hsotg {void *priv;int irq;struct clk *clk; +struct reset_control *reset; unsigned int queuing_high_bandwidth:1; unsigned int srp_success:1;
drivers/usb/dwc2/platform.c +22 -0
@@ -45,6 +45,7 @@#include <linux/platform_device.h> #include <linux/phy/phy.h> #include <linux/platform_data/s3c-hsotg.h> +#include <linux/reset.h> #include <linux/usb/of.h>
@@ -337,6 +338,24 @@ static int dwc2_lowlevel_hw_init(struct dwc2_hsotg *hsotg) {int i, ret; + hsotg->reset =devm_reset_control_get_optional (hsotg->dev,"dwc2" ); +if (IS_ERR (hsotg->reset)) { + ret =PTR_ERR (hsotg->reset); +switch (ret) { +case -ENOENT : +case -ENOTSUPP : + hsotg->reset =NULL ; +break ; +default : +dev_err (hsotg->dev,"error getting reset control %d\n" , + ret); +return ret; + } + } + +if (hsotg->reset) +reset_control_deassert (hsotg->reset); +/* Set default UTMI width */ hsotg->phyif =GUSBCFG_PHYIF16 ;
@@ -434,6 +453,9 @@ static int dwc2_driver_remove(struct platform_device *dev)if (hsotg->ll_hw_enabled)dwc2_lowlevel_hw_disable (hsotg); +if (hsotg->reset) +reset_control_assert (hsotg->reset); +return 0 ; }
Signature · 1 line
1.7.9.5
Hi Dinh,
Am Dienstag, den 21.06.2016, 14:12 -0500 schrieb
[email protected]:
Quoted 9 lines
From: Dinh Nguyen <[email protected]>
Allow for platforms that have a reset controller driver in place to bring the USB IP out of reset.
Signed-off-by Dinh Nguyen <[email protected]>Acked-by John Youn <[email protected]>Tested-by Stefan Wahren <[email protected]>Acked-by Felipe Balbi <[email protected]>
This is an USB patch. Doesn't John collect patches and send pull requests? Then you should put Greg Kroah-Hartman and [email protected] into Cc:. Things get easily lost on linux-kernel.
regards
Philipp
Quoted 71 lines
---
v7: Usedevm_reset_control_get_optional()
v6: fix 80 line checkpatch warning indev_errprint
v5: updated error conditions for not finding the reset property
v4: usedev_dbg()if not a -EPROBE_DEFER
v3: fix compile error
v2: move tolowlevel_hw_init()--- drivers/usb/dwc2/core.h | 1 + drivers/usb/dwc2/platform.c | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+)drivers/usb/dwc2/core.h +1
-0@@ -837,6 +837,7 @@ struct dwc2_hsotg {void *priv;int irq;struct clk *clk; +struct reset_control *reset; unsigned int queuing_high_bandwidth:1; unsigned int srp_success:1;drivers/usb/dwc2/platform.c +22
-0@@ -45,6 +45,7 @@#include <linux/platform_device.h> #include <linux/phy/phy.h> #include <linux/platform_data/s3c-hsotg.h> +#include <linux/reset.h> #include <linux/usb/of.h> @@ -337,6 +338,24 @@ static int dwc2_lowlevel_hw_init(struct dwc2_hsotg *hsotg) {int i, ret; + hsotg->reset =devm_reset_control_get_optional (hsotg->dev,"dwc2" ); +if (IS_ERR (hsotg->reset)) { + ret =PTR_ERR (hsotg->reset); +switch (ret) { +case -ENOENT : +case -ENOTSUPP : + hsotg->reset =NULL ; +break ; +default : +dev_err (hsotg->dev,"error getting reset control %d\n" , + ret); +return ret; + } + } + +if (hsotg->reset) +reset_control_deassert (hsotg->reset); +/* Set default UTMI width */ hsotg->phyif =GUSBCFG_PHYIF16 ;@@ -434,6 +453,9 @@ static int dwc2_driver_remove(struct platform_device *dev)if (hsotg->ll_hw_enabled)dwc2_lowlevel_hw_disable (hsotg); +if (hsotg->reset) +reset_control_assert (hsotg->reset); +return 0 ; }
Ping?
Dinh
Quoted 81 lines · On 06/21/2016 02:12 PM, [email protected] wrote:
From: Dinh Nguyen <[email protected]>
Allow for platforms that have a reset controller driver in place to bring the USB IP out of reset.
Signed-off-by Dinh Nguyen <[email protected]>Acked-by John Youn <[email protected]>Tested-by Stefan Wahren <[email protected]>Acked-by Felipe Balbi <[email protected]>---
v7: Usedevm_reset_control_get_optional()
v6: fix 80 line checkpatch warning indev_errprint
v5: updated error conditions for not finding the reset property
v4: usedev_dbg()if not a -EPROBE_DEFER
v3: fix compile error
v2: move tolowlevel_hw_init()--- drivers/usb/dwc2/core.h | 1 + drivers/usb/dwc2/platform.c | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+)drivers/usb/dwc2/core.h +1
-0@@ -837,6 +837,7 @@ struct dwc2_hsotg {void *priv;int irq;struct clk *clk; +struct reset_control *reset; unsigned int queuing_high_bandwidth:1; unsigned int srp_success:1;drivers/usb/dwc2/platform.c +22
-0@@ -45,6 +45,7 @@#include <linux/platform_device.h> #include <linux/phy/phy.h> #include <linux/platform_data/s3c-hsotg.h> +#include <linux/reset.h> #include <linux/usb/of.h> @@ -337,6 +338,24 @@ static int dwc2_lowlevel_hw_init(struct dwc2_hsotg *hsotg) {int i, ret; + hsotg->reset =devm_reset_control_get_optional (hsotg->dev,"dwc2" ); +if (IS_ERR (hsotg->reset)) { + ret =PTR_ERR (hsotg->reset); +switch (ret) { +case -ENOENT : +case -ENOTSUPP : + hsotg->reset =NULL ; +break ; +default : +dev_err (hsotg->dev,"error getting reset control %d\n" , + ret); +return ret; + } + } + +if (hsotg->reset) +reset_control_deassert (hsotg->reset); +/* Set default UTMI width */ hsotg->phyif =GUSBCFG_PHYIF16 ;@@ -434,6 +453,9 @@ static int dwc2_driver_remove(struct platform_device *dev)if (hsotg->ll_hw_enabled)dwc2_lowlevel_hw_disable (hsotg); +if (hsotg->reset) +reset_control_assert (hsotg->reset); +return 0 ; }
Quoted 14 lines · Philipp Zabel
Hi Dinh,
Am Dienstag, den 21.06.2016, 14:12 -0500 schrieb
[email protected]:Quoted 9 lines
From: Dinh Nguyen <[email protected]>
Allow for platforms that have a reset controller driver in place to bring the USB IP out of reset.
Signed-off-by Dinh Nguyen <[email protected]>Acked-by John Youn <[email protected]>Tested-by Stefan Wahren <[email protected]>Acked-by Felipe Balbi <[email protected]>
Quoted 7 lines
Acked-by Philipp Zabel <[email protected]>This is an USB patch. Doesn't John collect patches and send pull requests? Then you should put Greg Kroah-Hartman and [email protected] into Cc:. Things get easily lost on linux-kernel.
Hi Philipp,
Could you take this patch for 4.8 on your reset-next?
Without the following fix from your tree, Dinh's patch will break several platforms.
http://marc.info/?l=linux-usb&m=146473891018262&w=2
If it's too late we can probably have it go through Felipe's tree during -rc.
Regards,
John
Am Mittwoch, den 06.07.2016, 10:48 -0700 schrieb John Youn:
Quoted 23 lines · Philipp Zabel
Quoted 14 lines
Hi Dinh,
Am Dienstag, den 21.06.2016, 14:12 -0500 schrieb
[email protected]:Quoted 9 lines
From: Dinh Nguyen <[email protected]>
Allow for platforms that have a reset controller driver in place to bring the USB IP out of reset.
Signed-off-by Dinh Nguyen <[email protected]>Acked-by John Youn <[email protected]>Tested-by Stefan Wahren <[email protected]>Acked-by Felipe Balbi <[email protected]>Quoted 7 lines
Acked-by Philipp Zabel <[email protected]>This is an USB patch. Doesn't John collect patches and send pull requests? Then you should put Greg Kroah-Hartman and [email protected] into Cc:. Things get easily lost on linux-kernel.
Quoted 8 lines
Hi Philipp,
Could you take this patch for 4.8 on your reset-next?
Without the following fix from your tree, Dinh's patch will break several platforms.
My apologies, I have completely missed your mail from 21.06.
Quoted 2 lines
If it's too late we can probably have it go through Felipe's tree during -rc.
Yes, I got two pull requests merged this round, but the last one probably was already too late. I'd prefer this patch to go the USB route.
regards
Philipp
Quoted 33 lines · Philipp Zabel
Am Mittwoch, den 06.07.2016, 10:48 -0700 schrieb John Youn:
Quoted 23 lines · Philipp Zabel
Quoted 14 lines
Hi Dinh,
Am Dienstag, den 21.06.2016, 14:12 -0500 schrieb
[email protected]:Quoted 9 lines
From: Dinh Nguyen <[email protected]>
Allow for platforms that have a reset controller driver in place to bring the USB IP out of reset.
Signed-off-by Dinh Nguyen <[email protected]>Acked-by John Youn <[email protected]>Tested-by Stefan Wahren <[email protected]>Acked-by Felipe Balbi <[email protected]>Quoted 7 lines
Acked-by Philipp Zabel <[email protected]>This is an USB patch. Doesn't John collect patches and send pull requests? Then you should put Greg Kroah-Hartman and [email protected] into Cc:. Things get easily lost on linux-kernel.
Quoted 8 lines
Hi Philipp,
Could you take this patch for 4.8 on your reset-next?
Without the following fix from your tree, Dinh's patch will break several platforms.
Quoted 9 lines
My apologies, I have completely missed your mail from 21.06.
Quoted 2 lines
If it's too late we can probably have it go through Felipe's tree during -rc.
Yes, I got two pull requests merged this round, but the last one probably was already too late. I'd prefer this patch to go the USB route.
Sure we'll do that.
Thanks,
John