linux/sound/pci/au88x0/au88x0_xtalk.c

// SPDX-License-Identifier: GPL-2.0-or-later
/***************************************************************************
 *            au88x0_cxtalk.c
 *
 *  Wed Nov 19 16:29:47 2003
 *  Copyright  2003  mjander
 *  [email protected]
 ****************************************************************************/

/*
 */

#include "au88x0_xtalk.h"

/* Data (a whole lot of data.... ) */

static short const sXtalkWideKLeftEq =;
static short const sXtalkWideKRightEq =;
static short const sXtalkWideKLeftXt =;
static __maybe_unused short const sXtalkWideKRightXt =;
static short const sXtalkWideShiftLeftEq =;
static short const sXtalkWideShiftRightEq =;
static short const sXtalkWideShiftLeftXt =;
static __maybe_unused short const sXtalkWideShiftRightXt =;
static unsigned short const wXtalkWideLeftDelay =;
static unsigned short const wXtalkWideRightDelay =;
static short const sXtalkNarrowKLeftEq =;
static short const sXtalkNarrowKRightEq =;
static short const sXtalkNarrowKLeftXt =;
static __maybe_unused short const sXtalkNarrowKRightXt =;
static short const sXtalkNarrowShiftLeftEq =;
static short const sXtalkNarrowShiftRightEq =;
static short const sXtalkNarrowShiftLeftXt =;
static __maybe_unused short const sXtalkNarrowShiftRightXt =;
static unsigned short const wXtalkNarrowLeftDelay =;
static unsigned short const wXtalkNarrowRightDelay =;

static __maybe_unused xtalk_gains_t const asXtalkGainsDefault =;

static __maybe_unused xtalk_gains_t const asXtalkGainsTest =;

static __maybe_unused xtalk_gains_t const asXtalkGains1Chan =;

// Input gain for 4 A3D slices. One possible input pair is left zero.
static xtalk_gains_t const asXtalkGainsAllChan =;

static xtalk_gains_t const asXtalkGainsZeros =;

static xtalk_dline_t const alXtalkDlineZeros =;
static __maybe_unused xtalk_dline_t const alXtalkDlineTest =;

static xtalk_instate_t const asXtalkInStateZeros =;

static __maybe_unused xtalk_instate_t const asXtalkInStateTest =;

static xtalk_state_t const asXtalkOutStateZeros =;

static short const sDiamondKLeftEq =;
static short const sDiamondKRightEq =;
static short const sDiamondKLeftXt =;
static __maybe_unused short const sDiamondKRightXt =;
static short const sDiamondShiftLeftEq =;
static short const sDiamondShiftRightEq =;
static short const sDiamondShiftLeftXt =;
static __maybe_unused short const sDiamondShiftRightXt =;
static unsigned short const wDiamondLeftDelay =;
static unsigned short const wDiamondRightDelay =;

static xtalk_coefs_t const asXtalkWideCoefsLeftEq =;
static xtalk_coefs_t const asXtalkWideCoefsRightEq =;
static xtalk_coefs_t const asXtalkWideCoefsLeftXt =;
static __maybe_unused xtalk_coefs_t const asXtalkWideCoefsRightXt =;
static xtalk_coefs_t const asXtalkNarrowCoefsLeftEq =;

static xtalk_coefs_t const asXtalkNarrowCoefsRightEq =;

static xtalk_coefs_t const asXtalkNarrowCoefsLeftXt =;

static __maybe_unused xtalk_coefs_t const asXtalkNarrowCoefsRightXt =;

static xtalk_coefs_t const asXtalkCoefsZeros =;

static xtalk_coefs_t const asXtalkCoefsPipe =;
static __maybe_unused xtalk_coefs_t const asXtalkCoefsNegPipe =;

static __maybe_unused xtalk_coefs_t const asXtalkCoefsNumTest =;

static __maybe_unused xtalk_coefs_t const asXtalkCoefsDenTest =;

static __maybe_unused xtalk_state_t const asXtalkOutStateTest =;

static xtalk_coefs_t const asDiamondCoefsLeftEq =;

