bool need_setup; /* (re-)need for configure? */
/* for hw constraints */
- struct audioformat *cur_audiofmt;
+ const struct audioformat *cur_audiofmt;
unsigned int cur_rate;
snd_pcm_format_t cur_format;
unsigned int cur_channels;
int direction; /* playback or capture */
int interface; /* current interface */
int endpoint; /* assigned endpoint */
- struct audioformat *cur_audiofmt; /* current audioformat pointer (for hw_params callback) */
+ const struct audioformat *cur_audiofmt; /* current audioformat pointer (for hw_params callback) */
struct snd_usb_power_domain *str_pd; /* UAC3 Power Domain for streaming path */
snd_pcm_format_t pcm_format; /* current audio format (for hw_params callback) */
unsigned int channels; /* current number of channels (for hw_params callback) */
}
static bool uac_clock_source_is_valid_quirk(struct snd_usb_audio *chip,
- struct audioformat *fmt,
+ const struct audioformat *fmt,
int source_id)
{
bool ret = false;
}
static bool uac_clock_source_is_valid(struct snd_usb_audio *chip,
- struct audioformat *fmt,
+ const struct audioformat *fmt,
int source_id)
{
int err;
}
static int __uac_clock_find_source(struct snd_usb_audio *chip,
- struct audioformat *fmt, int entity_id,
+ const struct audioformat *fmt, int entity_id,
unsigned long *visited, bool validate)
{
struct uac_clock_source_descriptor *source;
}
static int __uac3_clock_find_source(struct snd_usb_audio *chip,
- struct audioformat *fmt, int entity_id,
+ const struct audioformat *fmt, int entity_id,
unsigned long *visited, bool validate)
{
struct uac3_clock_source_descriptor *source;
* Returns the clock source UnitID (>=0) on success, or an error.
*/
int snd_usb_clock_find_source(struct snd_usb_audio *chip,
- struct audioformat *fmt, bool validate)
+ const struct audioformat *fmt, bool validate)
{
DECLARE_BITMAP(visited, 256);
memset(visited, 0, sizeof(visited));
}
static int set_sample_rate_v1(struct snd_usb_audio *chip,
- struct audioformat *fmt, int rate)
+ const struct audioformat *fmt, int rate)
{
struct usb_device *dev = chip->dev;
struct usb_host_interface *alts;
}
static int set_sample_rate_v2v3(struct snd_usb_audio *chip,
- struct audioformat *fmt, int rate)
+ const struct audioformat *fmt, int rate)
{
int cur_rate, prev_rate;
int clock;
}
int snd_usb_init_sample_rate(struct snd_usb_audio *chip,
- struct audioformat *fmt, int rate)
+ const struct audioformat *fmt, int rate)
{
usb_audio_dbg(chip, "%d:%d Set sample rate %d, clock %d\n",
fmt->iface, fmt->altsetting, rate, fmt->clock);
#define __USBAUDIO_CLOCK_H
int snd_usb_init_sample_rate(struct snd_usb_audio *chip,
- struct audioformat *fmt, int rate);
+ const struct audioformat *fmt, int rate);
int snd_usb_clock_find_source(struct snd_usb_audio *chip,
- struct audioformat *fmt, bool validate);
+ const struct audioformat *fmt, bool validate);
int snd_usb_set_sample_rate_v2v3(struct snd_usb_audio *chip,
const struct audioformat *fmt,
*/
struct snd_usb_endpoint *
snd_usb_endpoint_open(struct snd_usb_audio *chip,
- struct audioformat *fp,
+ const struct audioformat *fp,
const struct snd_pcm_hw_params *params,
bool is_sync_ep)
{
struct snd_usb_endpoint *
snd_usb_endpoint_open(struct snd_usb_audio *chip,
- struct audioformat *fp,
+ const struct audioformat *fp,
const struct snd_pcm_hw_params *params,
bool is_sync_ep);
void snd_usb_endpoint_close(struct snd_usb_audio *chip,
/*
* find a matching audio format
*/
-static struct audioformat *
+static const struct audioformat *
find_format(struct list_head *fmt_list_head, snd_pcm_format_t format,
unsigned int rate, unsigned int channels, bool strict_match,
struct snd_usb_substream *subs)
{
- struct audioformat *fp;
- struct audioformat *found = NULL;
+ const struct audioformat *fp;
+ const struct audioformat *found = NULL;
int cur_attr = 0, attr;
list_for_each_entry(fp, fmt_list_head, list) {
return found;
}
-static struct audioformat *
+static const struct audioformat *
find_substream_format(struct snd_usb_substream *subs,
const struct snd_pcm_hw_params *params)
{
* initialize the pitch control and sample rate
*/
int snd_usb_init_pitch(struct snd_usb_audio *chip,
- struct audioformat *fmt)
+ const struct audioformat *fmt)
{
int err;
return NULL;
}
-static struct audioformat *
+static const struct audioformat *
find_implicit_fb_sync_format(struct snd_usb_audio *chip,
const struct audioformat *target,
const struct snd_pcm_hw_params *params,
int stream)
{
struct snd_usb_substream *subs;
- struct audioformat *fp, *sync_fmt;
+ const struct audioformat *fp, *sync_fmt;
int score, high_score;
subs = find_matching_substream(chip, stream, target->sync_ep,
{
struct snd_usb_substream *subs = substream->runtime->private_data;
struct snd_usb_audio *chip = subs->stream->chip;
- struct audioformat *fmt;
- struct audioformat *sync_fmt;
+ const struct audioformat *fmt;
+ const struct audioformat *sync_fmt;
int ret;
ret = snd_media_start_pipeline(subs);
static int hw_check_valid_format(struct snd_usb_substream *subs,
struct snd_pcm_hw_params *params,
- struct audioformat *fp)
+ const struct audioformat *fp)
{
struct snd_interval *it = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE);
struct snd_interval *ct = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
struct snd_pcm_hw_rule *rule)
{
struct snd_usb_substream *subs = rule->private;
- struct audioformat *fp;
+ const struct audioformat *fp;
struct snd_interval *it = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE);
unsigned int rmin, rmax, r;
int i;
struct snd_pcm_hw_rule *rule)
{
struct snd_usb_substream *subs = rule->private;
- struct audioformat *fp;
+ const struct audioformat *fp;
struct snd_interval *it = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
unsigned int rmin, rmax;
struct snd_pcm_hw_rule *rule)
{
struct snd_usb_substream *subs = rule->private;
- struct audioformat *fp;
+ const struct audioformat *fp;
struct snd_mask *fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);
u64 fbits;
u32 oldbits[2];
struct snd_pcm_hw_rule *rule)
{
struct snd_usb_substream *subs = rule->private;
- struct audioformat *fp;
+ const struct audioformat *fp;
struct snd_interval *it;
unsigned char min_datainterval;
unsigned int pmin;
{
struct snd_usb_audio *chip = subs->stream->chip;
struct snd_usb_endpoint *ep;
- struct audioformat *fp;
+ const struct audioformat *fp;
int err;
list_for_each_entry(fp, &subs->fmt_list, list) {
static int setup_hw_info(struct snd_pcm_runtime *runtime, struct snd_usb_substream *subs)
{
struct snd_usb_audio *chip = subs->stream->chip;
- struct audioformat *fp;
+ const struct audioformat *fp;
unsigned int pt, ptmin;
int param_period_time_if_needed = -1;
int err;
int snd_usb_pcm_resume(struct snd_usb_stream *as);
int snd_usb_init_pitch(struct snd_usb_audio *chip,
- struct audioformat *fmt);
+ const struct audioformat *fmt);
void snd_usb_preallocate_buffer(struct snd_usb_substream *subs);
int snd_usb_audioformat_set_sync_ep(struct snd_usb_audio *chip,
/*
* check if the device uses big-endian samples
*/
-int snd_usb_is_big_endian_format(struct snd_usb_audio *chip, struct audioformat *fp)
+int snd_usb_is_big_endian_format(struct snd_usb_audio *chip,
+ const struct audioformat *fp)
{
/* it depends on altsetting whether the device is big-endian or not */
switch (chip->usb_id) {
};
static void set_format_emu_quirk(struct snd_usb_substream *subs,
- struct audioformat *fmt)
+ const struct audioformat *fmt)
{
unsigned char emu_samplerate_id = 0;
}
void snd_usb_set_format_quirk(struct snd_usb_substream *subs,
- struct audioformat *fmt)
+ const struct audioformat *fmt)
{
switch (subs->stream->chip->usb_id) {
case USB_ID(0x041e, 0x3f02): /* E-Mu 0202 USB */
}
int snd_usb_select_mode_quirk(struct snd_usb_audio *chip,
- struct audioformat *fmt)
+ const struct audioformat *fmt)
{
struct usb_device *dev = chip->dev;
int err;
unsigned int usb_id);
void snd_usb_set_format_quirk(struct snd_usb_substream *subs,
- struct audioformat *fmt);
+ const struct audioformat *fmt);
bool snd_usb_get_sample_rate_quirk(struct snd_usb_audio *chip);
int snd_usb_is_big_endian_format(struct snd_usb_audio *chip,
- struct audioformat *fp);
+ const struct audioformat *fp);
void snd_usb_endpoint_start_quirk(struct snd_usb_endpoint *ep);
__u16 index, void *data, __u16 size);
int snd_usb_select_mode_quirk(struct snd_usb_audio *chip,
- struct audioformat *fmt);
+ const struct audioformat *fmt);
u64 snd_usb_interface_dsd_format_quirks(struct snd_usb_audio *chip,
struct audioformat *fp,