linux/sound/pci/au88x0/au88x0_eq.c

// SPDX-License-Identifier: GPL-2.0-or-later
/***************************************************************************
 *            au88x0_eq.c
 *  Aureal Vortex Hardware EQ control/access.
 *
 *  Sun Jun  8 18:19:19 2003
 *  2003  Manuel Jander ([email protected])
 *  
 *  02 July 2003: First time something works :)
 *  November 2003: A3D Bypass code completed but untested.
 *
 *  TODO:
 *     - Debug (testing)
 *     - Test peak visualization support.
 *
 ****************************************************************************/

/*
 */

/*
 The Aureal Hardware EQ is found on AU8810 and AU8830 chips only.
 it has 4 inputs (2 for general mix, 2 for A3D) and 2 outputs (supposed 
 to be routed to the codec).
*/

#include "au88x0.h"
#include "au88x0_eq.h"
#include "au88x0_eqdata.c"

#define VORTEX_EQ_BASE
#define VORTEX_EQ_DEST
#define VORTEX_EQ_SOURCE
#define VORTEX_EQ_CTRL

#define VORTEX_BAND_COEFF_SIZE

/* CEqHw.s */
static void vortex_EqHw_SetTimeConsts(vortex_t * vortex, u16 gain, u16 level)
{}

static inline u16 sign_invert(u16 a)
{}

static void vortex_EqHw_SetLeftCoefs(vortex_t *vortex, const u16 coefs[])
{}

static void vortex_EqHw_SetRightCoefs(vortex_t *vortex, const u16 coefs[])
{}

static void vortex_EqHw_SetLeftStates(vortex_t *vortex, const u16 a[], const u16 b[])
{}

static void vortex_EqHw_SetRightStates(vortex_t *vortex, const u16 a[], const u16 b[])
{}

#if 0
static void vortex_EqHw_GetTimeConsts(vortex_t * vortex, u16 * a, u16 * b)
{
	*a = hwread(vortex->mmio, 0x2b3c4);
	*b = hwread(vortex->mmio, 0x2b3c8);
}

static void vortex_EqHw_GetLeftCoefs(vortex_t * vortex, u16 a[])
{

}

static void vortex_EqHw_GetRightCoefs(vortex_t * vortex, u16 a[])
{

}

static void vortex_EqHw_GetLeftStates(vortex_t * vortex, u16 * a, u16 b[])
{

}

static void vortex_EqHw_GetRightStates(vortex_t * vortex, u16 * a, u16 b[])
{

}

#endif
/* Mix Gains */
static void vortex_EqHw_SetBypassGain(vortex_t * vortex, u16 a, u16 b)
{}

static void vortex_EqHw_SetA3DBypassGain(vortex_t * vortex, u16 a, u16 b)
{}

#if 0
static void vortex_EqHw_SetCurrBypassGain(vortex_t * vortex, u16 a, u16 b)
{

	hwwrite(vortex->mmio, 0x2b3d0, a);
	hwwrite(vortex->mmio, 0x2b3e8, b);
}

static void vortex_EqHw_SetCurrA3DBypassGain(vortex_t * vortex, u16 a, u16 b)
{

	hwwrite(vortex->mmio, 0x2b3dc, a);
	hwwrite(vortex->mmio, 0x2b3f4, b);
}

#endif
static void
vortex_EqHw_SetLeftGainsSingleTarget(vortex_t * vortex, u16 index, u16 b)
{}

static void
vortex_EqHw_SetRightGainsSingleTarget(vortex_t * vortex, u16 index, u16 b)
{}

static void vortex_EqHw_SetLeftGainsTarget(vortex_t *vortex, const u16 a[])
{}

static void vortex_EqHw_SetRightGainsTarget(vortex_t *vortex, const u16 a[])
{}

static void vortex_EqHw_SetLeftGainsCurrent(vortex_t *vortex, const u16 a[])
{}

static void vortex_EqHw_SetRightGainsCurrent(vortex_t *vortex, const u16 a[])
{}

#if 0
static void vortex_EqHw_GetLeftGainsTarget(vortex_t * vortex, u16 a[])
{
	eqhw_t *eqhw = &(vortex->eq.this04);
	int ebx = 0;

	if (eqhw->this04 < 0)
		return;

	do {
		a[ebx] = hwread(vortex->mmio, 0x2b02c + ebx * 0x30);
		ebx++;
	}
	while (ebx < eqhw->this04);
}

static void vortex_EqHw_GetRightGainsTarget(vortex_t * vortex, u16 a[])
{
	eqhw_t *eqhw = &(vortex->eq.this04);
	int ebx = 0;

	if (eqhw->this04 < 0)
		return;

	do {
		a[ebx] = hwread(vortex->mmio, 0x2b20c + ebx * 0x30);
		ebx++;
	}
	while (ebx < eqhw->this04);
}

static void vortex_EqHw_GetLeftGainsCurrent(vortex_t * vortex, u16 a[])
{
	eqhw_t *eqhw = &(vortex->eq.this04);
	int ebx = 0;

	if (eqhw->this04 < 0)
		return;

	do {
		a[ebx] = hwread(vortex->mmio, 0x2b028 + ebx * 0x30);
		ebx++;
	}
	while (ebx < eqhw->this04);
}

static void vortex_EqHw_GetRightGainsCurrent(vortex_t * vortex, u16 a[])
{
	eqhw_t *eqhw = &(vortex->eq.this04);
	int ebx = 0;

	if (eqhw->this04 < 0)
		return;

	do {
		a[ebx] = hwread(vortex->mmio, 0x2b208 + ebx * 0x30);
		ebx++;
	}
	while (ebx < eqhw->this04);
}