static xtalk_coefs_t const asDiamondCoefsRightEq =;

static xtalk_coefs_t const asDiamondCoefsLeftXt =;

static __maybe_unused xtalk_coefs_t const asDiamondCoefsRightXt =;

 /**/
/* XTalk EQ and XT */
static void
vortex_XtalkHw_SetLeftEQ(vortex_t * vortex, short arg_0, short arg_4,
			 xtalk_coefs_t const coefs)
{}

static void
vortex_XtalkHw_SetRightEQ(vortex_t * vortex, short arg_0, short arg_4,
			  xtalk_coefs_t const coefs)
{}

static void
vortex_XtalkHw_SetLeftXT(vortex_t * vortex, short arg_0, short arg_4,
			 xtalk_coefs_t const coefs)
{}

static void
vortex_XtalkHw_SetRightXT(vortex_t * vortex, short arg_0, short arg_4,
			  xtalk_coefs_t const coefs)
{}

static void
vortex_XtalkHw_SetLeftEQStates(vortex_t * vortex,
			       xtalk_instate_t const arg_0,
			       xtalk_state_t const coefs)
{}

static void
vortex_XtalkHw_SetRightEQStates(vortex_t * vortex,
				xtalk_instate_t const arg_0,
				xtalk_state_t const coefs)
{}

static void
vortex_XtalkHw_SetLeftXTStates(vortex_t * vortex,
			       xtalk_instate_t const arg_0,
			       xtalk_state_t const coefs)
{}

static void
vortex_XtalkHw_SetRightXTStates(vortex_t * vortex,
				xtalk_instate_t const arg_0,
				xtalk_state_t const coefs)
{}

#if 0
static void
vortex_XtalkHw_GetLeftEQ(vortex_t * vortex, short *arg_0, short *arg_4,
			 xtalk_coefs_t coefs)
{
	int i;

	for (i = 0; i < 5; i++) {
		coefs[i][0] = hwread(vortex->mmio, 0x24200 + i * 0x24);
		coefs[i][1] = hwread(vortex->mmio, 0x24204 + i * 0x24);
		coefs[i][2] = hwread(vortex->mmio, 0x24208 + i * 0x24);
		coefs[i][3] = hwread(vortex->mmio, 0x2420c + i * 0x24);
		coefs[i][4] = hwread(vortex->mmio, 0x24210 + i * 0x24);
	}
	*arg_0 = hwread(vortex->mmio, 0x24538) & 0xffff;
	*arg_4 = hwread(vortex->mmio, 0x2453c) & 0xffff;
}

static void
vortex_XtalkHw_GetRightEQ(vortex_t * vortex, short *arg_0, short *arg_4,
			  xtalk_coefs_t coefs)
{
	int i;

	for (i = 0; i < 5; i++) {
		coefs[i][0] = hwread(vortex->mmio, 0x242b4 + i * 0x24);
		coefs[i][1] = hwread(vortex->mmio, 0x242b8 + i * 0x24);
		coefs[i][2] = hwread(vortex->mmio, 0x242bc + i * 0x24);
		coefs[i][3] = hwread(vortex->mmio, 0x242c0 + i * 0x24);
		coefs[i][4] = hwread(vortex->mmio, 0x242c4 + i * 0x24);
	}
	*arg_0 = hwread(vortex->mmio, 0x24540) & 0xffff;
	*arg_4 = hwread(vortex->mmio, 0x24544) & 0xffff;
}

static void
vortex_XtalkHw_GetLeftXT(vortex_t * vortex, short *arg_0, short *arg_4,
			 xtalk_coefs_t coefs)
{
	int i;

	for (i = 0; i < 5; i++) {
		coefs[i][0] = hwread(vortex->mmio, 0x24368 + i * 0x24);
		coefs[i][1] = hwread(vortex->mmio, 0x2436C + i * 0x24);
		coefs[i][2] = hwread(vortex->mmio, 0x24370 + i * 0x24);
		coefs[i][3] = hwread(vortex->mmio, 0x24374 + i * 0x24);
		coefs[i][4] = hwread(vortex->mmio, 0x24378 + i * 0x24);
	}
	*arg_0 = hwread(vortex->mmio, 0x24548) & 0xffff;
	*arg_4 = hwread(vortex->mmio, 0x2454C) & 0xffff;
}

