power.h 924 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __USBAUDIO_POWER_H
  3. #define __USBAUDIO_POWER_H
  4. struct snd_usb_power_domain {
  5. int pd_id; /* UAC3 Power Domain ID */
  6. int pd_d1d0_rec; /* D1 to D0 recovery time */
  7. int pd_d2d0_rec; /* D2 to D0 recovery time */
  8. };
  9. enum {
  10. UAC3_PD_STATE_D0,
  11. UAC3_PD_STATE_D1,
  12. UAC3_PD_STATE_D2,
  13. };
  14. int snd_usb_power_domain_set(struct snd_usb_audio *chip,
  15. struct snd_usb_power_domain *pd,
  16. unsigned char state);
  17. struct snd_usb_power_domain *
  18. snd_usb_find_power_domain(struct usb_host_interface *ctrl_iface,
  19. unsigned char id);
  20. #ifdef CONFIG_PM
  21. int snd_usb_autoresume(struct snd_usb_audio *chip);
  22. void snd_usb_autosuspend(struct snd_usb_audio *chip);
  23. #else
  24. static inline int snd_usb_autoresume(struct snd_usb_audio *chip)
  25. {
  26. return 0;
  27. }
  28. static inline void snd_usb_autosuspend(struct snd_usb_audio *chip)
  29. {
  30. }
  31. #endif
  32. #endif /* __USBAUDIO_POWER_H */