Skip to content

Commit 11520b8

Browse files
simontrimmerbroonie
authored andcommitted
ASoC: wm_adsp: Expose the DSP boot work actions as wm_adsp_power_up()
To support self-booting DSPs that are considered always running, the work that is usually invoked as part of a DAPM sequence needs to be triggered by a client of wm_adsp as part of it's startup sequence. These actions load firmware files that might create ALSA controls and apply configuration to the device. Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com> Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230320112245.115720-6-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 65a314b commit 11520b8

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

sound/soc/codecs/wm_adsp.c

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -998,11 +998,8 @@ int wm_adsp2_preloader_put(struct snd_kcontrol *kcontrol,
998998
}
999999
EXPORT_SYMBOL_GPL(wm_adsp2_preloader_put);
10001000

1001-
static void wm_adsp_boot_work(struct work_struct *work)
1001+
int wm_adsp_power_up(struct wm_adsp *dsp)
10021002
{
1003-
struct wm_adsp *dsp = container_of(work,
1004-
struct wm_adsp,
1005-
boot_work);
10061003
int ret = 0;
10071004
char *wmfw_filename = NULL;
10081005
const struct firmware *wmfw_firmware = NULL;
@@ -1013,16 +1010,28 @@ static void wm_adsp_boot_work(struct work_struct *work)
10131010
&wmfw_firmware, &wmfw_filename,
10141011
&coeff_firmware, &coeff_filename);
10151012
if (ret)
1016-
return;
1013+
return ret;
10171014

1018-
cs_dsp_power_up(&dsp->cs_dsp,
1019-
wmfw_firmware, wmfw_filename,
1020-
coeff_firmware, coeff_filename,
1021-
wm_adsp_fw_text[dsp->fw]);
1015+
ret = cs_dsp_power_up(&dsp->cs_dsp,
1016+
wmfw_firmware, wmfw_filename,
1017+
coeff_firmware, coeff_filename,
1018+
wm_adsp_fw_text[dsp->fw]);
10221019

10231020
wm_adsp_release_firmware_files(dsp,
10241021
wmfw_firmware, wmfw_filename,
10251022
coeff_firmware, coeff_filename);
1023+
1024+
return ret;
1025+
}
1026+
EXPORT_SYMBOL_GPL(wm_adsp_power_up);
1027+
1028+
static void wm_adsp_boot_work(struct work_struct *work)
1029+
{
1030+
struct wm_adsp *dsp = container_of(work,
1031+
struct wm_adsp,
1032+
boot_work);
1033+
1034+
wm_adsp_power_up(dsp);
10261035
}
10271036

10281037
int wm_adsp_early_event(struct snd_soc_dapm_widget *w,

sound/soc/codecs/wm_adsp.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ int wm_adsp1_event(struct snd_soc_dapm_widget *w,
9191
int wm_adsp_early_event(struct snd_soc_dapm_widget *w,
9292
struct snd_kcontrol *kcontrol, int event);
9393

94+
int wm_adsp_power_up(struct wm_adsp *dsp);
95+
9496
irqreturn_t wm_adsp2_bus_error(int irq, void *data);
9597
irqreturn_t wm_halo_bus_error(int irq, void *data);
9698
irqreturn_t wm_halo_wdt_expire(int irq, void *data);

0 commit comments

Comments
 (0)