aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-12-09 10:22:34 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-12-09 10:22:34 -0500
commite00457d2e093fef1f0688e32948d7823e9d8e38a (patch)
tree174fa15bd2d099207c6cb73c796ad4a12e34f027
parent6d8ffb7f397d1f69019cbbc6f64e5fb563af0807 (diff)
parentad2c175b8d625188766e4cecf8911cda208e4931 (diff)
Merge remote-tracking branch 'asoc/topic/wm8978' into asoc-next
-rw-r--r--sound/soc/codecs/wm8978.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/sound/soc/codecs/wm8978.c b/sound/soc/codecs/wm8978.c
index 4c0a8e496131..ef467001c3d5 100644
--- a/sound/soc/codecs/wm8978.c
+++ b/sound/soc/codecs/wm8978.c
@@ -527,9 +527,6 @@ static int wm8978_configure_pll(struct snd_soc_codec *codec)
527 return idx; 527 return idx;
528 528
529 wm8978->mclk_idx = idx; 529 wm8978->mclk_idx = idx;
530
531 /* GPIO1 into default mode as input - before configuring PLL */
532 snd_soc_update_bits(codec, WM8978_GPIO_CONTROL, 7, 0);
533 } else { 530 } else {
534 return -EINVAL; 531 return -EINVAL;
535 } 532 }
@@ -1049,7 +1046,7 @@ static __devinit int wm8978_i2c_probe(struct i2c_client *i2c,
1049 if (wm8978 == NULL) 1046 if (wm8978 == NULL)
1050 return -ENOMEM; 1047 return -ENOMEM;
1051 1048
1052 wm8978->regmap = regmap_init_i2c(i2c, &wm8978_regmap_config); 1049 wm8978->regmap = devm_regmap_init_i2c(i2c, &wm8978_regmap_config);
1053 if (IS_ERR(wm8978->regmap)) { 1050 if (IS_ERR(wm8978->regmap)) {
1054 ret = PTR_ERR(wm8978->regmap); 1051 ret = PTR_ERR(wm8978->regmap);
1055 dev_err(&i2c->dev, "Failed to allocate regmap: %d\n", ret); 1052 dev_err(&i2c->dev, "Failed to allocate regmap: %d\n", ret);
@@ -1062,29 +1059,22 @@ static __devinit int wm8978_i2c_probe(struct i2c_client *i2c,
1062 ret = regmap_write(wm8978->regmap, WM8978_RESET, 0); 1059 ret = regmap_write(wm8978->regmap, WM8978_RESET, 0);
1063 if (ret != 0) { 1060 if (ret != 0) {
1064 dev_err(&i2c->dev, "Failed to issue reset: %d\n", ret); 1061 dev_err(&i2c->dev, "Failed to issue reset: %d\n", ret);
1065 goto err; 1062 return ret;
1066 } 1063 }
1067 1064
1068 ret = snd_soc_register_codec(&i2c->dev, 1065 ret = snd_soc_register_codec(&i2c->dev,
1069 &soc_codec_dev_wm8978, &wm8978_dai, 1); 1066 &soc_codec_dev_wm8978, &wm8978_dai, 1);
1070 if (ret != 0) { 1067 if (ret != 0) {
1071 dev_err(&i2c->dev, "Failed to register CODEC: %d\n", ret); 1068 dev_err(&i2c->dev, "Failed to register CODEC: %d\n", ret);
1072 goto err; 1069 return ret;
1073 } 1070 }
1074 1071
1075 return 0; 1072 return 0;
1076
1077err:
1078 regmap_exit(wm8978->regmap);
1079 return ret;
1080} 1073}
1081 1074
1082static __devexit int wm8978_i2c_remove(struct i2c_client *client) 1075static __devexit int wm8978_i2c_remove(struct i2c_client *client)
1083{ 1076{
1084 struct wm8978_priv *wm8978 = i2c_get_clientdata(client);
1085
1086 snd_soc_unregister_codec(&client->dev); 1077 snd_soc_unregister_codec(&client->dev);
1087 regmap_exit(wm8978->regmap);
1088 1078
1089 return 0; 1079 return 0;
1090} 1080}