diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2013-08-27 09:50:55 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-08-27 10:31:58 -0400 |
commit | a85f9da707366e856c0aad9e329db0cc59475290 (patch) | |
tree | 9b325251b6ff03e34636c9ab8f54eeb5e05fc0eb /sound/soc | |
parent | d8dfad3876e4386666b759da3c833d62fb8b2267 (diff) |
ASoC: dmic: Convert table based DAPM setup
Let the core take care of instantiating the DAPM widgets and routes, this makes
the code a bit shorter.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/codecs/dmic.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/sound/soc/codecs/dmic.c b/sound/soc/codecs/dmic.c index 66967ba6f757..b2090b2a5e2d 100644 --- a/sound/soc/codecs/dmic.c +++ b/sound/soc/codecs/dmic.c | |||
@@ -50,20 +50,11 @@ static const struct snd_soc_dapm_route intercon[] = { | |||
50 | {"DMIC AIF", NULL, "DMic"}, | 50 | {"DMIC AIF", NULL, "DMic"}, |
51 | }; | 51 | }; |
52 | 52 | ||
53 | static int dmic_probe(struct snd_soc_codec *codec) | ||
54 | { | ||
55 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
56 | |||
57 | snd_soc_dapm_new_controls(dapm, dmic_dapm_widgets, | ||
58 | ARRAY_SIZE(dmic_dapm_widgets)); | ||
59 | snd_soc_dapm_add_routes(dapm, intercon, ARRAY_SIZE(intercon)); | ||
60 | snd_soc_dapm_new_widgets(dapm); | ||
61 | |||
62 | return 0; | ||
63 | } | ||
64 | |||
65 | static struct snd_soc_codec_driver soc_dmic = { | 53 | static struct snd_soc_codec_driver soc_dmic = { |
66 | .probe = dmic_probe, | 54 | .dapm_widgets = dmic_dapm_widgets, |
55 | .num_dapm_widgets = ARRAY_SIZE(dmic_dapm_widgets), | ||
56 | .dapm_routes = intercon, | ||
57 | .num_dapm_routes = ARRAY_SIZE(intercon), | ||
67 | }; | 58 | }; |
68 | 59 | ||
69 | static int dmic_dev_probe(struct platform_device *pdev) | 60 | static int dmic_dev_probe(struct platform_device *pdev) |