From c6580a3794a4e16a9bbe53e5d6488dd05fb0cc53 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Sat, 3 Dec 2011 17:15:06 +0000 Subject: [PATCH] --- yaml --- r: 283871 b: refs/heads/master c: 0e62780f5f27f24a30d5a08ed731088115e1fe80 h: refs/heads/master i: 283869: 7110680307f48325a4f4932f0444fb77e76a75e9 283867: 85daebf0427359b06847e2b4973946cc20e59008 283863: 1fb855b46480d69d47ab3fbd87a1393f75f253b4 283855: d4cb1e61a842f592a5189adfa51b7023e8baa4ab 283839: 3ea793093fc8088ccc8db3c7eac1f81dbea62186 v: v3 --- [refs] | 2 +- trunk/sound/soc/codecs/wm8741.c | 24 ++++++++---------------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/[refs] b/[refs] index dfdff646b7ef..714fd80ffe7c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f235c649c1301ae85d5c7e51e88b13adb30ed6a8 +refs/heads/master: 0e62780f5f27f24a30d5a08ed731088115e1fe80 diff --git a/trunk/sound/soc/codecs/wm8741.c b/trunk/sound/soc/codecs/wm8741.c index 24d8ec53f35b..3941f50bf187 100644 --- a/trunk/sound/soc/codecs/wm8741.c +++ b/trunk/sound/soc/codecs/wm8741.c @@ -85,24 +85,13 @@ SND_SOC_DAPM_OUTPUT("VOUTRP"), SND_SOC_DAPM_OUTPUT("VOUTRN"), }; -static const struct snd_soc_dapm_route intercon[] = { +static const struct snd_soc_dapm_route wm8741_dapm_routes[] = { { "VOUTLP", NULL, "DACL" }, { "VOUTLN", NULL, "DACL" }, { "VOUTRP", NULL, "DACR" }, { "VOUTRN", NULL, "DACR" }, }; -static int wm8741_add_widgets(struct snd_soc_codec *codec) -{ - struct snd_soc_dapm_context *dapm = &codec->dapm; - - snd_soc_dapm_new_controls(dapm, wm8741_dapm_widgets, - ARRAY_SIZE(wm8741_dapm_widgets)); - snd_soc_dapm_add_routes(dapm, intercon, ARRAY_SIZE(intercon)); - - return 0; -} - static struct { int value; int ratio; @@ -456,10 +445,6 @@ static int wm8741_probe(struct snd_soc_codec *codec) snd_soc_update_bits(codec, WM8741_DACRMSB_ATTENUATION, WM8741_UPDATERM, WM8741_UPDATERM); - snd_soc_add_controls(codec, wm8741_snd_controls, - ARRAY_SIZE(wm8741_snd_controls)); - wm8741_add_widgets(codec); - dev_dbg(codec->dev, "Successful registration\n"); return ret; @@ -488,6 +473,13 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8741 = { .reg_cache_size = ARRAY_SIZE(wm8741_reg_defaults), .reg_word_size = sizeof(u16), .reg_cache_default = wm8741_reg_defaults, + + .controls = wm8741_snd_controls, + .num_controls = ARRAY_SIZE(wm8741_snd_controls), + .dapm_widgets = wm8741_dapm_widgets, + .num_dapm_widgets = ARRAY_SIZE(wm8741_dapm_widgets), + .dapm_routes = wm8741_dapm_routes, + .num_dapm_routes = ARRAY_SIZE(wm8741_dapm_routes), }; static const struct of_device_id wm8741_of_match[] = {