linux/sound/pci/ctxfi/ctmixer.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2008, Creative Technology Ltd. All Rights Reserved.
 *
 * @File	ctmixer.c
 *
 * @Brief
 * This file contains the implementation of alsa mixer device functions.
 *
 * @Author	Liu Chun
 * @Date 	May 28 2008
 */


#include "ctmixer.h"
#include "ctamixer.h"
#include <linux/slab.h>
#include <sound/core.h>
#include <sound/control.h>
#include <sound/asoundef.h>
#include <sound/pcm.h>
#include <sound/tlv.h>

enum CT_SUM_CTL {};

enum CT_AMIXER_CTL {};

enum CTALSA_MIXER_CTL {};

#define VOL_MIXER_START
#define VOL_MIXER_END
#define VOL_MIXER_NUM
#define SWH_MIXER_START
#define SWH_MIXER_END
#define SWH_CAPTURE_START
#define SWH_CAPTURE_END

#define CHN_NUM

struct ct_kcontrol_init {};

static struct ct_kcontrol_init
ct_kcontrol_init_table[NUM_CTALSA_MIXERS] =;

static void
ct_mixer_recording_select(struct ct_mixer *mixer, enum CT_AMIXER_CTL type);

static void
ct_mixer_recording_unselect(struct ct_mixer *mixer, enum CT_AMIXER_CTL type);

/* FIXME: this static looks like it would fail if more than one card was */
/* installed. */
static struct snd_kcontrol *kctls[2] =;

static enum CT_AMIXER_CTL get_amixer_index(enum CTALSA_MIXER_CTL alsa_index)
{}

static enum CT_AMIXER_CTL get_recording_amixer(enum CT_AMIXER_CTL index)
{}

static unsigned char
get_switch_state(struct ct_mixer *mixer, enum CTALSA_MIXER_CTL type)
{}

static void
set_switch_state(struct ct_mixer *mixer,
		 enum CTALSA_MIXER_CTL type, unsigned char state)
{}

#if 0 /* not used */
/* Map integer value ranging from 0 to 65535 to 14-bit float value ranging
 * from 2^-6 to (1+1023/1024) */
static unsigned int uint16_to_float14(unsigned int x)
{
	unsigned int i;

	if (x < 17)
		return 0;

	x *= 2031;
	x /= 65535;
	x += 16;

	/* i <= 6 */
	for (i = 0; !(x & 0x400); i++)
		x <<= 1;

	x = (((7 - i) & 0x7) << 10) | (x & 0x3ff);

	return x;
}

static unsigned int float14_to_uint16(unsigned int x)
{
	unsigned int e;

	if (!x)
		return x;

	e = (x >> 10) & 0x7;
	x &= 0x3ff;
	x += 1024;
	x >>= (7 - e);
	x -= 16;
	x *= 65535;
	x /= 2031;

	return x;
}
#endif /* not used */

#define VOL_SCALE
#define VOL_MAX

static const DECLARE_TLV_DB_SCALE(ct_vol_db_scale, -6400, 25, 1);

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

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

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

static struct snd_kcontrol_new vol_ctl =;

static int output_switch_info(struct snd_kcontrol *kcontrol,
			      struct snd_ctl_elem_info *info)
{}

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

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

static struct snd_kcontrol_new output_ctl =;

static int mic_source_switch_info(struct snd_kcontrol *kcontrol,
			      struct snd_ctl_elem_info *info)
{}

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

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

static struct snd_kcontrol_new mic_source_ctl =;

static void
do_line_mic_switch(struct ct_atc *atc, enum CTALSA_MIXER_CTL type)
{}

static void
do_digit_io_switch(struct ct_atc *atc, int state)
{}

static void do_switch(struct ct_atc *atc, enum CTALSA_MIXER_CTL type, int state)
{}

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

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

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

static struct snd_kcontrol_new swh_ctl =;

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

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

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

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

static struct snd_kcontrol_new iec958_mask_ctl =;

static struct snd_kcontrol_new iec958_default_ctl =;

static struct snd_kcontrol_new iec958_ctl =;

#define NUM_IEC958_CTL

static int
ct_mixer_kcontrol_new(struct ct_mixer *mixer, struct snd_kcontrol_new *new)
{}

static int ct_mixer_kcontrols_create(struct ct_mixer *mixer)
{}

static void
ct_mixer_recording_select(struct ct_mixer *mixer, enum CT_AMIXER_CTL type)
{}

static void
ct_mixer_recording_unselect(struct ct_mixer *mixer, enum CT_AMIXER_CTL type)
{}

static int ct_mixer_get_resources(struct ct_mixer *mixer)
{}

static int ct_mixer_get_mem(struct ct_mixer **rmixer)
{}

static int ct_mixer_topology_build(struct ct_mixer *mixer)
{}

static int mixer_set_input_port(struct amixer *amixer, struct rsc *rsc)
{}

static enum CT_AMIXER_CTL port_to_amixer(enum MIXER_PORT_T type)
{}

static int mixer_get_output_ports(struct ct_mixer *mixer,
				  enum MIXER_PORT_T type,
				  struct rsc **rleft, struct rsc **rright)
{}

static int mixer_set_input_left(struct ct_mixer *mixer,
				enum MIXER_PORT_T type, struct rsc *rsc)
{}

static int
mixer_set_input_right(struct ct_mixer *mixer,
		      enum MIXER_PORT_T type, struct rsc *rsc)
{}

#ifdef CONFIG_PM_SLEEP
static int mixer_resume(struct ct_mixer *mixer)
{}
#endif

int ct_mixer_destroy(struct ct_mixer *mixer)
{}

int ct_mixer_create(struct ct_atc *atc, struct ct_mixer **rmixer)
{}

int ct_alsa_mix_create(struct ct_atc *atc,
		       enum CTALSADEVS device,
		       const char *device_name)
{}