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