linux/sound/drivers/vx/vx_mixer.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Driver for Digigram VX soundcards
 *
 * Common mixer part
 *
 * Copyright (c) 2002 by Takashi Iwai <[email protected]>
 */

#include <sound/core.h>
#include <sound/control.h>
#include <sound/tlv.h>
#include <sound/vx_core.h>
#include "vx_cmd.h"


/*
 * write a codec data (24bit)
 */
static void vx_write_codec_reg(struct vx_core *chip, int codec, unsigned int data)
{}

/*
 * Data type used to access the Codec
 */
vx_codec_data;

#define SET_CDC_DATA_SEL(di,s)
#define SET_CDC_DATA_REG(di,r)
#define SET_CDC_DATA_VAL(di,d)
#define SET_CDC_DATA_INIT(di)

/*
 * set up codec register and write the value
 * @codec: the codec id, 0 or 1
 * @reg: register index
 * @val: data value
 */
static void vx_set_codec_reg(struct vx_core *chip, int codec, int reg, int val)
{}


/*
 * vx_set_analog_output_level - set the output attenuation level
 * @codec: the output codec, 0 or 1.  (1 for VXP440 only)
 * @left: left output level, 0 = mute
 * @right: right output level
 */
static void vx_set_analog_output_level(struct vx_core *chip, int codec, int left, int right)
{}


/*
 * vx_toggle_dac_mute -  mute/unmute DAC
 * @mute: 0 = unmute, 1 = mute
 */

#define DAC_ATTEN_MIN
#define DAC_ATTEN_MAX

void vx_toggle_dac_mute(struct vx_core *chip, int mute)
{}

/*
 * vx_reset_codec - reset and initialize the codecs
 */
void vx_reset_codec(struct vx_core *chip, int cold_reset)
{}

/*
 * change the audio input source
 * @src: the target source (VX_AUDIO_SRC_XXX)
 */
static void vx_change_audio_source(struct vx_core *chip, int src)
{}


/*
 * change the audio source if necessary and possible
 * returns 1 if the source is actually changed.
 */
int vx_sync_audio_source(struct vx_core *chip)
{}


/*
 * audio level, mute, monitoring
 */
struct vx_audio_level {};

static int vx_adjust_audio_level(struct vx_core *chip, int audio, int capture,
				 struct vx_audio_level *info)
{}

    
#if 0 // not used
static int vx_read_audio_level(struct vx_core *chip, int audio, int capture,
			       struct vx_audio_level *info)
{
	int err;
	struct vx_rmh rmh;

	memset(info, 0, sizeof(*info));
        vx_init_rmh(&rmh, CMD_GET_AUDIO_LEVELS);
	if (capture)
		rmh.Cmd[0] |= COMMAND_RECORD_MASK;
	/* Add Audio IO mask */
	rmh.Cmd[1] = 1 << audio;
	err = vx_send_msg(chip, &rmh);
	if (err < 0)
		return err;
	info.level = rmh.Stat[0] & MASK_DSP_WORD_LEVEL;
	info.monitor_level = (rmh.Stat[0] >> 10) & MASK_DSP_WORD_LEVEL;
	info.mute = (rmh.Stat[i] & AUDIO_IO_HAS_MUTE_LEVEL) ? 1 : 0;
	info.monitor_mute = (rmh.Stat[i] & AUDIO_IO_HAS_MUTE_MONITORING_1) ? 1 : 0;
	return 0;
}
#endif // not used

/*
 * set the monitoring level and mute state of the given audio
 * no more static, because must be called from vx_pcm to demute monitoring
 */
int vx_set_monitor_level(struct vx_core *chip, int audio, int level, int active)
{}


/*
 * set the mute status of the given audio
 */
static int vx_set_audio_switch(struct vx_core *chip, int audio, int active)
{}

/*
 * set the mute status of the given audio
 */
static int vx_set_audio_gain(struct vx_core *chip, int audio, int capture, int level)
{}

/*
 * reset all audio levels
 */
static void vx_reset_audio_levels(struct vx_core *chip)
{}


/*
 * VU, peak meter record
 */

#define VU_METER_CHANNELS

struct vx_vu_meter {};

/*
 * get the VU and peak meter values
 * @audio: the audio index
 * @capture: 0 = playback, 1 = capture operation
 * @info: the array of vx_vu_meter records (size = 2).
 */
static int vx_get_audio_vu_meter(struct vx_core *chip, int audio, int capture, struct vx_vu_meter *info)
{}
   

/*
 * control API entries
 */

/*
 * output level control
 */
static int vx_output_level_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{}

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

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

static const struct snd_kcontrol_new vx_control_output_level =;

/*
 * audio source select
 */
static int vx_audio_src_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{}

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

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

static const struct snd_kcontrol_new vx_control_audio_src =;

/*
 * clock mode selection
 */
static int vx_clock_mode_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{}

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

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

static const struct snd_kcontrol_new vx_control_clock_mode =;

/*
 * Audio Gain
 */
static int vx_audio_gain_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{}

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

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

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

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

#define vx_audio_sw_info

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

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

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

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

static const DECLARE_TLV_DB_SCALE(db_scale_audio_gain, -10975, 25, 0);

static const struct snd_kcontrol_new vx_control_audio_gain =;
static const struct snd_kcontrol_new vx_control_output_switch =;
static const struct snd_kcontrol_new vx_control_monitor_gain =;
static const struct snd_kcontrol_new vx_control_monitor_switch =;


/*
 * IEC958 status bits
 */
static int vx_iec958_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{}

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

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

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

static const struct snd_kcontrol_new vx_control_iec958_mask =;

static const struct snd_kcontrol_new vx_control_iec958 =;


/*
 * VU meter
 */

#define METER_MAX
#define METER_SHIFT

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

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

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

#define vx_saturation_info

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

static const struct snd_kcontrol_new vx_control_vu_meter =;

static const struct snd_kcontrol_new vx_control_peak_meter =;

static const struct snd_kcontrol_new vx_control_saturation =;



/*
 *
 */

int snd_vx_mixer_new(struct vx_core *chip)
{}