Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usb: dwc3: xilinx: add reset-controller support

Add a reset-controller for supporting Xilinx versal platforms. To reset
the USB controller, get the reset ID from device-tree and using ID trigger
the reset, with the assert and deassert reset controller APIs for USB
controller initialization.

Signed-off-by: Piyush Mehta <piyush.mehta@amd.com>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/20231013125847.20334-1-piyush.mehta@amd.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Piyush Mehta and committed by
Greg Kroah-Hartman
de7ecc4e 46b6fc53

+7 -7
+7 -7
drivers/usb/dwc3/dwc3-xilinx.c
··· 32 32 #define XLNX_USB_TRAFFIC_ROUTE_CONFIG 0x005C 33 33 #define XLNX_USB_TRAFFIC_ROUTE_FPD 0x1 34 34 35 - /* Versal USB Reset ID */ 36 - #define VERSAL_USB_RESET_ID 0xC104036 37 - 38 35 #define XLNX_USB_FPD_PIPE_CLK 0x7c 39 36 #define PIPE_CLK_DESELECT 1 40 37 #define PIPE_CLK_SELECT 0 ··· 69 72 static int dwc3_xlnx_init_versal(struct dwc3_xlnx *priv_data) 70 73 { 71 74 struct device *dev = priv_data->dev; 75 + struct reset_control *crst; 72 76 int ret; 77 + 78 + crst = devm_reset_control_get_exclusive(dev, NULL); 79 + if (IS_ERR(crst)) 80 + return dev_err_probe(dev, PTR_ERR(crst), "failed to get reset signal\n"); 73 81 74 82 dwc3_xlnx_mask_phy_rst(priv_data, false); 75 83 76 84 /* Assert and De-assert reset */ 77 - ret = zynqmp_pm_reset_assert(VERSAL_USB_RESET_ID, 78 - PM_RESET_ACTION_ASSERT); 85 + ret = reset_control_assert(crst); 79 86 if (ret < 0) { 80 87 dev_err_probe(dev, ret, "failed to assert Reset\n"); 81 88 return ret; 82 89 } 83 90 84 - ret = zynqmp_pm_reset_assert(VERSAL_USB_RESET_ID, 85 - PM_RESET_ACTION_RELEASE); 91 + ret = reset_control_deassert(crst); 86 92 if (ret < 0) { 87 93 dev_err_probe(dev, ret, "failed to De-assert Reset\n"); 88 94 return ret;