static void
vortex_XtalkHw_GetRightXT(vortex_t * vortex, short *arg_0, short *arg_4,
			  xtalk_coefs_t coefs)
{
	int i;

	for (i = 0; i < 5; i++) {
		coefs[i][0] = hwread(vortex->mmio, 0x2441C + i * 0x24);
		coefs[i][1] = hwread(vortex->mmio, 0x24420 + i * 0x24);
		coefs[i][2] = hwread(vortex->mmio, 0x24424 + i * 0x24);
		coefs[i][3] = hwread(vortex->mmio, 0x24428 + i * 0x24);
		coefs[i][4] = hwread(vortex->mmio, 0x2442C + i * 0x24);
	}
	*arg_0 = hwread(vortex->mmio, 0x24550) & 0xffff;
	*arg_4 = hwread(vortex->mmio, 0x24554) & 0xffff;
}

static void
vortex_XtalkHw_GetLeftEQStates(vortex_t * vortex, xtalk_instate_t arg_0,
			       xtalk_state_t coefs)
{
	int i;

	for (i = 0; i < 5; i++) {
		coefs[i][0] = hwread(vortex->mmio, 0x24214 + i * 0x24);
		coefs[i][1] = hwread(vortex->mmio, 0x24218 + i * 0x24);
		coefs[i][2] = hwread(vortex->mmio, 0x2421C + i * 0x24);
		coefs[i][3] = hwread(vortex->mmio, 0x24220 + i * 0x24);
	}
	arg_0[0] = hwread(vortex->mmio, 0x244F8);
	arg_0[1] = hwread(vortex->mmio, 0x244FC);
	arg_0[2] = hwread(vortex->mmio, 0x24500);
	arg_0[3] = hwread(vortex->mmio, 0x24504);
}

static void
vortex_XtalkHw_GetRightEQStates(vortex_t * vortex, xtalk_instate_t arg_0,
				xtalk_state_t coefs)
{
	int i;

	for (i = 0; i < 5; i++) {
		coefs[i][0] = hwread(vortex->mmio, 0x242C8 + i * 0x24);
		coefs[i][1] = hwread(vortex->mmio, 0x242CC + i * 0x24);
		coefs[i][2] = hwread(vortex->mmio, 0x242D0 + i * 0x24);
		coefs[i][3] = hwread(vortex->mmio, 0x242D4 + i * 0x24);
	}
	arg_0[0] = hwread(vortex->mmio, 0x24508);
	arg_0[1] = hwread(vortex->mmio, 0x2450C);
	arg_0[2] = hwread(vortex->mmio, 0x24510);
	arg_0[3] = hwread(vortex->mmio, 0x24514);
}

static void
vortex_XtalkHw_GetLeftXTStates(vortex_t * vortex, xtalk_instate_t arg_0,
			       xtalk_state_t coefs)
{
	int i;

	for (i = 0; i < 5; i++) {
		coefs[i][0] = hwread(vortex->mmio, 0x2437C + i * 0x24);
		coefs[i][1] = hwread(vortex->mmio, 0x24380 + i * 0x24);
		coefs[i][2] = hwread(vortex->mmio, 0x24384 + i * 0x24);
		coefs[i][3] = hwread(vortex->mmio, 0x24388 + i * 0x24);
	}
	arg_0[0] = hwread(vortex->mmio, 0x24518);
	arg_0[1] = hwread(vortex->mmio, 0x2451C);
	arg_0[2] = hwread(vortex->mmio, 0x24520);
	arg_0[3] = hwread(vortex->mmio, 0x24524);
}

