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

Commit 544d434a 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: Force the chip select to sleep state during resume"

parents 7805c38d d8e58e11
Loading
Loading
Loading
Loading
+13 −0
Original line number Original line Diff line number Diff line
@@ -1507,6 +1507,8 @@ out:
static int ice40_spi_load_fw(struct ice40_hcd *ihcd)
static int ice40_spi_load_fw(struct ice40_hcd *ihcd)
{
{
	int ret, i;
	int ret, i;
	struct pinctrl *p;
	char pin_state[16];


	ret = gpio_direction_output(ihcd->reset_gpio, 0);
	ret = gpio_direction_output(ihcd->reset_gpio, 0);
	if (ret  < 0) {
	if (ret  < 0) {
@@ -1565,6 +1567,17 @@ static int ice40_spi_load_fw(struct ice40_hcd *ihcd)
	gpio_direction_output(ihcd->slave_select_gpio, 1);
	gpio_direction_output(ihcd->slave_select_gpio, 1);
	gpio_free(ihcd->slave_select_gpio);
	gpio_free(ihcd->slave_select_gpio);


	snprintf(pin_state, sizeof(pin_state), "cs%d_sleep",
			ihcd->spi->chip_select);
	p = pinctrl_get_select(ihcd->spi->master->dev.parent, pin_state);
	if (IS_ERR(p)) {
		ret = PTR_ERR(p);
		pr_err("fail to select cs sleep state\n");
		spi_bus_unlock(ihcd->spi->master);
		goto power_off;
	}
	pinctrl_put(p);

	ret = spi_sync_locked(ihcd->spi, ihcd->fmsg);
	ret = spi_sync_locked(ihcd->spi, ihcd->fmsg);


	spi_bus_unlock(ihcd->spi->master);
	spi_bus_unlock(ihcd->spi->master);