xudc: hax for testing

This commit is contained in:
tmakin committed 2026-10-16 10:05:08 -05:00
1 parent 416d5d3002
commit 0aaad09bd8
1 file changed
+10 -20
+10 -20
View File
@@ -3495,7 +3495,7 @@ static void tegra_xudc_device_params_init(struct tegra_xudc *xudc)
static int tegra_xudc_phy_get(struct tegra_xudc *xudc)
{
int err = 0, usb3_companion_port;
unsigned int i, j;
unsigned int i;
xudc->utmi_phy = devm_kcalloc(xudc->dev, xudc->soc->num_phys,
sizeof(*xudc->utmi_phy), GFP_KERNEL);
@@ -3546,26 +3546,16 @@ static int tegra_xudc_phy_get(struct tegra_xudc *xudc)
if (usb3_companion_port < 0)
continue;
for (j = 0; j < xudc->soc->num_phys; j++) {
snprintf(phy_name, sizeof(phy_name), "usb3-%d", j);
xudc->usb3_phy[i] = devm_phy_optional_get(xudc->dev, phy_name);
if (IS_ERR(xudc->usb3_phy[i])) {
err = PTR_ERR(xudc->usb3_phy[i]);
dev_err_probe(xudc->dev, err,
"failed to get PHY for phy-name usb3-%d\n", j);
goto clean_up;
} else if (xudc->usb3_phy[i]) {
int usb2_port =
tegra_xusb_padctl_get_port_number(xudc->utmi_phy[i]);
int usb3_port =
tegra_xusb_padctl_get_port_number(xudc->usb3_phy[i]);
if (usb3_port == usb3_companion_port) {
dev_dbg(xudc->dev, "USB2 port %d is paired with USB3 port %d for device mode port %d\n",
usb2_port, usb3_port, i);
break;
}
}
snprintf(phy_name, sizeof(phy_name), "usb3-%d", usb3_companion_port);
xudc->usb3_phy[i] = devm_phy_optional_get(xudc->dev, phy_name);
if (IS_ERR(xudc->usb3_phy[i])) {
err = PTR_ERR(xudc->usb3_phy[i]);
dev_err_probe(xudc->dev, err, "failed to get PHY for phy-name usb3-%d\n", usb3_companion_port);
goto clean_up;
}
dev_info(xudc->dev, "port %u: usb3_companion=%d, usb3_phy=%p\n",
i, usb3_companion_port, xudc->usb3_phy[i]);
}
return err;