aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-09-25 06:36:26 -0400
committerMark Brown <broonie@linaro.org>2013-09-26 05:58:35 -0400
commit752b776435cb35da27a0bbec8deecc33b3461288 (patch)
tree1454692594db04467ab7f8cbb6225e7a0ed72400 /sound/soc
parent4a10c2ac2f368583138b774ca41fac4207911983 (diff)
ASoC: tlv320aic32x4: Move GPIO acquisition to I2C probe
This is more idiomatic and interacts better with deferred probe. Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/codecs/tlv320aic32x4.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c
index 2ed57d4aa445..cf70bf86c344 100644
--- a/sound/soc/codecs/tlv320aic32x4.c
+++ b/sound/soc/codecs/tlv320aic32x4.c
@@ -617,16 +617,11 @@ static int aic32x4_probe(struct snd_soc_codec *codec)
617{ 617{
618 struct aic32x4_priv *aic32x4 = snd_soc_codec_get_drvdata(codec); 618 struct aic32x4_priv *aic32x4 = snd_soc_codec_get_drvdata(codec);
619 u32 tmp_reg; 619 u32 tmp_reg;
620 int ret;
621 620
622 codec->hw_write = (hw_write_t) i2c_master_send; 621 codec->hw_write = (hw_write_t) i2c_master_send;
623 codec->control_data = aic32x4->control_data; 622 codec->control_data = aic32x4->control_data;
624 623
625 if (aic32x4->rstn_gpio >= 0) { 624 if (aic32x4->rstn_gpio >= 0) {
626 ret = devm_gpio_request_one(codec->dev, aic32x4->rstn_gpio,
627 GPIOF_OUT_INIT_LOW, "tlv320aic32x4 rstn");
628 if (ret != 0)
629 return ret;
630 ndelay(10); 625 ndelay(10);
631 gpio_set_value(aic32x4->rstn_gpio, 1); 626 gpio_set_value(aic32x4->rstn_gpio, 1);
632 } 627 }
@@ -735,6 +730,13 @@ static int aic32x4_i2c_probe(struct i2c_client *i2c,
735 aic32x4->rstn_gpio = -1; 730 aic32x4->rstn_gpio = -1;
736 } 731 }
737 732
733 if (aic32x4->rstn_gpio >= 0) {
734 ret = devm_gpio_request_one(&i2c->dev, aic32x4->rstn_gpio,
735 GPIOF_OUT_INIT_LOW, "tlv320aic32x4 rstn");
736 if (ret != 0)
737 return ret;
738 }
739
738 ret = snd_soc_register_codec(&i2c->dev, 740 ret = snd_soc_register_codec(&i2c->dev,
739 &soc_codec_dev_aic32x4, &aic32x4_dai, 1); 741 &soc_codec_dev_aic32x4, &aic32x4_dai, 1);
740 return ret; 742 return ret;