mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-15 06:55:13 +08:00
ASoC: wm_adsp: create ALSA controls from wm_adsp driver
Now that we have a codec_probe stage initialization in the wm_adsp driver, we can make the wm_adsp driver create its own ALSA controls instead of having that responsibility pushed to every codec driver. Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
f5e2ce92bd
commit
218e508784
@ -1879,10 +1879,6 @@ static int wm5102_codec_probe(struct snd_soc_codec *codec)
|
|||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
ret = snd_soc_add_codec_controls(codec, wm_adsp2_fw_controls, 2);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
arizona_init_spk(codec);
|
arizona_init_spk(codec);
|
||||||
arizona_init_gpio(codec);
|
arizona_init_gpio(codec);
|
||||||
|
|
||||||
|
@ -1613,10 +1613,6 @@ static int wm5110_codec_probe(struct snd_soc_codec *codec)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = snd_soc_add_codec_controls(codec, wm_adsp2_fw_controls, 8);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
snd_soc_dapm_disable_pin(&codec->dapm, "HAPTICS");
|
snd_soc_dapm_disable_pin(&codec->dapm, "HAPTICS");
|
||||||
|
|
||||||
priv->core.arizona->dapm = &codec->dapm;
|
priv->core.arizona->dapm = &codec->dapm;
|
||||||
|
@ -298,7 +298,6 @@ const struct snd_kcontrol_new wm_adsp1_fw_controls[] = {
|
|||||||
};
|
};
|
||||||
EXPORT_SYMBOL_GPL(wm_adsp1_fw_controls);
|
EXPORT_SYMBOL_GPL(wm_adsp1_fw_controls);
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_SND_SOC_ARIZONA)
|
|
||||||
static const struct soc_enum wm_adsp2_rate_enum[] = {
|
static const struct soc_enum wm_adsp2_rate_enum[] = {
|
||||||
SOC_VALUE_ENUM_SINGLE(ARIZONA_DSP1_CONTROL_1,
|
SOC_VALUE_ENUM_SINGLE(ARIZONA_DSP1_CONTROL_1,
|
||||||
ARIZONA_DSP1_RATE_SHIFT, 0xf,
|
ARIZONA_DSP1_RATE_SHIFT, 0xf,
|
||||||
@ -318,22 +317,28 @@ static const struct soc_enum wm_adsp2_rate_enum[] = {
|
|||||||
arizona_rate_text, arizona_rate_val),
|
arizona_rate_text, arizona_rate_val),
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct snd_kcontrol_new wm_adsp2_fw_controls[] = {
|
static const struct snd_kcontrol_new wm_adsp2_fw_controls[4][2] = {
|
||||||
SOC_ENUM_EXT("DSP1 Firmware", wm_adsp_fw_enum[0],
|
{
|
||||||
wm_adsp_fw_get, wm_adsp_fw_put),
|
SOC_ENUM_EXT("DSP1 Firmware", wm_adsp_fw_enum[0],
|
||||||
SOC_ENUM("DSP1 Rate", wm_adsp2_rate_enum[0]),
|
wm_adsp_fw_get, wm_adsp_fw_put),
|
||||||
SOC_ENUM_EXT("DSP2 Firmware", wm_adsp_fw_enum[1],
|
SOC_ENUM("DSP1 Rate", wm_adsp2_rate_enum[0]),
|
||||||
wm_adsp_fw_get, wm_adsp_fw_put),
|
},
|
||||||
SOC_ENUM("DSP2 Rate", wm_adsp2_rate_enum[1]),
|
{
|
||||||
SOC_ENUM_EXT("DSP3 Firmware", wm_adsp_fw_enum[2],
|
SOC_ENUM_EXT("DSP2 Firmware", wm_adsp_fw_enum[1],
|
||||||
wm_adsp_fw_get, wm_adsp_fw_put),
|
wm_adsp_fw_get, wm_adsp_fw_put),
|
||||||
SOC_ENUM("DSP3 Rate", wm_adsp2_rate_enum[2]),
|
SOC_ENUM("DSP2 Rate", wm_adsp2_rate_enum[1]),
|
||||||
SOC_ENUM_EXT("DSP4 Firmware", wm_adsp_fw_enum[3],
|
},
|
||||||
wm_adsp_fw_get, wm_adsp_fw_put),
|
{
|
||||||
SOC_ENUM("DSP4 Rate", wm_adsp2_rate_enum[3]),
|
SOC_ENUM_EXT("DSP3 Firmware", wm_adsp_fw_enum[2],
|
||||||
|
wm_adsp_fw_get, wm_adsp_fw_put),
|
||||||
|
SOC_ENUM("DSP3 Rate", wm_adsp2_rate_enum[2]),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
SOC_ENUM_EXT("DSP4 Firmware", wm_adsp_fw_enum[3],
|
||||||
|
wm_adsp_fw_get, wm_adsp_fw_put),
|
||||||
|
SOC_ENUM("DSP4 Rate", wm_adsp2_rate_enum[3]),
|
||||||
|
},
|
||||||
};
|
};
|
||||||
EXPORT_SYMBOL_GPL(wm_adsp2_fw_controls);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static struct wm_adsp_region const *wm_adsp_find_region(struct wm_adsp *dsp,
|
static struct wm_adsp_region const *wm_adsp_find_region(struct wm_adsp *dsp,
|
||||||
int type)
|
int type)
|
||||||
@ -1935,7 +1940,9 @@ EXPORT_SYMBOL_GPL(wm_adsp2_event);
|
|||||||
|
|
||||||
int wm_adsp2_codec_probe(struct wm_adsp *dsp, struct snd_soc_codec *codec)
|
int wm_adsp2_codec_probe(struct wm_adsp *dsp, struct snd_soc_codec *codec)
|
||||||
{
|
{
|
||||||
return 0;
|
return snd_soc_add_codec_controls(codec,
|
||||||
|
wm_adsp2_fw_controls[dsp->num - 1],
|
||||||
|
ARRAY_SIZE(wm_adsp2_fw_controls[0]));
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(wm_adsp2_codec_probe);
|
EXPORT_SYMBOL_GPL(wm_adsp2_codec_probe);
|
||||||
|
|
||||||
|
@ -75,7 +75,6 @@ struct wm_adsp {
|
|||||||
WM_ADSP2_E(wname, num, wm_adsp2_early_event)
|
WM_ADSP2_E(wname, num, wm_adsp2_early_event)
|
||||||
|
|
||||||
extern const struct snd_kcontrol_new wm_adsp1_fw_controls[];
|
extern const struct snd_kcontrol_new wm_adsp1_fw_controls[];
|
||||||
extern const struct snd_kcontrol_new wm_adsp2_fw_controls[];
|
|
||||||
|
|
||||||
int wm_adsp1_init(struct wm_adsp *dsp);
|
int wm_adsp1_init(struct wm_adsp *dsp);
|
||||||
int wm_adsp2_init(struct wm_adsp *dsp);
|
int wm_adsp2_init(struct wm_adsp *dsp);
|
||||||
|
Loading…
Reference in New Issue
Block a user