int ret;
list_for_each_entry(ctl, &dsp->ctl_list, list) {
- if (ctl->fw_name == wm_adsp_fw_text[dsp->fw] &&
+ if (ctl->fw_name == dsp->fw_name &&
ctl->alg_region.alg == alg_region->alg &&
ctl->alg_region.type == alg_region->type) {
if ((!subname && !ctl->subname) ||
ctl = kzalloc(sizeof(*ctl), GFP_KERNEL);
if (!ctl)
return -ENOMEM;
- ctl->fw_name = wm_adsp_fw_text[dsp->fw];
+
+ ctl->fw_name = dsp->fw_name;
ctl->alg_region = *alg_region;
if (subname && dsp->fw_ver >= 2) {
ctl->subname_len = subname_len;
}
}
-static int cs_dsp_load(struct wm_adsp *dsp)
+static int cs_dsp_load(struct wm_adsp *dsp, const char *fw_file_name)
{
LIST_HEAD(buf_list);
const struct firmware *firmware;
return -ENOMEM;
snprintf(file, PAGE_SIZE, "%s-%s-%s.wmfw", dsp->part, dsp->fwf_name,
- wm_adsp_fw[dsp->fw].file);
+ fw_file_name);
file[PAGE_SIZE - 1] = '\0';
ret = request_firmware(&firmware, file, dsp->dev);
unsigned int alg)
{
struct cs_dsp_coeff_ctl *pos, *rslt = NULL;
- const char *fw_txt = wm_adsp_fw_text[dsp->fw];
list_for_each_entry(pos, &dsp->ctl_list, list) {
if (!pos->subname)
continue;
if (strncmp(pos->subname, name, pos->subname_len) == 0 &&
- pos->fw_name == fw_txt &&
+ pos->fw_name == dsp->fw_name &&
pos->alg_region.alg == alg &&
pos->alg_region.type == type) {
rslt = pos;
struct cs_dsp_coeff_ctl *ctl;
list_for_each_entry(ctl, &dsp->ctl_list, list) {
- if (ctl->fw_name == wm_adsp_fw_text[dsp->fw] &&
+ if (ctl->fw_name == dsp->fw_name &&
alg_region->alg == ctl->alg_region.alg &&
alg_region->type == ctl->alg_region.type) {
ctl->alg_region.base = alg_region->base;
return ret;
}
-static int cs_dsp_load_coeff(struct wm_adsp *dsp)
+static int cs_dsp_load_coeff(struct wm_adsp *dsp, const char *fw_file_name)
{
LIST_HEAD(buf_list);
struct regmap *regmap = dsp->regmap;
return -ENOMEM;
snprintf(file, PAGE_SIZE, "%s-%s-%s.bin", dsp->part, dsp->fwf_name,
- wm_adsp_fw[dsp->fw].file);
+ fw_file_name);
file[PAGE_SIZE - 1] = '\0';
ret = request_firmware(&firmware, file, dsp->dev);
}
EXPORT_SYMBOL_GPL(wm_adsp1_init);
-static int cs_dsp_adsp1_power_up(struct wm_adsp *dsp)
+static int cs_dsp_adsp1_power_up(struct wm_adsp *dsp, const char *fw_file_name, const char *fw_name)
{
unsigned int val;
int ret;
mutex_lock(&dsp->pwr_lock);
+ dsp->fw_name = fw_name;
+
regmap_update_bits(dsp->regmap, dsp->base + ADSP1_CONTROL_30,
ADSP1_SYS_ENA, ADSP1_SYS_ENA);
}
}
- ret = cs_dsp_load(dsp);
+ ret = cs_dsp_load(dsp, fw_file_name);
if (ret != 0)
goto err_ena;
if (ret != 0)
goto err_ena;
- ret = cs_dsp_load_coeff(dsp);
+ ret = cs_dsp_load_coeff(dsp, fw_file_name);
if (ret != 0)
goto err_ena;
switch (event) {
case SND_SOC_DAPM_POST_PMU:
- ret = cs_dsp_adsp1_power_up(dsp);
+ ret = cs_dsp_adsp1_power_up(dsp,
+ wm_adsp_fw[dsp->fw].file,
+ wm_adsp_fw_text[dsp->fw]);
break;
case SND_SOC_DAPM_PRE_PMD:
cs_dsp_adsp1_power_down(dsp);
HALO_WDT_EN_MASK, 0);
}
-static void cs_dsp_power_up(struct wm_adsp *dsp)
+static void cs_dsp_power_up(struct wm_adsp *dsp, const char *fw_file_name,
+ const char *fw_name)
{
int ret;
mutex_lock(&dsp->pwr_lock);
+ dsp->fw_name = fw_name;
+
if (dsp->ops->enable_memory) {
ret = dsp->ops->enable_memory(dsp);
if (ret != 0)
goto err_mem;
}
- ret = cs_dsp_load(dsp);
+ ret = cs_dsp_load(dsp, fw_file_name);
if (ret != 0)
goto err_ena;
if (ret != 0)
goto err_ena;
- ret = cs_dsp_load_coeff(dsp);
+ ret = cs_dsp_load_coeff(dsp, fw_file_name);
if (ret != 0)
goto err_ena;
struct wm_adsp,
boot_work);
- cs_dsp_power_up(dsp);
+ cs_dsp_power_up(dsp,
+ wm_adsp_fw[dsp->fw].file,
+ wm_adsp_fw_text[dsp->fw]);
}
int wm_adsp_early_event(struct snd_soc_dapm_widget *w,