#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) …
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,
.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)
{ … }
static int snd_vortex_pcm_open(struct snd_pcm_substream *substream)
{ … }
static int snd_vortex_pcm_close(struct snd_pcm_substream *substream)
{ … }
static int
snd_vortex_pcm_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *hw_params)
{ … }
static int snd_vortex_pcm_hw_free(struct snd_pcm_substream *substream)
{ … }
static int snd_vortex_pcm_prepare(struct snd_pcm_substream *substream)
{ … }
static int snd_vortex_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
{ … }
static snd_pcm_uframes_t snd_vortex_pcm_pointer(struct snd_pcm_substream *substream)
{ … }
static const struct snd_pcm_ops snd_vortex_playback_ops = …;
static const char * const vortex_pcm_prettyname[VORTEX_PCM_LAST] = …;
static const char * const vortex_pcm_name[VORTEX_PCM_LAST] = …;
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)
{ … }
static const struct snd_kcontrol_new snd_vortex_mixer_spdif[] = …;
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 = …;
static int snd_vortex_new_pcm(vortex_t *chip, int idx, int nr)
{ … }