aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.cirrus.com>2021-09-13 17:00:50 +0100
committerMark Brown <broonie@kernel.org>2021-09-27 13:00:35 +0100
commit6092be2d93b3b28dfeca4e5944052a1a21f51ca3 (patch)
tree33c5f066f3dda3e0a570dfdaa66ed1a7e03c4273
parentASoC: wm_adsp: Split DSP power operations into helper functions (diff)
downloadwireguard-linux-6092be2d93b3b28dfeca4e5944052a1a21f51ca3.tar.xz
wireguard-linux-6092be2d93b3b28dfeca4e5944052a1a21f51ca3.zip
ASoC: wm_adsp: Move sys_config_size to wm_adsp
sys_config_size is part of the compressed stream support, move it from what will become generic DSP code so that it remains in ASoC. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com> Link: https://lore.kernel.org/r/20210913160057.103842-10-simont@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/wm_adsp.c10
-rw-r--r--sound/soc/codecs/wm_adsp.h4
2 files changed, 7 insertions, 7 deletions
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index 1bca3922a6b8..82038cac4286 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -3467,6 +3467,8 @@ int wm_adsp2_init(struct wm_adsp *dsp)
{
INIT_WORK(&dsp->boot_work, wm_adsp_boot_work);
+ dsp->sys_config_size = sizeof(struct wm_adsp_system_config_xm_hdr);
+
wm_adsp_common_init(dsp);
return cs_dsp_adsp2_init(dsp);
@@ -3484,6 +3486,8 @@ int wm_halo_init(struct wm_adsp *dsp)
{
INIT_WORK(&dsp->boot_work, wm_adsp_boot_work);
+ dsp->sys_config_size = sizeof(struct wm_halo_system_config_xm_hdr);
+
wm_adsp_common_init(dsp);
return cs_dsp_halo_init(dsp);
@@ -3895,7 +3899,7 @@ static int wm_adsp_buffer_parse_legacy(struct wm_adsp *dsp)
if (!buf)
return -ENOMEM;
- xmalg = dsp->ops->sys_config_size / sizeof(__be32);
+ xmalg = dsp->sys_config_size / sizeof(__be32);
addr = alg_region->base + xmalg + ALG_XM_FIELD(magic);
ret = cs_dsp_read_data_word(dsp, WMFW_ADSP2_XM, addr, &magic);
@@ -4588,7 +4592,6 @@ static const struct cs_dsp_ops cs_dsp_adsp1_ops = {
static const struct cs_dsp_ops cs_dsp_adsp2_ops[] = {
{
- .sys_config_size = sizeof(struct wm_adsp_system_config_xm_hdr),
.parse_sizes = cs_dsp_adsp2_parse_sizes,
.validate_version = cs_dsp_validate_version,
.setup_algs = cs_dsp_adsp2_setup_algs,
@@ -4607,7 +4610,6 @@ static const struct cs_dsp_ops cs_dsp_adsp2_ops[] = {
},
{
- .sys_config_size = sizeof(struct wm_adsp_system_config_xm_hdr),
.parse_sizes = cs_dsp_adsp2_parse_sizes,
.validate_version = cs_dsp_validate_version,
.setup_algs = cs_dsp_adsp2_setup_algs,
@@ -4626,7 +4628,6 @@ static const struct cs_dsp_ops cs_dsp_adsp2_ops[] = {
.stop_core = cs_dsp_adsp2_stop_core,
},
{
- .sys_config_size = sizeof(struct wm_adsp_system_config_xm_hdr),
.parse_sizes = cs_dsp_adsp2_parse_sizes,
.validate_version = cs_dsp_validate_version,
.setup_algs = cs_dsp_adsp2_setup_algs,
@@ -4648,7 +4649,6 @@ static const struct cs_dsp_ops cs_dsp_adsp2_ops[] = {
};
static const struct cs_dsp_ops cs_dsp_halo_ops = {
- .sys_config_size = sizeof(struct wm_halo_system_config_xm_hdr),
.parse_sizes = cs_dsp_adsp2_parse_sizes,
.validate_version = cs_dsp_halo_validate_version,
.setup_algs = cs_dsp_halo_setup_algs,
diff --git a/sound/soc/codecs/wm_adsp.h b/sound/soc/codecs/wm_adsp.h
index 114bc41981ef..98b12b485916 100644
--- a/sound/soc/codecs/wm_adsp.h
+++ b/sound/soc/codecs/wm_adsp.h
@@ -81,6 +81,8 @@ struct wm_adsp {
const struct cs_dsp_region *mem;
int num_mems;
+ unsigned int sys_config_size;
+
int fw;
int fw_ver;
@@ -109,8 +111,6 @@ struct wm_adsp {
};
struct cs_dsp_ops {
- unsigned int sys_config_size;
-
bool (*validate_version)(struct wm_adsp *dsp, unsigned int version);
unsigned int (*parse_sizes)(struct wm_adsp *dsp,
const char * const file,