aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/adau1701.c32
1 files changed, 12 insertions, 20 deletions
diff --git a/sound/soc/codecs/adau1701.c b/sound/soc/codecs/adau1701.c
index b6b1a773bd37..997fc3b881fe 100644
--- a/sound/soc/codecs/adau1701.c
+++ b/sound/soc/codecs/adau1701.c
@@ -184,27 +184,20 @@ static unsigned int adau1701_read(struct snd_soc_codec *codec, unsigned int reg)
184 return value; 184 return value;
185} 185}
186 186
187static void adau1701_reset(struct snd_soc_codec *codec) 187static int adau1701_reset(struct snd_soc_codec *codec)
188{ 188{
189 struct adau1701 *adau1701 = snd_soc_codec_get_drvdata(codec); 189 struct adau1701 *adau1701 = snd_soc_codec_get_drvdata(codec);
190
191 if (!gpio_is_valid(adau1701->gpio_nreset))
192 return;
193
194 gpio_set_value(adau1701->gpio_nreset, 0);
195 /* minimum reset time is 20ns */
196 udelay(1);
197 gpio_set_value(adau1701->gpio_nreset, 1);
198 /* power-up time may be as long as 85ms */
199 mdelay(85);
200}
201
202static int adau1701_init(struct snd_soc_codec *codec)
203{
204 int ret;
205 struct i2c_client *client = to_i2c_client(codec->dev); 190 struct i2c_client *client = to_i2c_client(codec->dev);
191 int ret;
206 192
207 adau1701_reset(codec); 193 if (gpio_is_valid(adau1701->gpio_nreset)) {
194 gpio_set_value(adau1701->gpio_nreset, 0);
195 /* minimum reset time is 20ns */
196 udelay(1);
197 gpio_set_value(adau1701->gpio_nreset, 1);
198 /* power-up time may be as long as 85ms */
199 mdelay(85);
200 }
208 201
209 ret = process_sigma_firmware(client, ADAU1701_FIRMWARE); 202 ret = process_sigma_firmware(client, ADAU1701_FIRMWARE);
210 if (ret) { 203 if (ret) {
@@ -213,6 +206,7 @@ static int adau1701_init(struct snd_soc_codec *codec)
213 } 206 }
214 207
215 snd_soc_write(codec, ADAU1701_DACSET, ADAU1701_DACSET_DACINIT); 208 snd_soc_write(codec, ADAU1701_DACSET, ADAU1701_DACSET_DACINIT);
209 snd_soc_write(codec, ADAU1701_DSPCTRL, ADAU1701_DSPCTRL_CR);
216 210
217 return 0; 211 return 0;
218} 212}
@@ -498,12 +492,10 @@ static int adau1701_probe(struct snd_soc_codec *codec)
498 492
499 codec->control_data = to_i2c_client(codec->dev); 493 codec->control_data = to_i2c_client(codec->dev);
500 494
501 ret = adau1701_init(codec); 495 ret = adau1701_reset(codec);
502 if (ret) 496 if (ret)
503 return ret; 497 return ret;
504 498
505 snd_soc_write(codec, ADAU1701_DSPCTRL, ADAU1701_DSPCTRL_CR);
506
507 return 0; 499 return 0;
508} 500}
509 501