blob: 63a39d4fa8d8ec425ce934c5693a2003bd8d0dee [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Daniel Macke5779992010-03-04 19:46:13 +01002#ifndef __USBAUDIO_ENDPOINT_H
3#define __USBAUDIO_ENDPOINT_H
4
Daniel Mack8fdff6a2012-04-12 13:51:11 +02005#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,
Dylan Reid35ec7aa22012-09-18 09:49:47 -070013 snd_pcm_format_t pcm_format,
14 unsigned int channels,
15 unsigned int period_bytes,
Alan Stern976b6c02013-09-24 15:51:58 -040016 unsigned int period_frames,
17 unsigned int buffer_periods,
Dylan Reid35ec7aa22012-09-18 09:49:47 -070018 unsigned int rate,
Daniel Mack8fdff6a2012-04-12 13:51:11 +020019 struct audioformat *fmt,
20 struct snd_usb_endpoint *sync_ep);
21
Ioan-Adrian Ratiu1d0f9532017-01-05 00:37:46 +020022int snd_usb_endpoint_start(struct snd_usb_endpoint *ep);
Takashi Iwaib2eb9502012-11-21 08:30:48 +010023void snd_usb_endpoint_stop(struct snd_usb_endpoint *ep);
Takashi Iwaif58161b2012-11-08 08:52:45 +010024void snd_usb_endpoint_sync_pending_stop(struct snd_usb_endpoint *ep);
Daniel Mack8fdff6a2012-04-12 13:51:11 +020025int snd_usb_endpoint_activate(struct snd_usb_endpoint *ep);
Eldad Zack9b7c5522013-10-06 22:31:10 +020026void snd_usb_endpoint_deactivate(struct snd_usb_endpoint *ep);
Takashi Iwai92a586b2014-06-25 14:24:47 +020027void snd_usb_endpoint_release(struct snd_usb_endpoint *ep);
Takashi Iwaia6cece92014-10-31 11:24:32 +010028void snd_usb_endpoint_free(struct snd_usb_endpoint *ep);
Daniel Mack8fdff6a2012-04-12 13:51:11 +020029
Eldad Zack98ae4722013-04-03 23:18:52 +020030int snd_usb_endpoint_implicit_feedback_sink(struct snd_usb_endpoint *ep);
Daniel Mack245baf92012-08-30 18:52:30 +020031int snd_usb_endpoint_next_packet_size(struct snd_usb_endpoint *ep);
Daniel Mack8fdff6a2012-04-12 13:51:11 +020032
33void snd_usb_handle_sync_urb(struct snd_usb_endpoint *ep,
34 struct snd_usb_endpoint *sender,
35 const struct urb *urb);
36
Daniel Macke5779992010-03-04 19:46:13 +010037#endif /* __USBAUDIO_ENDPOINT_H */