提交 ac50009f 编写于 作者: M Mark Brown

ASoC: wm_adsp: Add support for firmware wide coefficient blocks

Firmwares may provide some firmware wide configuration regions which can
be configured by the coefficient files using the firmware ID as the
algorithm ID, include these in the algorithm list.
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 dd84f925
...@@ -565,6 +565,22 @@ static int wm_adsp_setup_algs(struct wm_adsp *dsp) ...@@ -565,6 +565,22 @@ static int wm_adsp_setup_algs(struct wm_adsp *dsp)
be32_to_cpu(adsp1_id.fw.ver) & 0xff, be32_to_cpu(adsp1_id.fw.ver) & 0xff,
algs); algs);
region = kzalloc(sizeof(*region), GFP_KERNEL);
if (!region)
return -ENOMEM;
region->type = WMFW_ADSP1_ZM;
region->alg = be32_to_cpu(adsp1_id.fw.id);
region->base = be32_to_cpu(adsp1_id.zm);
list_add_tail(&region->list, &dsp->alg_regions);
region = kzalloc(sizeof(*region), GFP_KERNEL);
if (!region)
return -ENOMEM;
region->type = WMFW_ADSP1_DM;
region->alg = be32_to_cpu(adsp1_id.fw.id);
region->base = be32_to_cpu(adsp1_id.dm);
list_add_tail(&region->list, &dsp->alg_regions);
pos = sizeof(adsp1_id) / 2; pos = sizeof(adsp1_id) / 2;
term = pos + ((sizeof(*adsp1_alg) * algs) / 2); term = pos + ((sizeof(*adsp1_alg) * algs) / 2);
break; break;
...@@ -590,6 +606,30 @@ static int wm_adsp_setup_algs(struct wm_adsp *dsp) ...@@ -590,6 +606,30 @@ static int wm_adsp_setup_algs(struct wm_adsp *dsp)
be32_to_cpu(adsp2_id.fw.ver) & 0xff, be32_to_cpu(adsp2_id.fw.ver) & 0xff,
algs); algs);
region = kzalloc(sizeof(*region), GFP_KERNEL);
if (!region)
return -ENOMEM;
region->type = WMFW_ADSP2_XM;
region->alg = be32_to_cpu(adsp2_id.fw.id);
region->base = be32_to_cpu(adsp2_id.xm);
list_add_tail(&region->list, &dsp->alg_regions);
region = kzalloc(sizeof(*region), GFP_KERNEL);
if (!region)
return -ENOMEM;
region->type = WMFW_ADSP2_YM;
region->alg = be32_to_cpu(adsp2_id.fw.id);
region->base = be32_to_cpu(adsp2_id.ym);
list_add_tail(&region->list, &dsp->alg_regions);
region = kzalloc(sizeof(*region), GFP_KERNEL);
if (!region)
return -ENOMEM;
region->type = WMFW_ADSP2_ZM;
region->alg = be32_to_cpu(adsp2_id.fw.id);
region->base = be32_to_cpu(adsp2_id.zm);
list_add_tail(&region->list, &dsp->alg_regions);
pos = sizeof(adsp2_id) / 2; pos = sizeof(adsp2_id) / 2;
term = pos + ((sizeof(*adsp2_alg) * algs) / 2); term = pos + ((sizeof(*adsp2_alg) * algs) / 2);
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册