162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
262306a36Sopenharmony_ci#ifndef __SOUND_DELTA_H
362306a36Sopenharmony_ci#define __SOUND_DELTA_H
462306a36Sopenharmony_ci
562306a36Sopenharmony_ci/*
662306a36Sopenharmony_ci *   ALSA driver for ICEnsemble ICE1712 (Envy24)
762306a36Sopenharmony_ci *
862306a36Sopenharmony_ci *   Lowlevel functions for M-Audio Delta 1010, 44, 66, Dio2496, Audiophile
962306a36Sopenharmony_ci *                          Digigram VX442
1062306a36Sopenharmony_ci *
1162306a36Sopenharmony_ci *	Copyright (c) 2000 Jaroslav Kysela <perex@perex.cz>
1262306a36Sopenharmony_ci */
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ci#define DELTA_DEVICE_DESC \
1562306a36Sopenharmony_ci		"{MidiMan M Audio,Delta 1010},"\
1662306a36Sopenharmony_ci		"{MidiMan M Audio,Delta 1010LT},"\
1762306a36Sopenharmony_ci		"{MidiMan M Audio,Delta DiO 2496},"\
1862306a36Sopenharmony_ci		"{MidiMan M Audio,Delta 66},"\
1962306a36Sopenharmony_ci		"{MidiMan M Audio,Delta 44},"\
2062306a36Sopenharmony_ci		"{MidiMan M Audio,Delta 410},"\
2162306a36Sopenharmony_ci		"{MidiMan M Audio,Audiophile 24/96},"\
2262306a36Sopenharmony_ci		"{Digigram,VX442},"\
2362306a36Sopenharmony_ci		"{Lionstracs,Mediastation},"\
2462306a36Sopenharmony_ci		"{Edirol,DA2496},"
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_ci#define ICE1712_SUBDEVICE_DELTA1010	0x121430d6
2762306a36Sopenharmony_ci#define ICE1712_SUBDEVICE_DELTA1010E	0xff1430d6
2862306a36Sopenharmony_ci#define ICE1712_SUBDEVICE_DELTADIO2496	0x121431d6
2962306a36Sopenharmony_ci#define ICE1712_SUBDEVICE_DELTA66	0x121432d6
3062306a36Sopenharmony_ci#define ICE1712_SUBDEVICE_DELTA66E	0xff1432d6
3162306a36Sopenharmony_ci#define ICE1712_SUBDEVICE_DELTA44	0x121433d6
3262306a36Sopenharmony_ci#define ICE1712_SUBDEVICE_AUDIOPHILE	0x121434d6
3362306a36Sopenharmony_ci#define ICE1712_SUBDEVICE_DELTA410	0x121438d6
3462306a36Sopenharmony_ci#define ICE1712_SUBDEVICE_DELTA1010LT	0x12143bd6
3562306a36Sopenharmony_ci#define ICE1712_SUBDEVICE_VX442		0x12143cd6
3662306a36Sopenharmony_ci#define ICE1712_SUBDEVICE_MEDIASTATION	0x694c0100
3762306a36Sopenharmony_ci#define ICE1712_SUBDEVICE_EDIROLDA2496	0xce164010
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ci/* entry point */
4062306a36Sopenharmony_ciextern struct snd_ice1712_card_info snd_ice1712_delta_cards[];
4162306a36Sopenharmony_ci
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_ci/*
4462306a36Sopenharmony_ci *  MidiMan M-Audio Delta GPIO definitions
4562306a36Sopenharmony_ci */
4662306a36Sopenharmony_ci
4762306a36Sopenharmony_ci/* MidiMan M-Audio Delta shared pins */
4862306a36Sopenharmony_ci#define ICE1712_DELTA_DFS 0x01		/* fast/slow sample rate mode */
4962306a36Sopenharmony_ci					/* (>48kHz must be 1) */
5062306a36Sopenharmony_ci#define ICE1712_DELTA_SPDIF_IN_STAT 0x02
5162306a36Sopenharmony_ci					/* S/PDIF input status */
5262306a36Sopenharmony_ci					/* 0 = valid signal is present */
5362306a36Sopenharmony_ci					/* all except Delta44 */
5462306a36Sopenharmony_ci					/* look to CS8414 datasheet */
5562306a36Sopenharmony_ci#define ICE1712_DELTA_SPDIF_OUT_STAT_CLOCK 0x04
5662306a36Sopenharmony_ci					/* S/PDIF output status clock */
5762306a36Sopenharmony_ci					/* (writing on rising edge - 0->1) */
5862306a36Sopenharmony_ci					/* all except Delta44 */
5962306a36Sopenharmony_ci					/* look to CS8404A datasheet */
6062306a36Sopenharmony_ci#define ICE1712_DELTA_SPDIF_OUT_STAT_DATA 0x08
6162306a36Sopenharmony_ci					/* S/PDIF output status data */
6262306a36Sopenharmony_ci					/* all except Delta44 */
6362306a36Sopenharmony_ci					/* look to CS8404A datasheet */
6462306a36Sopenharmony_ci/* MidiMan M-Audio DeltaDiO */
6562306a36Sopenharmony_ci/* 0x01 = DFS */
6662306a36Sopenharmony_ci/* 0x02 = SPDIF_IN_STAT */
6762306a36Sopenharmony_ci/* 0x04 = SPDIF_OUT_STAT_CLOCK */
6862306a36Sopenharmony_ci/* 0x08 = SPDIF_OUT_STAT_DATA */
6962306a36Sopenharmony_ci#define ICE1712_DELTA_SPDIF_INPUT_SELECT 0x10
7062306a36Sopenharmony_ci					/* coaxial (0), optical (1) */
7162306a36Sopenharmony_ci					/* S/PDIF input select*/
7262306a36Sopenharmony_ci
7362306a36Sopenharmony_ci/* MidiMan M-Audio Delta1010 */
7462306a36Sopenharmony_ci/* 0x01 = DFS */
7562306a36Sopenharmony_ci/* 0x02 = SPDIF_IN_STAT */
7662306a36Sopenharmony_ci/* 0x04 = SPDIF_OUT_STAT_CLOCK */
7762306a36Sopenharmony_ci/* 0x08 = SPDIF_OUT_STAT_DATA */
7862306a36Sopenharmony_ci#define ICE1712_DELTA_WORD_CLOCK_SELECT 0x10
7962306a36Sopenharmony_ci					/* 1 - clock are taken from S/PDIF input */
8062306a36Sopenharmony_ci					/* 0 - clock are taken from Word Clock input */
8162306a36Sopenharmony_ci					/* affected SPMCLKIN pin of Envy24 */
8262306a36Sopenharmony_ci#define ICE1712_DELTA_WORD_CLOCK_STATUS	0x20
8362306a36Sopenharmony_ci					/* 0 = valid word clock signal is present */
8462306a36Sopenharmony_ci
8562306a36Sopenharmony_ci/* MidiMan M-Audio Delta66 */
8662306a36Sopenharmony_ci/* 0x01 = DFS */
8762306a36Sopenharmony_ci/* 0x02 = SPDIF_IN_STAT */
8862306a36Sopenharmony_ci/* 0x04 = SPDIF_OUT_STAT_CLOCK */
8962306a36Sopenharmony_ci/* 0x08 = SPDIF_OUT_STAT_DATA */
9062306a36Sopenharmony_ci#define ICE1712_DELTA_CODEC_SERIAL_DATA 0x10
9162306a36Sopenharmony_ci					/* AKM4524 serial data */
9262306a36Sopenharmony_ci#define ICE1712_DELTA_CODEC_SERIAL_CLOCK 0x20
9362306a36Sopenharmony_ci					/* AKM4524 serial clock */
9462306a36Sopenharmony_ci					/* (writing on rising edge - 0->1 */
9562306a36Sopenharmony_ci#define ICE1712_DELTA_CODEC_CHIP_A	0x40
9662306a36Sopenharmony_ci#define ICE1712_DELTA_CODEC_CHIP_B	0x80
9762306a36Sopenharmony_ci					/* 1 - select chip A or B */
9862306a36Sopenharmony_ci
9962306a36Sopenharmony_ci/* MidiMan M-Audio Delta44 */
10062306a36Sopenharmony_ci/* 0x01 = DFS */
10162306a36Sopenharmony_ci/* 0x10 = CODEC_SERIAL_DATA */
10262306a36Sopenharmony_ci/* 0x20 = CODEC_SERIAL_CLOCK */
10362306a36Sopenharmony_ci/* 0x40 = CODEC_CHIP_A */
10462306a36Sopenharmony_ci/* 0x80 = CODEC_CHIP_B */
10562306a36Sopenharmony_ci
10662306a36Sopenharmony_ci/* MidiMan M-Audio Audiophile/Delta410 definitions */
10762306a36Sopenharmony_ci/* thanks to Kristof Pelckmans <Kristof.Pelckmans@antwerpen.be> for Delta410 info */
10862306a36Sopenharmony_ci/* 0x01 = DFS */
10962306a36Sopenharmony_ci#define ICE1712_DELTA_AP_CCLK	0x02	/* SPI clock */
11062306a36Sopenharmony_ci					/* (clocking on rising edge - 0->1) */
11162306a36Sopenharmony_ci#define ICE1712_DELTA_AP_DIN	0x04	/* data input */
11262306a36Sopenharmony_ci#define ICE1712_DELTA_AP_DOUT	0x08	/* data output */
11362306a36Sopenharmony_ci#define ICE1712_DELTA_AP_CS_DIGITAL 0x10 /* CS8427 chip select */
11462306a36Sopenharmony_ci					/* low signal = select */
11562306a36Sopenharmony_ci#define ICE1712_DELTA_AP_CS_CODEC 0x20	/* AK4528 (audiophile), AK4529 (Delta410) chip select */
11662306a36Sopenharmony_ci					/* low signal = select */
11762306a36Sopenharmony_ci
11862306a36Sopenharmony_ci/* MidiMan M-Audio Delta1010LT definitions */
11962306a36Sopenharmony_ci/* thanks to Anders Johansson <ajh@watri.uwa.edu.au> */
12062306a36Sopenharmony_ci/* 0x01 = DFS */
12162306a36Sopenharmony_ci#define ICE1712_DELTA_1010LT_CCLK	0x02	/* SPI clock (AK4524 + CS8427) */
12262306a36Sopenharmony_ci#define ICE1712_DELTA_1010LT_DIN	0x04	/* data input (CS8427) */
12362306a36Sopenharmony_ci#define ICE1712_DELTA_1010LT_DOUT	0x08	/* data output (AK4524 + CS8427) */
12462306a36Sopenharmony_ci#define ICE1712_DELTA_1010LT_CS		0x70	/* mask for CS address */
12562306a36Sopenharmony_ci#define ICE1712_DELTA_1010LT_CS_CHIP_A	0x00	/* AK4524 #0 */
12662306a36Sopenharmony_ci#define ICE1712_DELTA_1010LT_CS_CHIP_B	0x10	/* AK4524 #1 */
12762306a36Sopenharmony_ci#define ICE1712_DELTA_1010LT_CS_CHIP_C	0x20	/* AK4524 #2 */
12862306a36Sopenharmony_ci#define ICE1712_DELTA_1010LT_CS_CHIP_D	0x30	/* AK4524 #3 */
12962306a36Sopenharmony_ci#define ICE1712_DELTA_1010LT_CS_CS8427	0x40	/* CS8427 */
13062306a36Sopenharmony_ci#define ICE1712_DELTA_1010LT_CS_NONE	0x50	/* nothing */
13162306a36Sopenharmony_ci#define ICE1712_DELTA_1010LT_WORDCLOCK 0x80	/* sample clock source: 0 = Word Clock Input, 1 = S/PDIF Input ??? */
13262306a36Sopenharmony_ci
13362306a36Sopenharmony_ci/* M-Audio Delta 66 rev. E definitions.
13462306a36Sopenharmony_ci * Newer revisions of Delta 66 have CS8427 over SPI for
13562306a36Sopenharmony_ci * S/PDIF transceiver instead of CS8404/CS8414. */
13662306a36Sopenharmony_ci/* 0x01 = DFS */
13762306a36Sopenharmony_ci#define ICE1712_DELTA_66E_CCLK		0x02	/* SPI clock */
13862306a36Sopenharmony_ci#define ICE1712_DELTA_66E_DIN		0x04	/* data input */
13962306a36Sopenharmony_ci#define ICE1712_DELTA_66E_DOUT		0x08	/* data output */
14062306a36Sopenharmony_ci#define ICE1712_DELTA_66E_CS_CS8427	0x10	/* chip select, low = CS8427 */
14162306a36Sopenharmony_ci#define ICE1712_DELTA_66E_CS_CHIP_A	0x20	/* AK4524 #0 */
14262306a36Sopenharmony_ci#define ICE1712_DELTA_66E_CS_CHIP_B	0x40	/* AK4524 #1 */
14362306a36Sopenharmony_ci
14462306a36Sopenharmony_ci/* Digigram VX442 definitions */
14562306a36Sopenharmony_ci#define ICE1712_VX442_CCLK		0x02	/* SPI clock */
14662306a36Sopenharmony_ci#define ICE1712_VX442_DIN		0x04	/* data input */
14762306a36Sopenharmony_ci#define ICE1712_VX442_DOUT		0x08	/* data output */
14862306a36Sopenharmony_ci#define ICE1712_VX442_CS_DIGITAL	0x10	/* chip select, low = CS8427 */
14962306a36Sopenharmony_ci#define ICE1712_VX442_CODEC_CHIP_A	0x20	/* select chip A */
15062306a36Sopenharmony_ci#define ICE1712_VX442_CODEC_CHIP_B	0x40	/* select chip B */
15162306a36Sopenharmony_ci
15262306a36Sopenharmony_ci#endif /* __SOUND_DELTA_H */
153