zombah

wm8903 suspend/resume

Sep 15th, 2012
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. static int tegra_wm8903_suspend_post(struct snd_soc_card *card)
  2. {
  3. struct snd_soc_jack_gpio *gpio = &tegra_wm8903_hp_jack_gpio;
  4.  
  5. if (gpio_is_valid(gpio->gpio))
  6. disable_irq(gpio_to_irq(gpio->gpio));
  7.  
  8. return 0;
  9. }
  10.  
  11. static int tegra_wm8903_resume_pre(struct snd_soc_card *card)
  12. {
  13. int val;
  14. struct snd_soc_jack_gpio *gpio = &tegra_wm8903_hp_jack_gpio;
  15.  
  16. if (gpio_is_valid(gpio->gpio)) {
  17. val = gpio_get_value(gpio->gpio);
  18. val = gpio->invert ? !val : val;
  19. snd_soc_jack_report(gpio->jack, val, gpio->report);
  20. enable_irq(gpio_to_irq(gpio->gpio));
  21. }
  22.  
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment