diff options
-rw-r--r-- | sound/soc/codecs/twl6040.c | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c index 62edded0b549..93f8a59a086d 100644 --- a/sound/soc/codecs/twl6040.c +++ b/sound/soc/codecs/twl6040.c | |||
@@ -1183,18 +1183,6 @@ static const struct snd_soc_dapm_route intercon[] = { | |||
1183 | {"AUXR", NULL, "AUXR Playback"}, | 1183 | {"AUXR", NULL, "AUXR Playback"}, |
1184 | }; | 1184 | }; |
1185 | 1185 | ||
1186 | static int twl6040_add_widgets(struct snd_soc_codec *codec) | ||
1187 | { | ||
1188 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
1189 | |||
1190 | snd_soc_dapm_new_controls(dapm, twl6040_dapm_widgets, | ||
1191 | ARRAY_SIZE(twl6040_dapm_widgets)); | ||
1192 | snd_soc_dapm_add_routes(dapm, intercon, ARRAY_SIZE(intercon)); | ||
1193 | snd_soc_dapm_new_widgets(dapm); | ||
1194 | |||
1195 | return 0; | ||
1196 | } | ||
1197 | |||
1198 | static int twl6040_set_bias_level(struct snd_soc_codec *codec, | 1186 | static int twl6040_set_bias_level(struct snd_soc_codec *codec, |
1199 | enum snd_soc_bias_level level) | 1187 | enum snd_soc_bias_level level) |
1200 | { | 1188 | { |
@@ -1503,16 +1491,10 @@ static int twl6040_probe(struct snd_soc_codec *codec) | |||
1503 | 1491 | ||
1504 | /* power on device */ | 1492 | /* power on device */ |
1505 | ret = twl6040_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | 1493 | ret = twl6040_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
1506 | if (ret) | 1494 | if (!ret) |
1507 | goto bias_err; | 1495 | return 0; |
1508 | |||
1509 | snd_soc_add_controls(codec, twl6040_snd_controls, | ||
1510 | ARRAY_SIZE(twl6040_snd_controls)); | ||
1511 | twl6040_add_widgets(codec); | ||
1512 | |||
1513 | return 0; | ||
1514 | 1496 | ||
1515 | bias_err: | 1497 | /* Error path */ |
1516 | free_irq(priv->plug_irq, codec); | 1498 | free_irq(priv->plug_irq, codec); |
1517 | plugirq_err: | 1499 | plugirq_err: |
1518 | destroy_workqueue(priv->workqueue); | 1500 | destroy_workqueue(priv->workqueue); |
@@ -1544,6 +1526,13 @@ static struct snd_soc_codec_driver soc_codec_dev_twl6040 = { | |||
1544 | .reg_cache_size = ARRAY_SIZE(twl6040_reg), | 1526 | .reg_cache_size = ARRAY_SIZE(twl6040_reg), |
1545 | .reg_word_size = sizeof(u8), | 1527 | .reg_word_size = sizeof(u8), |
1546 | .reg_cache_default = twl6040_reg, | 1528 | .reg_cache_default = twl6040_reg, |
1529 | |||
1530 | .controls = twl6040_snd_controls, | ||
1531 | .num_controls = ARRAY_SIZE(twl6040_snd_controls), | ||
1532 | .dapm_widgets = twl6040_dapm_widgets, | ||
1533 | .num_dapm_widgets = ARRAY_SIZE(twl6040_dapm_widgets), | ||
1534 | .dapm_routes = intercon, | ||
1535 | .num_dapm_routes = ARRAY_SIZE(intercon), | ||
1547 | }; | 1536 | }; |
1548 | 1537 | ||
1549 | static int __devinit twl6040_codec_probe(struct platform_device *pdev) | 1538 | static int __devinit twl6040_codec_probe(struct platform_device *pdev) |