|
@@ -2500,6 +2500,43 @@ static void wm_adsp2_set_dspclk(struct wm_adsp *dsp, unsigned int freq)
|
|
|
adsp_err(dsp, "Failed to set clock rate: %d\n", ret);
|
|
|
}
|
|
|
|
|
|
+int wm_adsp2_preloader_get(struct snd_kcontrol *kcontrol,
|
|
|
+ struct snd_ctl_elem_value *ucontrol)
|
|
|
+{
|
|
|
+ struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
|
|
|
+ struct wm_adsp *dsp = snd_soc_codec_get_drvdata(codec);
|
|
|
+
|
|
|
+ ucontrol->value.integer.value[0] = dsp->preloaded;
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+EXPORT_SYMBOL_GPL(wm_adsp2_preloader_get);
|
|
|
+
|
|
|
+int wm_adsp2_preloader_put(struct snd_kcontrol *kcontrol,
|
|
|
+ struct snd_ctl_elem_value *ucontrol)
|
|
|
+{
|
|
|
+ struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
|
|
|
+ struct wm_adsp *dsp = snd_soc_codec_get_drvdata(codec);
|
|
|
+ struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
|
|
|
+ struct soc_mixer_control *mc =
|
|
|
+ (struct soc_mixer_control *)kcontrol->private_value;
|
|
|
+ char preload[32];
|
|
|
+
|
|
|
+ snprintf(preload, ARRAY_SIZE(preload), "DSP%d Preload", mc->shift);
|
|
|
+
|
|
|
+ dsp->preloaded = ucontrol->value.integer.value[0];
|
|
|
+
|
|
|
+ if (ucontrol->value.integer.value[0])
|
|
|
+ snd_soc_dapm_force_enable_pin(dapm, preload);
|
|
|
+ else
|
|
|
+ snd_soc_dapm_disable_pin(dapm, preload);
|
|
|
+
|
|
|
+ snd_soc_dapm_sync(dapm);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+EXPORT_SYMBOL_GPL(wm_adsp2_preloader_put);
|
|
|
+
|
|
|
int wm_adsp2_early_event(struct snd_soc_dapm_widget *w,
|
|
|
struct snd_kcontrol *kcontrol, int event,
|
|
|
unsigned int freq)
|
|
@@ -2631,10 +2668,16 @@ EXPORT_SYMBOL_GPL(wm_adsp2_event);
|
|
|
|
|
|
int wm_adsp2_codec_probe(struct wm_adsp *dsp, struct snd_soc_codec *codec)
|
|
|
{
|
|
|
- dsp->codec = codec;
|
|
|
+ struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
|
|
|
+ char preload[32];
|
|
|
+
|
|
|
+ snprintf(preload, ARRAY_SIZE(preload), "DSP%d Preload", dsp->num);
|
|
|
+ snd_soc_dapm_disable_pin(dapm, preload);
|
|
|
|
|
|
wm_adsp2_init_debugfs(dsp, codec);
|
|
|
|
|
|
+ dsp->codec = codec;
|
|
|
+
|
|
|
return snd_soc_add_codec_controls(codec,
|
|
|
&wm_adsp_fw_controls[dsp->num - 1],
|
|
|
1);
|