1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
sound/soc/codecs/wm9712.c | 28 ++++++++++++++++++----------
1 file changed, 18 insertions(+), 10 deletions(-)
Index: git/sound/soc/codecs/wm9712.c
===================================================================
--- git.orig/sound/soc/codecs/wm9712.c 2006-11-07 22:10:01.000000000 +0000
+++ git/sound/soc/codecs/wm9712.c 2006-11-07 22:11:50.000000000 +0000
@@ -618,18 +618,26 @@ static int wm9712_dapm_event(struct snd_
static int wm9712_reset(struct snd_soc_codec *codec, int try_warm)
{
- if (try_warm && soc_ac97_ops.warm_reset) {
- soc_ac97_ops.warm_reset(codec->ac97);
- if (!(ac97_read(codec, 0) & 0x8000))
- return 1;
- }
+ int retry = 3;
- soc_ac97_ops.reset(codec->ac97);
- if (ac97_read(codec, 0) & 0x8000)
- goto err;
- return 0;
+ while (retry--)
+ {
+ if(try_warm && soc_ac97_ops.warm_reset) {
+ soc_ac97_ops.warm_reset(codec->ac97);
+ if(ac97_read(codec, 0) & 0x8000)
+ continue;
+ else
+ return 1;
+ }
+
+ soc_ac97_ops.reset(codec->ac97);
+ if(ac97_read(codec, 0) & 0x8000)
+ continue;
+ else
+ return 0;
+
+ }
-err:
printk(KERN_ERR "WM9712 AC97 reset failed\n");
return -EIO;
}
sound/soc/codecs/wm9712.c | 28 ++++++++++++++++++----------
1 file changed, 18 insertions(+), 10 deletions(-)
Index: git/sound/soc/codecs/wm9712.c
===================================================================
--- git.orig/sound/soc/codecs/wm9712.c 2006-11-07 22:10:01.000000000 +0000
+++ git/sound/soc/codecs/wm9712.c 2006-11-07 22:11:50.000000000 +0000
@@ -618,18 +618,26 @@ static int wm9712_dapm_event(struct snd_
static int wm9712_reset(struct snd_soc_codec *codec, int try_warm)
{
- if (try_warm && soc_ac97_ops.warm_reset) {
- soc_ac97_ops.warm_reset(codec->ac97);
- if (!(ac97_read(codec, 0) & 0x8000))
- return 1;
- }
+ int retry = 3;
- soc_ac97_ops.reset(codec->ac97);
- if (ac97_read(codec, 0) & 0x8000)
- goto err;
- return 0;
+ while (retry--)
+ {
+ if(try_warm && soc_ac97_ops.warm_reset) {
+ soc_ac97_ops.warm_reset(codec->ac97);
+ if(ac97_read(codec, 0) & 0x8000)
+ continue;
+ else
+ return 1;
+ }
+
+ soc_ac97_ops.reset(codec->ac97);
+ if(ac97_read(codec, 0) & 0x8000)
+ continue;
+ else
+ return 0;
+
+ }
-err:
printk(KERN_ERR "WM9712 AC97 reset failed\n");
return -EIO;
}
|