linux/sound/firewire/fireworks/fireworks_pcm.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * fireworks_pcm.c - a part of driver for Fireworks based devices
 *
 * Copyright (c) 2009-2010 Clemens Ladisch
 * Copyright (c) 2013-2014 Takashi Sakamoto
 */
#include "./fireworks.h"

/*
 * NOTE:
 * Fireworks changes its AMDTP channels for PCM data according to its sampling
 * rate. There are three modes. Here _XX is either _rx or _tx.
 *  0:  32.0- 48.0 kHz then snd_efw_hwinfo.amdtp_XX_pcm_channels applied
 *  1:  88.2- 96.0 kHz then snd_efw_hwinfo.amdtp_XX_pcm_channels_2x applied
 *  2: 176.4-192.0 kHz then snd_efw_hwinfo.amdtp_XX_pcm_channels_4x applied
 *
 * The number of PCM channels for analog input and output are always fixed but
 * the number of PCM channels for digital input and output are differed.
 *
 * Additionally, according to "AudioFire Owner's Manual Version 2.2", in some
 * model, the number of PCM channels for digital input has more restriction
 * depending on which digital interface is selected.
 *  - S/PDIF coaxial and optical	: use input 1-2
 *  - ADAT optical at 32.0-48.0 kHz	: use input 1-8
 *  - ADAT optical at 88.2-96.0 kHz	: use input 1-4 (S/MUX format)
 *
 * The data in AMDTP channels for blank PCM channels are zero.
 */
static const unsigned int freq_table[] =;

static inline unsigned int
get_multiplier_mode_with_index(unsigned int index)
{}

int snd_efw_get_multiplier_mode(unsigned int sampling_rate, unsigned int *mode)
{}

static int
hw_rule_rate(struct snd_pcm_hw_params *params, struct snd_pcm_hw_rule *rule)
{}

static int
hw_rule_channels(struct snd_pcm_hw_params *params, struct snd_pcm_hw_rule *rule)
{}

static void
limit_channels(struct snd_pcm_hardware *hw, unsigned int *pcm_channels)
{}

static int
pcm_init_hw_params(struct snd_efw *efw,
		   struct snd_pcm_substream *substream)
{}

static int pcm_open(struct snd_pcm_substream *substream)
{}

static int pcm_close(struct snd_pcm_substream *substream)
{}

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

static int pcm_hw_free(struct snd_pcm_substream *substream)
{}

static int pcm_capture_prepare(struct snd_pcm_substream *substream)
{}
static int pcm_playback_prepare(struct snd_pcm_substream *substream)
{}

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

static snd_pcm_uframes_t pcm_capture_pointer(struct snd_pcm_substream *sbstrm)
{}
static snd_pcm_uframes_t pcm_playback_pointer(struct snd_pcm_substream *sbstrm)
{}

static int pcm_capture_ack(struct snd_pcm_substream *substream)
{}

static int pcm_playback_ack(struct snd_pcm_substream *substream)
{}

int snd_efw_create_pcm_devices(struct snd_efw *efw)
{}