diff options
author | Charles Keepax <ckeepax@opensource.cirrus.com> | 2021-11-17 14:22:54 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-11-17 23:16:22 +0100 |
commit | 14055b5a3a23204c4702ae5d3f2a819ee081ce33 (patch) | |
tree | ce8871c4d29ad23a01b5cb7ae2758f9e0a435ba8 /drivers/firmware | |
parent | firmware: cs_dsp: Add version checks on coefficient loading (diff) | |
download | linux-14055b5a3a23204c4702ae5d3f2a819ee081ce33.tar.xz linux-14055b5a3a23204c4702ae5d3f2a819ee081ce33.zip |
firmware: cs_dsp: Add pre_run callback
The code already has a post_run callback, add a matching pre_run
callback to the client_ops that is called before execution is started.
This callback provides a convenient place for the client code to
set DSP controls or hardware that requires configuration before
the DSP core actually starts execution. Note that placing this callback
before cs_dsp_coeff_sync_controls is important to ensure that any
control values are then correctly synced out to the chip.
Co-authored-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20211117132300.1290-4-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/firmware')
-rw-r--r-- | drivers/firmware/cirrus/cs_dsp.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/firmware/cirrus/cs_dsp.c b/drivers/firmware/cirrus/cs_dsp.c index 0da454a8498d..ef7afadea42d 100644 --- a/drivers/firmware/cirrus/cs_dsp.c +++ b/drivers/firmware/cirrus/cs_dsp.c @@ -2627,6 +2627,12 @@ int cs_dsp_run(struct cs_dsp *dsp) goto err; } + if (dsp->client_ops->pre_run) { + ret = dsp->client_ops->pre_run(dsp); + if (ret) + goto err; + } + /* Sync set controls */ ret = cs_dsp_coeff_sync_controls(dsp); if (ret != 0) |