![Takashi Iwai](/assets/img/avatar_default.png)
[ Upstream commit a829dd5b3840fd9a24608ed73eb21ba239ae5334 ] This patch fixes various trivial coding-style issues in usx2y code, such as: * the assginments in if condition * comparison order with constants * NULL / zero checks * unsigned -> unsigned int * addition of braces in control blocks * debug print with function names * move local variables in block into function head * reduction of too nested indentations No functional changes. Link: https://lore.kernel.org/r/20210517131545.27252-4-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de> Stable-dep-of: dafb28f02be4 ("ALSA: usx2y: Use snd_card_free_when_closed() at disconnection") Signed-off-by: Sasha Levin <sashal@kernel.org>
46 lines
1.1 KiB
C
Executable file
46 lines
1.1 KiB
C
Executable file
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef __USB_STREAM_H
|
|
#define __USB_STREAM_H
|
|
|
|
#include <uapi/sound/usb_stream.h>
|
|
|
|
#define USB_STREAM_NURBS 4
|
|
#define USB_STREAM_URBDEPTH 4
|
|
|
|
struct usb_stream_kernel {
|
|
struct usb_stream *s;
|
|
|
|
void *write_page;
|
|
|
|
unsigned int n_o_ps;
|
|
|
|
struct urb *inurb[USB_STREAM_NURBS];
|
|
struct urb *idle_inurb;
|
|
struct urb *completed_inurb;
|
|
struct urb *outurb[USB_STREAM_NURBS];
|
|
struct urb *idle_outurb;
|
|
struct urb *completed_outurb;
|
|
struct urb *i_urb;
|
|
|
|
int iso_frame_balance;
|
|
|
|
wait_queue_head_t sleep;
|
|
|
|
unsigned int out_phase;
|
|
unsigned int out_phase_peeked;
|
|
unsigned int freqn;
|
|
};
|
|
|
|
struct usb_stream *usb_stream_new(struct usb_stream_kernel *sk,
|
|
struct usb_device *dev,
|
|
unsigned int in_endpoint,
|
|
unsigned int out_endpoint,
|
|
unsigned int sample_rate,
|
|
unsigned int use_packsize,
|
|
unsigned int period_frames,
|
|
unsigned int frame_size);
|
|
void usb_stream_free(struct usb_stream_kernel *sk);
|
|
int usb_stream_start(struct usb_stream_kernel *sk);
|
|
void usb_stream_stop(struct usb_stream_kernel *sk);
|
|
|
|
#endif /* __USB_STREAM_H */
|