Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef __USB_STREAM_H
0003 #define __USB_STREAM_H
0004 
0005 #include <uapi/sound/usb_stream.h>
0006 
0007 #define USB_STREAM_NURBS 4
0008 #define USB_STREAM_URBDEPTH 4
0009 
0010 struct usb_stream_kernel {
0011     struct usb_stream *s;
0012 
0013     void *write_page;
0014 
0015     unsigned int n_o_ps;
0016 
0017     struct urb *inurb[USB_STREAM_NURBS];
0018     struct urb *idle_inurb;
0019     struct urb *completed_inurb;
0020     struct urb *outurb[USB_STREAM_NURBS];
0021     struct urb *idle_outurb;
0022     struct urb *completed_outurb;
0023     struct urb *i_urb;
0024 
0025     int iso_frame_balance;
0026 
0027     wait_queue_head_t sleep;
0028 
0029     unsigned int out_phase;
0030     unsigned int out_phase_peeked;
0031     unsigned int freqn;
0032 };
0033 
0034 struct usb_stream *usb_stream_new(struct usb_stream_kernel *sk,
0035                   struct usb_device *dev,
0036                   unsigned int in_endpoint,
0037                   unsigned int out_endpoint,
0038                   unsigned int sample_rate,
0039                   unsigned int use_packsize,
0040                   unsigned int period_frames,
0041                   unsigned int frame_size);
0042 void usb_stream_free(struct usb_stream_kernel *sk);
0043 int usb_stream_start(struct usb_stream_kernel *sk);
0044 void usb_stream_stop(struct usb_stream_kernel *sk);
0045 
0046 #endif /* __USB_STREAM_H */