static void
vortex_XtalkHw_GetRightXTStates(vortex_t * vortex, xtalk_instate_t arg_0,
				xtalk_state_t coefs)
{
	int i;

	for (i = 0; i < 5; i++) {
		coefs[i][0] = hwread(vortex->mmio, 0x24430 + i * 0x24);
		coefs[i][1] = hwread(vortex->mmio, 0x24434 + i * 0x24);
		coefs[i][2] = hwread(vortex->mmio, 0x24438 + i * 0x24);
		coefs[i][3] = hwread(vortex->mmio, 0x2443C + i * 0x24);
	}
	arg_0[0] = hwread(vortex->mmio, 0x24528);
	arg_0[1] = hwread(vortex->mmio, 0x2452C);
	arg_0[2] = hwread(vortex->mmio, 0x24530);
	arg_0[3] = hwread(vortex->mmio, 0x24534);
}

#endif
/* Gains */

static void
vortex_XtalkHw_SetGains(vortex_t * vortex, xtalk_gains_t const gains)
{}

static void
vortex_XtalkHw_SetGainsAllChan(vortex_t * vortex)
{}

#if 0
static void vortex_XtalkHw_GetGains(vortex_t * vortex, xtalk_gains_t gains)
{
	int i;

	for (i = 0; i < XTGAINS_SZ; i++)
		gains[i] = hwread(vortex->mmio, 0x244D0 + i * 4);
}

#endif
/* Delay parameters */

static void
vortex_XtalkHw_SetDelay(vortex_t * vortex, unsigned short right,
			unsigned short left)
{}

static void
vortex_XtalkHw_SetLeftDline(vortex_t * vortex, xtalk_dline_t const dline)
{}

static void
vortex_XtalkHw_SetRightDline(vortex_t * vortex, xtalk_dline_t const dline)
{}

#if 0
static void
vortex_XtalkHw_GetDelay(vortex_t * vortex, unsigned short *right,
			unsigned short *left)
{
	int esp0;

	esp0 = hwread(vortex->mmio, 0x24660);
	*right = (esp0 >> 8) & 0x1f;
	*left = (esp0 >> 0xd) & 0x1f;
}

static void vortex_XtalkHw_GetLeftDline(vortex_t * vortex, xtalk_dline_t dline)
{
	int i;

	for (i = 0; i < 0x20; i++) {
		dline[i] =
		    (hwread(vortex->mmio, 0x24000 + (i << 2)) & 0xffff) |
		    (hwread(vortex->mmio, 0x24080 + (i << 2)) << 0x10);
	}
}

static void vortex_XtalkHw_GetRightDline(vortex_t * vortex, xtalk_dline_t dline)
{
	int i;

	for (i = 0; i < 0x20; i++) {
		dline[i] =
		    (hwread(vortex->mmio, 0x24100 + (i << 2)) & 0xffff) |
		    (hwread(vortex->mmio, 0x24180 + (i << 2)) << 0x10);
	}
}

#endif
/* Control/Global stuff */

#if 0
static void vortex_XtalkHw_SetControlReg(vortex_t * vortex, u32 ctrl)
{
	hwwrite(vortex->mmio, 0x24660, ctrl);
}
static void vortex_XtalkHw_GetControlReg(vortex_t * vortex, u32 *ctrl)
{
	*ctrl = hwread(vortex->mmio, 0x24660);
}
#endif
static void vortex_XtalkHw_SetSampleRate(vortex_t * vortex, u32 sr)
{}

#if 0
static void vortex_XtalkHw_GetSampleRate(vortex_t * vortex, u32 *sr)
{
	*sr = (hwread(vortex->mmio, 0x24660) >> 3) & 0x1f;
}

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

static void vortex_XtalkHw_Disable(vortex_t * vortex)
{}

static void vortex_XtalkHw_ZeroIO(vortex_t * vortex)
{}

static void vortex_XtalkHw_ZeroState(vortex_t * vortex)
{}

static void vortex_XtalkHw_ProgramPipe(vortex_t * vortex)
{}

static void vortex_XtalkHw_ProgramXtalkWide(vortex_t * vortex)
{}

static void vortex_XtalkHw_ProgramXtalkNarrow(vortex_t * vortex)
{}

static void vortex_XtalkHw_ProgramDiamondXtalk(vortex_t * vortex)
{}

static void vortex_XtalkHw_init(vortex_t * vortex)
{}

/* End of file */