diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2014-03-12 10:27:36 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-03-13 05:38:14 -0400 |
commit | 7b2655b409211d619d99a1bb325797dee22a1c8b (patch) | |
tree | e4d8ab608bcb533674f47de726148175d953ec5c /sound/soc/cirrus/snappercl15.c | |
parent | 17cb37aafdc11b875b915292ae21ac3a4f1425a7 (diff) |
ASoC: snappercl15: Convert to table based DAPM setup
Use table based setup to register the DAPM widgets and routes. This on one hand
makes the code a bit shorter and cleaner and on the other hand the board level
DAPM elements get registered in the card's DAPM context rather than in the
CODEC's DAPM context.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/cirrus/snappercl15.c')
-rw-r--r-- | sound/soc/cirrus/snappercl15.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/sound/soc/cirrus/snappercl15.c b/sound/soc/cirrus/snappercl15.c index 29238a7476dd..5b68b106cfc2 100644 --- a/sound/soc/cirrus/snappercl15.c +++ b/sound/soc/cirrus/snappercl15.c | |||
@@ -65,18 +65,6 @@ static const struct snd_soc_dapm_route audio_map[] = { | |||
65 | {"MICIN", NULL, "Mic Jack"}, | 65 | {"MICIN", NULL, "Mic Jack"}, |
66 | }; | 66 | }; |
67 | 67 | ||
68 | static int snappercl15_tlv320aic23_init(struct snd_soc_pcm_runtime *rtd) | ||
69 | { | ||
70 | struct snd_soc_codec *codec = rtd->codec; | ||
71 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
72 | |||
73 | snd_soc_dapm_new_controls(dapm, tlv320aic23_dapm_widgets, | ||
74 | ARRAY_SIZE(tlv320aic23_dapm_widgets)); | ||
75 | |||
76 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); | ||
77 | return 0; | ||
78 | } | ||
79 | |||
80 | static struct snd_soc_dai_link snappercl15_dai = { | 68 | static struct snd_soc_dai_link snappercl15_dai = { |
81 | .name = "tlv320aic23", | 69 | .name = "tlv320aic23", |
82 | .stream_name = "AIC23", | 70 | .stream_name = "AIC23", |
@@ -84,7 +72,6 @@ static struct snd_soc_dai_link snappercl15_dai = { | |||
84 | .codec_dai_name = "tlv320aic23-hifi", | 72 | .codec_dai_name = "tlv320aic23-hifi", |
85 | .codec_name = "tlv320aic23-codec.0-001a", | 73 | .codec_name = "tlv320aic23-codec.0-001a", |
86 | .platform_name = "ep93xx-i2s", | 74 | .platform_name = "ep93xx-i2s", |
87 | .init = snappercl15_tlv320aic23_init, | ||
88 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_IF | | 75 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_IF | |
89 | SND_SOC_DAIFMT_CBS_CFS, | 76 | SND_SOC_DAIFMT_CBS_CFS, |
90 | .ops = &snappercl15_ops, | 77 | .ops = &snappercl15_ops, |
@@ -95,6 +82,11 @@ static struct snd_soc_card snd_soc_snappercl15 = { | |||
95 | .owner = THIS_MODULE, | 82 | .owner = THIS_MODULE, |
96 | .dai_link = &snappercl15_dai, | 83 | .dai_link = &snappercl15_dai, |
97 | .num_links = 1, | 84 | .num_links = 1, |
85 | |||
86 | .dapm_widgets = tlv320aic23_dapm_widgets, | ||
87 | .num_dapm_widgets = ARRAY_SIZE(tlv320aic23_dapm_widgets), | ||
88 | .dapm_routes = audio_map, | ||
89 | .num_dapm_routes = ARRAY_SIZE(audio_map), | ||
98 | }; | 90 | }; |
99 | 91 | ||
100 | static int snappercl15_probe(struct platform_device *pdev) | 92 | static int snappercl15_probe(struct platform_device *pdev) |