linux/sound/usb/misc/ua101.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Edirol UA-101/UA-1000 driver
 * Copyright (c) Clemens Ladisch <[email protected]>
 */

#include <linux/init.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/usb.h>
#include <linux/usb/audio.h>
#include <sound/core.h>
#include <sound/initval.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include "../usbaudio.h"
#include "../midi.h"

MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_LICENSE();

/*
 * Should not be lower than the minimum scheduling delay of the host
 * controller.  Some Intel controllers need more than one frame; as long as
 * that driver doesn't tell us about this, use 1.5 frames just to be sure.
 */
#define MIN_QUEUE_LENGTH
/* Somewhat random. */
#define MAX_QUEUE_LENGTH
/*
 * This magic value optimizes memory usage efficiency for the UA-101's packet
 * sizes at all sample rates, taking into account the stupid cache pool sizes
 * that usb_alloc_coherent() uses.
 */
#define DEFAULT_QUEUE_LENGTH

#define MAX_PACKET_SIZE
#define MAX_MEMORY_BUFFERS

static int index[SNDRV_CARDS] =;
static char *id[SNDRV_CARDS] =;
static bool enable[SNDRV_CARDS] =;
static unsigned int queue_length =;

module_param_array();
MODULE_PARM_DESC();
module_param_array();
MODULE_PARM_DESC();
module_param_array();
MODULE_PARM_DESC();
module_param(queue_length, uint, 0644);
MODULE_PARM_DESC();

enum {};

/* bits in struct ua101::states */
enum {};

struct ua101 {};

static DEFINE_MUTEX(devices_mutex);
static unsigned int devices_used;
static struct usb_driver ua101_driver;

static void abort_alsa_playback(struct ua101 *ua);
static void abort_alsa_capture(struct ua101 *ua);

static const char *usb_error_string(int err)
{}

static void abort_usb_capture(struct ua101 *ua)
{}

static void abort_usb_playback(struct ua101 *ua)
{}

static void playback_urb_complete(struct urb *usb_urb)
{}

static void first_playback_urb_complete(struct urb *urb)
{}

/* copy data from the ALSA ring buffer into the URB buffer */
static bool copy_playback_data(struct ua101_stream *stream, struct urb *urb,
			       unsigned int frames)
{}

static inline void add_with_wraparound(struct ua101 *ua,
				       unsigned int *value, unsigned int add)
{}

static void playback_work(struct work_struct *work)
{}

/* copy data from the URB buffer into the ALSA ring buffer */
static bool copy_capture_data(struct ua101_stream *stream, struct urb *urb,
			      unsigned int frames)
{}

static void capture_urb_complete(struct urb *urb)
{}

static void first_capture_urb_complete(struct urb *urb)
{}

static int submit_stream_urbs(struct ua101 *ua, struct ua101_stream *stream)
{}

static void kill_stream_urbs(struct ua101_stream *stream)
{}

static int enable_iso_interface(struct ua101 *ua, unsigned int intf_index)
{}

static void disable_iso_interface(struct ua101 *ua, unsigned int intf_index)
{}

static void stop_usb_capture(struct ua101 *ua)
{}

static int start_usb_capture(struct ua101 *ua)
{}

static void stop_usb_playback(struct ua101 *ua)
{}

static int start_usb_playback(struct ua101 *ua)
{}

static void abort_alsa_capture(struct ua101 *ua)
{}

static void abort_alsa_playback(struct ua101 *ua)
{}

static int set_stream_hw(struct ua101 *ua, struct snd_pcm_substream *substream,
			 unsigned int channels)
{}

static int capture_pcm_open(struct snd_pcm_substream *substream)
{}

static int playback_pcm_open(struct snd_pcm_substream *substream)
{}

static int capture_pcm_close(struct snd_pcm_substream *substream)
{}

static int playback_pcm_close(struct snd_pcm_substream *substream)
{}

static int capture_pcm_hw_params(struct snd_pcm_substream *substream,
				 struct snd_pcm_hw_params *hw_params)
{}

static int playback_pcm_hw_params(struct snd_pcm_substream *substream,
				  struct snd_pcm_hw_params *hw_params)
{}

static int capture_pcm_prepare(struct snd_pcm_substream *substream)
{}

static int playback_pcm_prepare(struct snd_pcm_substream *substream)
{}

static int capture_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
{}

static int playback_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
{}

static inline snd_pcm_uframes_t ua101_pcm_pointer(struct ua101 *ua,
						  struct ua101_stream *stream)
{}

static snd_pcm_uframes_t capture_pcm_pointer(struct snd_pcm_substream *subs)
{}

static snd_pcm_uframes_t playback_pcm_pointer(struct snd_pcm_substream *subs)
{}

static const struct snd_pcm_ops capture_pcm_ops =;

static const struct snd_pcm_ops playback_pcm_ops =;

static const struct uac_format_type_i_discrete_descriptor *
find_format_descriptor(struct usb_interface *interface)
{}

static int detect_usb_format(struct ua101 *ua)
{}

static int alloc_stream_buffers(struct ua101 *ua, struct ua101_stream *stream)
{}

static void free_stream_buffers(struct ua101 *ua, struct ua101_stream *stream)
{}

static int alloc_stream_urbs(struct ua101 *ua, struct ua101_stream *stream,
			     void (*urb_complete)(struct urb *))
{}

static void free_stream_urbs(struct ua101_stream *stream)
{}

static void free_usb_related_resources(struct ua101 *ua,
				       struct usb_interface *interface)
{}

static void ua101_card_free(struct snd_card *card)
{}

static int ua101_probe(struct usb_interface *interface,
		       const struct usb_device_id *usb_id)
{}

static void ua101_disconnect(struct usb_interface *interface)
{}

static const struct usb_device_id ua101_ids[] =;
MODULE_DEVICE_TABLE(usb, ua101_ids);

static struct usb_driver ua101_driver =;

module_usb_driver();