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

Commit 1665c177 authored by Jayachandran B's avatar Jayachandran B Committed by Mark Brown
Browse files

ASoC: Intel: Skylake: Enable firmware reload in suspend



Broxton DSP needs retains code loaded during runtime_pm cycles.
But it looses that on suspend cycle, so on resume we need to
download the firmware again.

This is done by adding a new flag and based on flag status, we
download the firmware.

Signed-off-by: default avatarJayachandran B <jayachandran.b@intel.com>
Signed-off-by: default avatarSenthilnathan Veppur <senthilnathanx.veppur@intel.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 316f135a
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -185,6 +185,7 @@ static int bxt_load_base_firmware(struct sst_dsp *ctx)
		} else {
			skl_dsp_set_state_locked(ctx, SKL_DSP_RUNNING);
			ret = 0;
			skl->fw_loaded = true;
		}
	}

@@ -200,6 +201,14 @@ static int bxt_set_dsp_D0(struct sst_dsp *ctx)

	skl->boot_complete = false;

	if (skl->fw_loaded == false) {
		dev_dbg(ctx->dev, "Re-loading fw\n");
		ret = bxt_load_base_firmware(ctx);
		if (ret < 0)
			dev_err(ctx->dev, "reload fw failed: %d\n", ret);
		return ret;
	}

	ret = skl_dsp_enable_core(ctx);
	if (ret < 0) {
		dev_err(ctx->dev, "enable dsp core failed ret: %d\n", ret);
+3 −0
Original line number Diff line number Diff line
@@ -63,6 +63,9 @@ struct skl_sst {

	/* Populate module information */
	struct list_head uuid_list;

	/* Is firmware loaded */
	bool fw_loaded;
};

struct skl_ipc_init_instance_msg {
+1 −0
Original line number Diff line number Diff line
@@ -153,6 +153,7 @@ static int skl_load_base_firmware(struct sst_dsp *ctx)

		dev_dbg(ctx->dev, "Download firmware successful%d\n", ret);
		skl_dsp_set_state_locked(ctx, SKL_DSP_RUNNING);
		skl->fw_loaded = true;
	}
	return 0;
transfer_firmware_failed:
+1 −0
Original line number Diff line number Diff line
@@ -248,6 +248,7 @@ static int skl_suspend(struct device *dev)
		ret = _skl_suspend(ebus);
		if (ret < 0)
			return ret;
		skl->skl_sst->fw_loaded = false;
	}

	if (IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI)) {