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

Commit a5fe6b59 authored by Pavankumar Kondeti's avatar Pavankumar Kondeti Committed by Tarun Gupta
Browse files

USB: ice40-hcd: Add configuration loading test



Provide a debug facility to power off the bridge chip and load the
configuration file. This will be useful to test the configuration
loading multiple times. The below command needs to be executed
to run this test.

echo -n "config_test" > /sys/kernel/debug/ice40_hcd/command

Change-Id: I22d8d5f87f35cd98dafa4189de34169a95e62a67
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
parent 2c227c65
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1949,6 +1949,13 @@ static ssize_t ice40_dbg_cmd_write(struct file *file, const char __user *ubuf,
		ihcd->port_flags |= (USB_PORT_STAT_C_CONNECTION << 16);
		ihcd->pcd_pending = true;
		usb_hcd_poll_rh_status(ihcd->hcd);
	} else if (!strcmp(buf, "config_test")) {
		ice40_spi_power_off(ihcd);
		ret = ice40_spi_load_fw(ihcd);
		if (ret) {
			pr_err("config load failed\n");
			goto out;
		}
	} else {
		ret = -EINVAL;
		goto out;