merge of '178eac00dc5aa8338d42e8e203633bec7817bbf6'
[vuplus_openembedded] / packages / linux / linux-rp-2.6.24 / tosa / 0053-sound-soc-codecs-wm9712.c-28.patch
1 From 47616d22f8f303dfd66cf3b9125af212194a0f3c Mon Sep 17 00:00:00 2001
2 From: Dmitry Baryshkov <dbaryshkov@gmail.com>
3 Date: Wed, 9 Jan 2008 02:08:17 +0300
4 Subject: [PATCH 53/64]  sound/soc/codecs/wm9712.c |   28 ++++++++++++++++++----------
5   1 file changed, 18 insertions(+), 10 deletions(-)
6
7 Index: git/sound/soc/codecs/wm9712.c
8 ===================================================================
9 ---
10  sound/soc/codecs/wm9712.c |   28 ++++++++++++++++++----------
11  1 files changed, 18 insertions(+), 10 deletions(-)
12
13 diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c
14 index 986b5d5..dfb31e1 100644
15 --- a/sound/soc/codecs/wm9712.c
16 +++ b/sound/soc/codecs/wm9712.c
17 @@ -606,18 +606,26 @@ static int wm9712_dapm_event(struct snd_soc_codec *codec, int event)
18  
19  static int wm9712_reset(struct snd_soc_codec *codec, int try_warm)
20  {
21 -       if (try_warm && soc_ac97_ops.warm_reset) {
22 -               soc_ac97_ops.warm_reset(codec->ac97);
23 -               if (!(ac97_read(codec, 0) & 0x8000))
24 -                       return 1;
25 -       }
26 +       int retry = 3;
27  
28 -       soc_ac97_ops.reset(codec->ac97);
29 -       if (ac97_read(codec, 0) & 0x8000)
30 -               goto err;
31 -       return 0;
32 +       while (retry--)
33 +       {
34 +               if(try_warm && soc_ac97_ops.warm_reset) {
35 +                       soc_ac97_ops.warm_reset(codec->ac97);
36 +                       if(ac97_read(codec, 0) & 0x8000)
37 +                               continue;
38 +                       else
39 +                               return 1;
40 +               }
41 +
42 +               soc_ac97_ops.reset(codec->ac97);
43 +               if(ac97_read(codec, 0) & 0x8000)
44 +                       continue;
45 +               else
46 +                       return 0;
47 +
48 +       }
49  
50 -err:
51         printk(KERN_ERR "WM9712 AC97 reset failed\n");
52         return -EIO;
53  }
54 -- 
55 1.5.3.8
56