[PATCH v3 3/8] usb: chipidea: usb2: add optional reset support
Junzhong Pan
panjunzhong at linux.spacemit.com
Sun Sep 27 04:40:05 PDT 2026
The USB2 controller of SpacemiT K1 SoC requires reset support, to keep
compatibility, add optional reset support.
Tested-by: Ze Huang <huang.ze at linux.dev>
Reviewed-by: Troy Mitchell <troy.mitchell at linux.spacemit.com>
Acked-by: Peter Chen <peter.chen at kernel.org>
Signed-off-by: Junzhong Pan <panjunzhong at linux.spacemit.com>
---
drivers/usb/chipidea/ci_hdrc_usb2.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/usb/chipidea/ci_hdrc_usb2.c b/drivers/usb/chipidea/ci_hdrc_usb2.c
index 9cef902f36b3..85244e8bbc3f 100644
--- a/drivers/usb/chipidea/ci_hdrc_usb2.c
+++ b/drivers/usb/chipidea/ci_hdrc_usb2.c
@@ -12,6 +12,7 @@
#include <linux/phy/phy.h>
#include <linux/platform_device.h>
#include <linux/property.h>
+#include <linux/reset.h>
#include <linux/usb/chipidea.h>
#include <linux/usb/hcd.h>
#include <linux/usb/ulpi.h>
@@ -52,6 +53,7 @@ static int ci_hdrc_usb2_probe(struct platform_device *pdev)
struct ci_hdrc_platform_data *ci_pdata = dev_get_platdata(dev);
const struct ci_hdrc_platform_data *data;
struct clk *clk;
+ struct reset_control *reset;
int ret;
if (!ci_pdata) {
@@ -75,6 +77,11 @@ static int ci_hdrc_usb2_probe(struct platform_device *pdev)
return dev_err_probe(dev, PTR_ERR(clk),
"failed to get or enable the clock\n");
+ reset = devm_reset_control_get_optional_exclusive_deasserted(dev, NULL);
+ if (IS_ERR(reset))
+ return dev_err_probe(dev, PTR_ERR(reset),
+ "failed to get or deassert the reset control\n");
+
ci_pdata->name = dev_name(dev);
priv->ci_pdev = ci_hdrc_add_device(dev, pdev->resource,
--
2.34.1
More information about the linux-riscv
mailing list