9 Jan
2012
9 Jan
'12
8:10 p.m.
On 01/09/2012 12:01 PM, Javier Martin wrote:
[...] diff --git a/sound/soc/imx/mx27vis-aic32x4.c b/sound/soc/imx/mx27vis-aic32x4.c index 054110b..7e55a99 100644 --- a/sound/soc/imx/mx27vis-aic32x4.c +++ b/sound/soc/imx/mx27vis-aic32x4.c @@ -74,6 +74,43 @@ static struct snd_soc_ops mx27vis_aic32x4_snd_ops = {
[...]
+static const struct snd_soc_dapm_route audio_map[] = {
I know this is can be found in may drivers as well, but aic32x4_dapm_routes would be a much better name.
+};
+static int mx27vis_aic32x4_dai_init(struct snd_soc_pcm_runtime *rtd) +{
- struct snd_soc_codec *codec = rtd->codec;
- struct snd_soc_dapm_context *dapm = &codec->dapm;
- int err = 0;
- snd_soc_dapm_new_controls(dapm, aic32x4_dapm_widgets,
ARRAY_SIZE(aic32x4_dapm_widgets));
- err = snd_soc_add_controls(codec, mx27vis_aic32x4_controls,
ARRAY_SIZE(mx27vis_aic32x4_controls));
- if (err < 0)
return err;
- snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
Use the snd_soc_card's controls, dapm_widgets and dapm_routes fields to register these instead of open coding it here.