usb_stream.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __USB_STREAM_H
  3. #define __USB_STREAM_H
  4. #include <uapi/sound/usb_stream.h>
  5. #define USB_STREAM_NURBS 4
  6. #define USB_STREAM_URBDEPTH 4
  7. struct usb_stream_kernel {
  8. struct usb_stream *s;
  9. void *write_page;
  10. unsigned int n_o_ps;
  11. struct urb *inurb[USB_STREAM_NURBS];
  12. struct urb *idle_inurb;
  13. struct urb *completed_inurb;
  14. struct urb *outurb[USB_STREAM_NURBS];
  15. struct urb *idle_outurb;
  16. struct urb *completed_outurb;
  17. struct urb *i_urb;
  18. int iso_frame_balance;
  19. wait_queue_head_t sleep;
  20. unsigned int out_phase;
  21. unsigned int out_phase_peeked;
  22. unsigned int freqn;
  23. };
  24. struct usb_stream *usb_stream_new(struct usb_stream_kernel *sk,
  25. struct usb_device *dev,
  26. unsigned int in_endpoint,
  27. unsigned int out_endpoint,
  28. unsigned int sample_rate,
  29. unsigned int use_packsize,
  30. unsigned int period_frames,
  31. unsigned int frame_size);
  32. void usb_stream_free(struct usb_stream_kernel *sk);
  33. int usb_stream_start(struct usb_stream_kernel *sk);
  34. void usb_stream_stop(struct usb_stream_kernel *sk);
  35. #endif /* __USB_STREAM_H */