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