linux/sound/pci/au88x0/au88x0_pcm.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 */
 
/*
 * Vortex PCM ALSA driver.
 *
 * Supports ADB and WT DMA. Unfortunately, WT channels do not run yet.
 * It remains stuck,and DMA transfers do not happen. 
 */
#include <sound/asoundef.h>
#include <linux/time.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include "au88x0.h"

#define VORTEX_PCM_TYPE(x)

/* hardware definition */
static const struct snd_pcm_hardware snd_vortex_playback_hw_adb =;

#ifndef CHIP_AU8820
static const struct snd_pcm_hardware snd_vortex_playback_hw_a3d =;
#endif
static const struct snd_pcm_hardware snd_vortex_playback_hw_spdif =;

#ifndef CHIP_AU8810
static const struct snd_pcm_hardware snd_vortex_playback_hw_wt = {
	.info = (SNDRV_PCM_INFO_MMAP |
		 SNDRV_PCM_INFO_INTERLEAVED |
		 SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_MMAP_VALID),
	.formats = SNDRV_PCM_FMTBIT_S16_LE,
	.rates = SNDRV_PCM_RATE_8000_48000 | SNDRV_PCM_RATE_CONTINUOUS,	// SNDRV_PCM_RATE_48000,
	.rate_min = 8000,
	.rate_max = 48000,
	.channels_min = 1,
	.channels_max = 2,
	.buffer_bytes_max = 0x10000,
	.period_bytes_min = 0x0400,
	.period_bytes_max = 0x1000,
	.periods_min = 2,
	.periods_max = 64,
};
#endif
#ifdef CHIP_AU8830
static const unsigned int au8830_channels[3] = {
	1, 2, 4,
};

static const struct snd_pcm_hw_constraint_list hw_constraints_au8830_channels = {
	.count = ARRAY_SIZE(au8830_channels),
	.list = au8830_channels,
	.mask = 0,
};
#endif

static void vortex_notify_pcm_vol_change(struct snd_card *card,
			struct snd_kcontrol *kctl, int activate)
{}

/* open callback */
static int snd_vortex_pcm_open(struct snd_pcm_substream *substream)
{}

/* close callback */
static int snd_vortex_pcm_close(struct snd_pcm_substream *substream)
{}

/* hw_params callback */
static int
snd_vortex_pcm_hw_params(struct snd_pcm_substream *substream,
			 struct snd_pcm_hw_params *hw_params)
{}

/* hw_free callback */
static int snd_vortex_pcm_hw_free(struct snd_pcm_substream *substream)
{}

/* prepare callback */
static int snd_vortex_pcm_prepare(struct snd_pcm_substream *substream)
{}

/* trigger callback */
static int snd_vortex_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
{}

/* pointer callback */
static snd_pcm_uframes_t snd_vortex_pcm_pointer(struct snd_pcm_substream *substream)
{}

/* operators */
static const struct snd_pcm_ops snd_vortex_playback_ops =;

/*
*  definitions of capture are omitted here...
*/

static const char * const vortex_pcm_prettyname[VORTEX_PCM_LAST] =;
static const char * const vortex_pcm_name[VORTEX_PCM_LAST] =;

/* SPDIF kcontrol */

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

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

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

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

/* spdif controls */
static const struct snd_kcontrol_new snd_vortex_mixer_spdif[] =;

/* subdevice PCM Volume control */

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

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

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

static const DECLARE_TLV_DB_MINMAX(vortex_pcm_vol_db_scale, -9600, 2400);

static const struct snd_kcontrol_new snd_vortex_pcm_vol =;

/* create a pcm device */
static int snd_vortex_new_pcm(vortex_t *chip, int idx, int nr)
{}