aboutsummaryrefslogtreecommitdiff
path: root/sound/soc
diff options
context:
space:
mode:
authorAndy Green <agreen@octopus.localdomain>2009-02-15 12:31:05 +0000
committerAndy Green <agreen@octopus.localdomain>2009-02-15 12:31:05 +0000
commit965b2932ee976c06d673abc1e800c4652fb6b422 (patch)
treebf76c31fbaeeb74136044600cadd0cccff8ea217 /sound/soc
parent4e9be3539e402cb2b9aa9caf5050756916b9345e (diff)
Add checks to see if wmXXXX_reset() failed and notify
the user of the problem. This is generally due to a problem on the i2c bus such as an un-powered or non-connected codec. Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/codecs/wm8731.c6
-rw-r--r--sound/soc/codecs/wm8753.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c
index c444b9f2701..efbd4449bd3 100644
--- a/sound/soc/codecs/wm8731.c
+++ b/sound/soc/codecs/wm8731.c
@@ -521,7 +521,11 @@ static int wm8731_init(struct snd_soc_device *socdev)
if (codec->reg_cache == NULL)
return -ENOMEM;
- wm8731_reset(codec);
+ ret = wm8731_reset(codec);
+ if (ret < 0) {
+ printk(KERN_ERR "wm8731: failed to send reset\n");
+ return -EIO;
+ }
/* register pcms */
ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1);
diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c
index 9ff02cab788..3a1b0013d7c 100644
--- a/sound/soc/codecs/wm8753.c
+++ b/sound/soc/codecs/wm8753.c
@@ -1574,7 +1574,11 @@ static int wm8753_init(struct snd_soc_device *socdev)
wm8753_set_dai_mode(codec, 0);
- wm8753_reset(codec);
+ ret = wm8753_reset(codec);
+ if (ret < 0) {
+ printk(KERN_ERR "wm8753: failed reset, not present?\n");
+ return -EIO;
+ }
/* register pcms */
ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1);