Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4ac2416d authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "USB: ice40-hcd: Add retry for loading firmware"

parents aae4e8f2 06a3206b
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -1229,7 +1229,7 @@ static int ice40_bus_resume(struct usb_hcd *hcd)
{
	struct ice40_hcd *ihcd = hcd_to_ihcd(hcd);
	u8 ctrl0;
	int ret;
	int ret, i;

	pm_stay_awake(&ihcd->spi->dev);
	trace_ice40_bus_resume(0); /* start */
@@ -1238,7 +1238,18 @@ static int ice40_bus_resume(struct usb_hcd *hcd)
	 * Re-program the previous settings. For now we need to
	 * update the device address only.
	 */
	ice40_spi_load_fw(ihcd);

	for (i = 0; i < 3; i++) {
		ret = ice40_spi_load_fw(ihcd);
		if (!ret)
			break;
	}

	if (ret) {
		pr_err("Load firmware failed with ret: %d\n", ret);
		return ret;
	}

	ice40_spi_reg_write(ihcd, ihcd->devnum, FADDR_REG);
	ihcd->wblen0 = ~0;