linux/drivers/usb/gadget/function/u_audio.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * u_audio.c -- interface to USB gadget "ALSA sound card" utilities
 *
 * Copyright (C) 2016
 * Author: Ruslan Bilovol <[email protected]>
 *
 * Sound card implementation was cut-and-pasted with changes
 * from f_uac2.c and has:
 *    Copyright (C) 2011
 *    Yadwinder Singh ([email protected])
 *    Jaswinder Singh ([email protected])
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/control.h>
#include <sound/tlv.h>
#include <linux/usb/audio.h>

#include "u_audio.h"

#define BUFF_SIZE_MAX
#define PRD_SIZE_MAX
#define MIN_PERIODS

enum {};

/* Runtime data params for one stream */
struct uac_rtd_params {};

struct snd_uac_chip {};

static const struct snd_pcm_hardware uac_pcm_hardware =;

static void u_audio_set_fback_frequency(enum usb_device_speed speed,
					struct usb_ep *out_ep,
					unsigned long long freq,
					unsigned int pitch,
					void *buf)
{}

static void u_audio_iso_complete(struct usb_ep *ep, struct usb_request *req)
{}

static void u_audio_iso_fback_complete(struct usb_ep *ep,
				       struct usb_request *req)
{}

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

static snd_pcm_uframes_t uac_pcm_pointer(struct snd_pcm_substream *substream)
{}

static u64 uac_ssize_to_fmt(int ssize)
{}

static int uac_pcm_open(struct snd_pcm_substream *substream)
{}

/* ALSA cries without these function pointers */
static int uac_pcm_null(struct snd_pcm_substream *substream)
{}

static const struct snd_pcm_ops uac_pcm_ops =;

static inline void free_ep(struct uac_rtd_params *prm, struct usb_ep *ep)
{}

static inline void free_ep_fback(struct uac_rtd_params *prm, struct usb_ep *ep)
{}

static void set_active(struct uac_rtd_params *prm, bool active)
{}

int u_audio_set_capture_srate(struct g_audio *audio_dev, int srate)
{}
EXPORT_SYMBOL_GPL();

int u_audio_get_capture_srate(struct g_audio *audio_dev, u32 *val)
{}
EXPORT_SYMBOL_GPL();

int u_audio_set_playback_srate(struct g_audio *audio_dev, int srate)
{}
EXPORT_SYMBOL_GPL();

int u_audio_get_playback_srate(struct g_audio *audio_dev, u32 *val)
{}
EXPORT_SYMBOL_GPL();

int u_audio_start_capture(struct g_audio *audio_dev)
{}
EXPORT_SYMBOL_GPL();

void u_audio_stop_capture(struct g_audio *audio_dev)
{}
EXPORT_SYMBOL_GPL();

int u_audio_start_playback(struct g_audio *audio_dev)
{}
EXPORT_SYMBOL_GPL();

void u_audio_stop_playback(struct g_audio *audio_dev)
{}
EXPORT_SYMBOL_GPL();

void u_audio_suspend(struct g_audio *audio_dev)
{}
EXPORT_SYMBOL_GPL();

int u_audio_get_volume(struct g_audio *audio_dev, int playback, s16 *val)
{}
EXPORT_SYMBOL_GPL();

int u_audio_set_volume(struct g_audio *audio_dev, int playback, s16 val)
{}
EXPORT_SYMBOL_GPL();

int u_audio_get_mute(struct g_audio *audio_dev, int playback, int *val)
{}
EXPORT_SYMBOL_GPL();

int u_audio_set_mute(struct g_audio *audio_dev, int playback, int val)
{}
EXPORT_SYMBOL_GPL();


static int u_audio_pitch_info(struct snd_kcontrol *kcontrol,
				   struct snd_ctl_elem_info *uinfo)
{}

static int u_audio_pitch_get(struct snd_kcontrol *kcontrol,
				   struct snd_ctl_elem_value *ucontrol)
{}

static int u_audio_pitch_put(struct snd_kcontrol *kcontrol,
				  struct snd_ctl_elem_value *ucontrol)
{}

static int u_audio_mute_info(struct snd_kcontrol *kcontrol,
				   struct snd_ctl_elem_info *uinfo)
{}

static int u_audio_mute_get(struct snd_kcontrol *kcontrol,
				   struct snd_ctl_elem_value *ucontrol)
{}

static int u_audio_mute_put(struct snd_kcontrol *kcontrol,
				  struct snd_ctl_elem_value *ucontrol)
{}

/*
 * TLV callback for mixer volume controls
 */
static int u_audio_volume_tlv(struct snd_kcontrol *kcontrol, int op_flag,
			 unsigned int size, unsigned int __user *_tlv)
{}

static int u_audio_volume_info(struct snd_kcontrol *kcontrol,
				   struct snd_ctl_elem_info *uinfo)
{}

static int u_audio_volume_get(struct snd_kcontrol *kcontrol,
				   struct snd_ctl_elem_value *ucontrol)
{}

static int u_audio_volume_put(struct snd_kcontrol *kcontrol,
				  struct snd_ctl_elem_value *ucontrol)
{}

static int get_max_srate(const int *srates)
{}

static int get_min_srate(const int *srates)
{}

static int u_audio_rate_info(struct snd_kcontrol *kcontrol,
				struct snd_ctl_elem_info *uinfo)
{}

static int u_audio_rate_get(struct snd_kcontrol *kcontrol,
						 struct snd_ctl_elem_value *ucontrol)
{}

static struct snd_kcontrol_new u_audio_controls[]  =;

int g_audio_setup(struct g_audio *g_audio, const char *pcm_name,
					const char *card_name)
{}
EXPORT_SYMBOL_GPL();

void g_audio_cleanup(struct g_audio *g_audio)
{}
EXPORT_SYMBOL_GPL();

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