Loading...
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __USBAUDIO_ENDPOINT_H
3#define __USBAUDIO_ENDPOINT_H
4
5#define SND_USB_ENDPOINT_TYPE_DATA 0
6#define SND_USB_ENDPOINT_TYPE_SYNC 1
7
8struct snd_usb_endpoint *snd_usb_add_endpoint(struct snd_usb_audio *chip,
9 struct usb_host_interface *alts,
10 int ep_num, int direction, int type);
11
12int snd_usb_endpoint_set_params(struct snd_usb_endpoint *ep,
13 snd_pcm_format_t pcm_format,
14 unsigned int channels,
15 unsigned int period_bytes,
16 unsigned int period_frames,
17 unsigned int buffer_periods,
18 unsigned int rate,
19 struct audioformat *fmt,
20 struct snd_usb_endpoint *sync_ep);
21
22int snd_usb_endpoint_start(struct snd_usb_endpoint *ep);
23void snd_usb_endpoint_stop(struct snd_usb_endpoint *ep);
24void snd_usb_endpoint_sync_pending_stop(struct snd_usb_endpoint *ep);
25int snd_usb_endpoint_activate(struct snd_usb_endpoint *ep);
26void snd_usb_endpoint_deactivate(struct snd_usb_endpoint *ep);
27void snd_usb_endpoint_release(struct snd_usb_endpoint *ep);
28void snd_usb_endpoint_free(struct snd_usb_endpoint *ep);
29
30int snd_usb_endpoint_implicit_feedback_sink(struct snd_usb_endpoint *ep);
31int snd_usb_endpoint_slave_next_packet_size(struct snd_usb_endpoint *ep);
32int snd_usb_endpoint_next_packet_size(struct snd_usb_endpoint *ep);
33
34void snd_usb_handle_sync_urb(struct snd_usb_endpoint *ep,
35 struct snd_usb_endpoint *sender,
36 const struct urb *urb);
37
38#endif /* __USBAUDIO_ENDPOINT_H */
1#ifndef __USBAUDIO_ENDPOINT_H
2#define __USBAUDIO_ENDPOINT_H
3
4#define SND_USB_ENDPOINT_TYPE_DATA 0
5#define SND_USB_ENDPOINT_TYPE_SYNC 1
6
7struct snd_usb_endpoint *snd_usb_add_endpoint(struct snd_usb_audio *chip,
8 struct usb_host_interface *alts,
9 int ep_num, int direction, int type);
10
11int snd_usb_endpoint_set_params(struct snd_usb_endpoint *ep,
12 snd_pcm_format_t pcm_format,
13 unsigned int channels,
14 unsigned int period_bytes,
15 unsigned int period_frames,
16 unsigned int buffer_periods,
17 unsigned int rate,
18 struct audioformat *fmt,
19 struct snd_usb_endpoint *sync_ep);
20
21int snd_usb_endpoint_start(struct snd_usb_endpoint *ep, bool can_sleep);
22void snd_usb_endpoint_stop(struct snd_usb_endpoint *ep);
23void snd_usb_endpoint_sync_pending_stop(struct snd_usb_endpoint *ep);
24int snd_usb_endpoint_activate(struct snd_usb_endpoint *ep);
25void snd_usb_endpoint_deactivate(struct snd_usb_endpoint *ep);
26void snd_usb_endpoint_release(struct snd_usb_endpoint *ep);
27void snd_usb_endpoint_free(struct snd_usb_endpoint *ep);
28
29int snd_usb_endpoint_implicit_feedback_sink(struct snd_usb_endpoint *ep);
30int snd_usb_endpoint_next_packet_size(struct snd_usb_endpoint *ep);
31
32void snd_usb_handle_sync_urb(struct snd_usb_endpoint *ep,
33 struct snd_usb_endpoint *sender,
34 const struct urb *urb);
35
36#endif /* __USBAUDIO_ENDPOINT_H */