Guest User

Untitled

a guest
Oct 12th, 2011
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. diff --git a/sound/soc/codecs/alc5632.c b/sound/soc/codecs/alc5632.c
  2. index 2c2b9a2..491ac8d 100644
  3. --- a/sound/soc/codecs/alc5632.c
  4. +++ b/sound/soc/codecs/alc5632.c
  5. @@ -50,8 +50,7 @@ static void alc5632_fill_cache(struct snd_soc_codec *codec)
  6.  
  7. static inline int alc5632_reset(struct snd_soc_codec *codec)
  8. {
  9. - snd_soc_write(codec, ALC5632_RESET, 0);
  10. - return snd_soc_read(codec, ALC5632_RESET);
  11. + return snd_soc_write(codec, ALC5632_RESET, 0);
  12. }
  13.  
  14. static int amp_mixer_event(struct snd_soc_dapm_widget *w,
  15. @@ -876,7 +875,18 @@ static struct snd_soc_dai_driver alc5632_dai = {
  16.  
  17. static int alc5632_suspend(struct snd_soc_codec *codec, pm_message_t mesg)
  18. {
  19. - alc5632_set_bias_level(codec, SND_SOC_BIAS_OFF);
  20. + int i, step = codec->driver->reg_cache_step;
  21. + u16 *cache = codec->reg_cache;
  22. +
  23. + for (i = 2 ; i < codec->driver->reg_cache_size ; i += step)
  24. + cache[i] = codec->hw_read(codec, i);
  25. +
  26. +printk("%s\n", "Its our reg_cache");
  27. + for (i = 2 ; i < codec->driver->reg_cache_size ; i += step)
  28. + printk("%d\n", cache[i]);
  29. +printk("%s\n", "End");
  30. +
  31. + alc5632_set_bias_level(codec, SND_SOC_BIAS_OFF);
  32. return 0;
  33. }
  34.  
  35. @@ -885,6 +895,10 @@ static int alc5632_resume(struct snd_soc_codec *codec)
  36. int i, step = codec->driver->reg_cache_step;
  37. u16 *cache = codec->reg_cache;
  38.  
  39. + for (i = 2 ; i < codec->driver->reg_cache_size ; i += step)
  40. + printk("%d\n", cache[i]);
  41. +
  42. +
  43. /* Sync reg_cache with the hardware */
  44. for (i = 2 ; i < codec->driver->reg_cache_size ; i += step)
  45. snd_soc_write(codec, i, cache[i]);
  46. @@ -897,7 +911,13 @@ static int alc5632_resume(struct snd_soc_codec *codec)
  47. codec->dapm.bias_level = SND_SOC_BIAS_ON;
  48. alc5632_set_bias_level(codec, codec->dapm.bias_level);
  49. }
  50. +for (i = 2 ; i < codec->driver->reg_cache_size ; i += step)
  51. + cache[i] = codec->hw_read(codec, i);
  52.  
  53. +printk("%s\n", "Its our reg_cache after suspend");
  54. +for (i = 2 ; i < codec->driver->reg_cache_size ; i += step)
  55. + printk("%d\n", cache[i]);
  56. +printk("%s\n", "End");
  57. return 0;
  58. }
  59.  
  60.  
Advertisement
Add Comment
Please, Sign In to add comment