#endif
/* EQ band levels settings */
static void vortex_EqHw_SetLevels(vortex_t *vortex, const u16 peaks[])
{}

#if 0
static void vortex_EqHw_GetLevels(vortex_t * vortex, u16 a[])
{
	eqhw_t *eqhw = &(vortex->eq.this04);
	int ebx;

	if (eqhw->this04 < 0)
		return;

	ebx = 0;
	do {
		a[ebx] = hwread(vortex->mmio, 0x2b024 + ebx * 0x30);
		ebx++;
	}
	while (ebx < eqhw->this04);

	a[eqhw->this04] = hwread(vortex->mmio, 0x2b3cc);
	a[eqhw->this04 + 1] = hwread(vortex->mmio, 0x2b3d8);

	ebx = 0;
	do {
		a[ebx + (eqhw->this04 + 2)] =
		    hwread(vortex->mmio, 0x2b204 + ebx * 0x30);
		ebx++;
	}
	while (ebx < eqhw->this04);

	a[2 + (eqhw->this04 * 2)] = hwread(vortex->mmio, 0x2b3e4);
	a[3 + (eqhw->this04 * 2)] = hwread(vortex->mmio, 0x2b3f0);
}

#endif
/* Global Control */
static void vortex_EqHw_SetControlReg(vortex_t * vortex, u32 reg)
{}

static void vortex_EqHw_SetSampleRate(vortex_t * vortex, u32 sr)
{}

#if 0
static void vortex_EqHw_GetControlReg(vortex_t * vortex, u32 *reg)
{
	*reg = hwread(vortex->mmio, 0x2b440);
}

static void vortex_EqHw_GetSampleRate(vortex_t * vortex, u32 *sr)
{
	*sr = (hwread(vortex->mmio, 0x2b440) >> 3) & 0x1f;
}

#endif
static void vortex_EqHw_Enable(vortex_t * vortex)
{}

static void vortex_EqHw_Disable(vortex_t * vortex)
{}

/* Reset (zero) buffers */
static void vortex_EqHw_ZeroIO(vortex_t * vortex)
{}

static void vortex_EqHw_ZeroA3DIO(vortex_t * vortex)
{}

static void vortex_EqHw_ZeroState(vortex_t * vortex)
{}

/* Program coeficients as pass through */
static void vortex_EqHw_ProgramPipe(vortex_t * vortex)
{}

/* Program EQ block as 10 band Equalizer */
static void
vortex_EqHw_Program10Band(vortex_t * vortex, auxxEqCoeffSet_t * coefset)
{}

/* Read all EQ peaks. (think VU meter) */
static void vortex_EqHw_GetTenBandLevels(vortex_t * vortex, u16 peaks[])
{}

/* CEqlzr.s */

static int vortex_Eqlzr_GetLeftGain(vortex_t * vortex, u16 index, u16 * gain)
{}

static void vortex_Eqlzr_SetLeftGain(vortex_t * vortex, u16 index, u16 gain)
{}

static int vortex_Eqlzr_GetRightGain(vortex_t * vortex, u16 index, u16 * gain)
{}

static void vortex_Eqlzr_SetRightGain(vortex_t * vortex, u16 index, u16 gain)
{}

#if 0
static int
vortex_Eqlzr_GetAllBands(vortex_t * vortex, u16 * gains, s32 *cnt)
{
	eqlzr_t *eq = &(vortex->eq);
	int si = 0;

	if (eq->this10 == 0)
		return 1;

	{
		if (vortex_Eqlzr_GetLeftGain(vortex, si, &gains[si]))
			return 1;
		if (vortex_Eqlzr_GetRightGain
		    (vortex, si, &gains[si + eq->this10]))
			return 1;
		si++;
	}
	while (eq->this10 > si) ;
	*cnt = si * 2;
	return 0;
}
#endif
static int vortex_Eqlzr_SetAllBandsFromActiveCoeffSet(vortex_t * vortex)
{}

static int
vortex_Eqlzr_SetAllBands(vortex_t *vortex, const u16 gains[], s32 count)
{}

static void
vortex_Eqlzr_SetA3dBypassGain(vortex_t * vortex, u32 a, u32 b)
{}

static void vortex_Eqlzr_ProgramA3dBypassGain(vortex_t * vortex)
{}

static void vortex_Eqlzr_ShutDownA3d(vortex_t * vortex)
{}

static void vortex_Eqlzr_SetBypass(vortex_t * vortex, u32 bp)
{}

static void vortex_Eqlzr_ReadAndSetActiveCoefSet(vortex_t * vortex)
{}

static int vortex_Eqlzr_GetAllPeaks(vortex_t * vortex, u16 * peaks, int *count)
{}

#if 0
static auxxEqCoeffSet_t *vortex_Eqlzr_GetActiveCoefSet(vortex_t * vortex)
{
	eqlzr_t *eq = &(vortex->eq);

	return (&(eq->coefset));
}
#endif
static void vortex_Eqlzr_init(vortex_t * vortex)
{}

static void vortex_Eqlzr_shutdown(vortex_t * vortex)
{}

/* ALSA interface */

/* Control interface */
#define snd_vortex_eqtoggle_info

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

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

static const struct snd_kcontrol_new vortex_eqtoggle_kcontrol =;

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

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

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

static const struct snd_kcontrol_new vortex_eq_kcontrol =;

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

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

static const struct snd_kcontrol_new vortex_levels_kcontrol =;

/* EQ band gain labels. */
static const char * const EqBandLabels[10] =;

/* ALSA driver entry points. Init and exit. */
static int vortex_eq_init(vortex_t *vortex)
{}

static int vortex_eq_free(vortex_t * vortex)
{}

/* End */