1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */ 2e5779998SDaniel Mack #ifndef __USBAUDIO_ENDPOINT_H 3e5779998SDaniel Mack #define __USBAUDIO_ENDPOINT_H 4e5779998SDaniel Mack 58fdff6a3SDaniel Mack #define SND_USB_ENDPOINT_TYPE_DATA 0 68fdff6a3SDaniel Mack #define SND_USB_ENDPOINT_TYPE_SYNC 1 78fdff6a3SDaniel Mack 8c7474d09STakashi Iwai struct snd_usb_endpoint *snd_usb_get_endpoint(struct snd_usb_audio *chip, 954cb3190STakashi Iwai int ep_num); 10c7474d09STakashi Iwai 1154cb3190STakashi Iwai int snd_usb_add_endpoint(struct snd_usb_audio *chip, int ep_num, int type); 128fdff6a3SDaniel Mack 13bf6313a0STakashi Iwai struct snd_usb_endpoint * 14bf6313a0STakashi Iwai snd_usb_endpoint_open(struct snd_usb_audio *chip, 15cab941b7STakashi Iwai const struct audioformat *fp, 16bf6313a0STakashi Iwai const struct snd_pcm_hw_params *params, 17bf6313a0STakashi Iwai bool is_sync_ep); 18bf6313a0STakashi Iwai void snd_usb_endpoint_close(struct snd_usb_audio *chip, 19bf6313a0STakashi Iwai struct snd_usb_endpoint *ep); 20bf6313a0STakashi Iwai int snd_usb_endpoint_configure(struct snd_usb_audio *chip, 21bf6313a0STakashi Iwai struct snd_usb_endpoint *ep); 22bf6313a0STakashi Iwai void snd_usb_endpoint_suspend(struct snd_usb_endpoint *ep); 238fdff6a3SDaniel Mack 24bf6313a0STakashi Iwai bool snd_usb_endpoint_compatible(struct snd_usb_audio *chip, 25bf6313a0STakashi Iwai struct snd_usb_endpoint *ep, 26bf6313a0STakashi Iwai const struct audioformat *fp, 27bf6313a0STakashi Iwai const struct snd_pcm_hw_params *params); 28bf6313a0STakashi Iwai 29bf6313a0STakashi Iwai void snd_usb_endpoint_set_sync(struct snd_usb_audio *chip, 30bf6313a0STakashi Iwai struct snd_usb_endpoint *data_ep, 31bf6313a0STakashi Iwai struct snd_usb_endpoint *sync_ep); 3296e221f3STakashi Iwai void snd_usb_endpoint_set_callback(struct snd_usb_endpoint *ep, 3396e221f3STakashi Iwai void (*prepare)(struct snd_usb_substream *subs, 3496e221f3STakashi Iwai struct urb *urb), 3596e221f3STakashi Iwai void (*retire)(struct snd_usb_substream *subs, 3696e221f3STakashi Iwai struct urb *urb), 3796e221f3STakashi Iwai struct snd_usb_substream *data_subs); 3896e221f3STakashi Iwai 391d0f9530SIoan-Adrian Ratiu int snd_usb_endpoint_start(struct snd_usb_endpoint *ep); 40b2eb950dSTakashi Iwai void snd_usb_endpoint_stop(struct snd_usb_endpoint *ep); 41f58161baSTakashi Iwai void snd_usb_endpoint_sync_pending_stop(struct snd_usb_endpoint *ep); 42bf6313a0STakashi Iwai void snd_usb_endpoint_suspend(struct snd_usb_endpoint *ep); 438fdff6a3SDaniel Mack int snd_usb_endpoint_activate(struct snd_usb_endpoint *ep); 4492a586bdSTakashi Iwai void snd_usb_endpoint_release(struct snd_usb_endpoint *ep); 45a6cece9dSTakashi Iwai void snd_usb_endpoint_free(struct snd_usb_endpoint *ep); 468fdff6a3SDaniel Mack 4798ae472bSEldad Zack int snd_usb_endpoint_implicit_feedback_sink(struct snd_usb_endpoint *ep); 48*3d58760fSTakashi Iwai int snd_usb_endpoint_next_packet_size(struct snd_usb_endpoint *ep, 49*3d58760fSTakashi Iwai struct snd_urb_ctx *ctx, int idx); 508fdff6a3SDaniel Mack 51e5779998SDaniel Mack #endif /* __USBAUDIO_ENDPOINT_H */ 52