Commit 11520b87 authored by Simon Trimmer's avatar Simon Trimmer Committed by Mark Brown

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: default avatarSimon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: default avatarRichard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230320112245.115720-6-rf@opensource.cirrus.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 65a314b7
...@@ -998,11 +998,8 @@ int wm_adsp2_preloader_put(struct snd_kcontrol *kcontrol, ...@@ -998,11 +998,8 @@ int wm_adsp2_preloader_put(struct snd_kcontrol *kcontrol,
} }
EXPORT_SYMBOL_GPL(wm_adsp2_preloader_put); EXPORT_SYMBOL_GPL(wm_adsp2_preloader_put);
static void wm_adsp_boot_work(struct work_struct *work) int wm_adsp_power_up(struct wm_adsp *dsp)
{ {
struct wm_adsp *dsp = container_of(work,
struct wm_adsp,
boot_work);
int ret = 0; int ret = 0;
char *wmfw_filename = NULL; char *wmfw_filename = NULL;
const struct firmware *wmfw_firmware = NULL; const struct firmware *wmfw_firmware = NULL;
...@@ -1013,16 +1010,28 @@ static void wm_adsp_boot_work(struct work_struct *work) ...@@ -1013,16 +1010,28 @@ static void wm_adsp_boot_work(struct work_struct *work)
&wmfw_firmware, &wmfw_filename, &wmfw_firmware, &wmfw_filename,
&coeff_firmware, &coeff_filename); &coeff_firmware, &coeff_filename);
if (ret) if (ret)
return; return ret;
cs_dsp_power_up(&dsp->cs_dsp, ret = cs_dsp_power_up(&dsp->cs_dsp,
wmfw_firmware, wmfw_filename, wmfw_firmware, wmfw_filename,
coeff_firmware, coeff_filename, coeff_firmware, coeff_filename,
wm_adsp_fw_text[dsp->fw]); wm_adsp_fw_text[dsp->fw]);
wm_adsp_release_firmware_files(dsp, wm_adsp_release_firmware_files(dsp,
wmfw_firmware, wmfw_filename, wmfw_firmware, wmfw_filename,
coeff_firmware, coeff_filename); coeff_firmware, coeff_filename);
return ret;
}
EXPORT_SYMBOL_GPL(wm_adsp_power_up);
static void wm_adsp_boot_work(struct work_struct *work)
{
struct wm_adsp *dsp = container_of(work,
struct wm_adsp,
boot_work);
wm_adsp_power_up(dsp);
} }
int wm_adsp_early_event(struct snd_soc_dapm_widget *w, int wm_adsp_early_event(struct snd_soc_dapm_widget *w,
......
...@@ -91,6 +91,8 @@ int wm_adsp1_event(struct snd_soc_dapm_widget *w, ...@@ -91,6 +91,8 @@ int wm_adsp1_event(struct snd_soc_dapm_widget *w,
int wm_adsp_early_event(struct snd_soc_dapm_widget *w, int wm_adsp_early_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event); struct snd_kcontrol *kcontrol, int event);
int wm_adsp_power_up(struct wm_adsp *dsp);
irqreturn_t wm_adsp2_bus_error(int irq, void *data); irqreturn_t wm_adsp2_bus_error(int irq, void *data);
irqreturn_t wm_halo_bus_error(int irq, void *data); irqreturn_t wm_halo_bus_error(int irq, void *data);
irqreturn_t wm_halo_wdt_expire(int irq, void *data); irqreturn_t wm_halo_wdt_expire(int irq, void *data);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment