diff options
author | Mark Brown <broonie@linaro.org> | 2013-11-28 12:27:02 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-12-02 06:53:28 -0500 |
commit | a8ca52b7911378864e6defb42be9166c248a3749 (patch) | |
tree | bf6a8fd36ea25e13ec8b43c1a739636888410e2a | |
parent | b34d7cf355116f5107fad8d42fb91d067a3b15bc (diff) |
ASoC: ak4642: Convert to table based control init
Improves error handling and saves code.
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | sound/soc/codecs/ak4642.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sound/soc/codecs/ak4642.c b/sound/soc/codecs/ak4642.c index 2f861c9b1d69..7fe1e9030c4f 100644 --- a/sound/soc/codecs/ak4642.c +++ b/sound/soc/codecs/ak4642.c | |||
@@ -469,9 +469,6 @@ static int ak4642_probe(struct snd_soc_codec *codec) | |||
469 | return ret; | 469 | return ret; |
470 | } | 470 | } |
471 | 471 | ||
472 | snd_soc_add_codec_controls(codec, ak4642_snd_controls, | ||
473 | ARRAY_SIZE(ak4642_snd_controls)); | ||
474 | |||
475 | ak4642_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | 472 | ak4642_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
476 | 473 | ||
477 | return 0; | 474 | return 0; |
@@ -491,6 +488,8 @@ static struct snd_soc_codec_driver soc_codec_dev_ak4642 = { | |||
491 | .reg_cache_default = ak4642_reg, /* ak4642 reg */ | 488 | .reg_cache_default = ak4642_reg, /* ak4642 reg */ |
492 | .reg_cache_size = ARRAY_SIZE(ak4642_reg), /* ak4642 reg */ | 489 | .reg_cache_size = ARRAY_SIZE(ak4642_reg), /* ak4642 reg */ |
493 | .reg_word_size = sizeof(u8), | 490 | .reg_word_size = sizeof(u8), |
491 | .controls = ak4642_snd_controls, | ||
492 | .num_controls = ARRAY_SIZE(ak4642_snd_controls), | ||
494 | .dapm_widgets = ak4642_dapm_widgets, | 493 | .dapm_widgets = ak4642_dapm_widgets, |
495 | .num_dapm_widgets = ARRAY_SIZE(ak4642_dapm_widgets), | 494 | .num_dapm_widgets = ARRAY_SIZE(ak4642_dapm_widgets), |
496 | .dapm_routes = ak4642_intercon, | 495 | .dapm_routes = ak4642_intercon, |
@@ -505,6 +504,8 @@ static struct snd_soc_codec_driver soc_codec_dev_ak4648 = { | |||
505 | .reg_cache_default = ak4648_reg, /* ak4648 reg */ | 504 | .reg_cache_default = ak4648_reg, /* ak4648 reg */ |
506 | .reg_cache_size = ARRAY_SIZE(ak4648_reg), /* ak4648 reg */ | 505 | .reg_cache_size = ARRAY_SIZE(ak4648_reg), /* ak4648 reg */ |
507 | .reg_word_size = sizeof(u8), | 506 | .reg_word_size = sizeof(u8), |
507 | .controls = ak4642_snd_controls, | ||
508 | .num_controls = ARRAY_SIZE(ak4642_snd_controls), | ||
508 | .dapm_widgets = ak4642_dapm_widgets, | 509 | .dapm_widgets = ak4642_dapm_widgets, |
509 | .num_dapm_widgets = ARRAY_SIZE(ak4642_dapm_widgets), | 510 | .num_dapm_widgets = ARRAY_SIZE(ak4642_dapm_widgets), |
510 | .dapm_routes = ak4642_intercon, | 511 | .dapm_routes = ak4642_intercon, |