xref: /openbmc/linux/sound/pci/ice1712/delta.h (revision 22d55f02)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 #ifndef __SOUND_DELTA_H
3 #define __SOUND_DELTA_H
4 
5 /*
6  *   ALSA driver for ICEnsemble ICE1712 (Envy24)
7  *
8  *   Lowlevel functions for M-Audio Delta 1010, 44, 66, Dio2496, Audiophile
9  *                          Digigram VX442
10  *
11  *	Copyright (c) 2000 Jaroslav Kysela <perex@perex.cz>
12  */
13 
14 #define DELTA_DEVICE_DESC \
15 		"{MidiMan M Audio,Delta 1010},"\
16 		"{MidiMan M Audio,Delta 1010LT},"\
17 		"{MidiMan M Audio,Delta DiO 2496},"\
18 		"{MidiMan M Audio,Delta 66},"\
19 		"{MidiMan M Audio,Delta 44},"\
20 		"{MidiMan M Audio,Delta 410},"\
21 		"{MidiMan M Audio,Audiophile 24/96},"\
22 		"{Digigram,VX442},"\
23 		"{Lionstracs,Mediastation},"\
24 		"{Edirol,DA2496},"
25 
26 #define ICE1712_SUBDEVICE_DELTA1010	0x121430d6
27 #define ICE1712_SUBDEVICE_DELTA1010E	0xff1430d6
28 #define ICE1712_SUBDEVICE_DELTADIO2496	0x121431d6
29 #define ICE1712_SUBDEVICE_DELTA66	0x121432d6
30 #define ICE1712_SUBDEVICE_DELTA66E	0xff1432d6
31 #define ICE1712_SUBDEVICE_DELTA44	0x121433d6
32 #define ICE1712_SUBDEVICE_AUDIOPHILE	0x121434d6
33 #define ICE1712_SUBDEVICE_DELTA410	0x121438d6
34 #define ICE1712_SUBDEVICE_DELTA1010LT	0x12143bd6
35 #define ICE1712_SUBDEVICE_VX442		0x12143cd6
36 #define ICE1712_SUBDEVICE_MEDIASTATION	0x694c0100
37 #define ICE1712_SUBDEVICE_EDIROLDA2496	0xce164010
38 
39 /* entry point */
40 extern struct snd_ice1712_card_info snd_ice1712_delta_cards[];
41 
42 
43 /*
44  *  MidiMan M-Audio Delta GPIO definitions
45  */
46 
47 /* MidiMan M-Audio Delta shared pins */
48 #define ICE1712_DELTA_DFS 0x01		/* fast/slow sample rate mode */
49 					/* (>48kHz must be 1) */
50 #define ICE1712_DELTA_SPDIF_IN_STAT 0x02
51 					/* S/PDIF input status */
52 					/* 0 = valid signal is present */
53 					/* all except Delta44 */
54 					/* look to CS8414 datasheet */
55 #define ICE1712_DELTA_SPDIF_OUT_STAT_CLOCK 0x04
56 					/* S/PDIF output status clock */
57 					/* (writing on rising edge - 0->1) */
58 					/* all except Delta44 */
59 					/* look to CS8404A datasheet */
60 #define ICE1712_DELTA_SPDIF_OUT_STAT_DATA 0x08
61 					/* S/PDIF output status data */
62 					/* all except Delta44 */
63 					/* look to CS8404A datasheet */
64 /* MidiMan M-Audio DeltaDiO */
65 /* 0x01 = DFS */
66 /* 0x02 = SPDIF_IN_STAT */
67 /* 0x04 = SPDIF_OUT_STAT_CLOCK */
68 /* 0x08 = SPDIF_OUT_STAT_DATA */
69 #define ICE1712_DELTA_SPDIF_INPUT_SELECT 0x10
70 					/* coaxial (0), optical (1) */
71 					/* S/PDIF input select*/
72 
73 /* MidiMan M-Audio Delta1010 */
74 /* 0x01 = DFS */
75 /* 0x02 = SPDIF_IN_STAT */
76 /* 0x04 = SPDIF_OUT_STAT_CLOCK */
77 /* 0x08 = SPDIF_OUT_STAT_DATA */
78 #define ICE1712_DELTA_WORD_CLOCK_SELECT 0x10
79 					/* 1 - clock are taken from S/PDIF input */
80 					/* 0 - clock are taken from Word Clock input */
81 					/* affected SPMCLKIN pin of Envy24 */
82 #define ICE1712_DELTA_WORD_CLOCK_STATUS	0x20
83 					/* 0 = valid word clock signal is present */
84 
85 /* MidiMan M-Audio Delta66 */
86 /* 0x01 = DFS */
87 /* 0x02 = SPDIF_IN_STAT */
88 /* 0x04 = SPDIF_OUT_STAT_CLOCK */
89 /* 0x08 = SPDIF_OUT_STAT_DATA */
90 #define ICE1712_DELTA_CODEC_SERIAL_DATA 0x10
91 					/* AKM4524 serial data */
92 #define ICE1712_DELTA_CODEC_SERIAL_CLOCK 0x20
93 					/* AKM4524 serial clock */
94 					/* (writing on rising edge - 0->1 */
95 #define ICE1712_DELTA_CODEC_CHIP_A	0x40
96 #define ICE1712_DELTA_CODEC_CHIP_B	0x80
97 					/* 1 - select chip A or B */
98 
99 /* MidiMan M-Audio Delta44 */
100 /* 0x01 = DFS */
101 /* 0x10 = CODEC_SERIAL_DATA */
102 /* 0x20 = CODEC_SERIAL_CLOCK */
103 /* 0x40 = CODEC_CHIP_A */
104 /* 0x80 = CODEC_CHIP_B */
105 
106 /* MidiMan M-Audio Audiophile/Delta410 definitions */
107 /* thanks to Kristof Pelckmans <Kristof.Pelckmans@antwerpen.be> for Delta410 info */
108 /* 0x01 = DFS */
109 #define ICE1712_DELTA_AP_CCLK	0x02	/* SPI clock */
110 					/* (clocking on rising edge - 0->1) */
111 #define ICE1712_DELTA_AP_DIN	0x04	/* data input */
112 #define ICE1712_DELTA_AP_DOUT	0x08	/* data output */
113 #define ICE1712_DELTA_AP_CS_DIGITAL 0x10 /* CS8427 chip select */
114 					/* low signal = select */
115 #define ICE1712_DELTA_AP_CS_CODEC 0x20	/* AK4528 (audiophile), AK4529 (Delta410) chip select */
116 					/* low signal = select */
117 
118 /* MidiMan M-Audio Delta1010LT definitions */
119 /* thanks to Anders Johansson <ajh@watri.uwa.edu.au> */
120 /* 0x01 = DFS */
121 #define ICE1712_DELTA_1010LT_CCLK	0x02	/* SPI clock (AK4524 + CS8427) */
122 #define ICE1712_DELTA_1010LT_DIN	0x04	/* data input (CS8427) */
123 #define ICE1712_DELTA_1010LT_DOUT	0x08	/* data output (AK4524 + CS8427) */
124 #define ICE1712_DELTA_1010LT_CS		0x70	/* mask for CS address */
125 #define ICE1712_DELTA_1010LT_CS_CHIP_A	0x00	/* AK4524 #0 */
126 #define ICE1712_DELTA_1010LT_CS_CHIP_B	0x10	/* AK4524 #1 */
127 #define ICE1712_DELTA_1010LT_CS_CHIP_C	0x20	/* AK4524 #2 */
128 #define ICE1712_DELTA_1010LT_CS_CHIP_D	0x30	/* AK4524 #3 */
129 #define ICE1712_DELTA_1010LT_CS_CS8427	0x40	/* CS8427 */
130 #define ICE1712_DELTA_1010LT_CS_NONE	0x50	/* nothing */
131 #define ICE1712_DELTA_1010LT_WORDCLOCK 0x80	/* sample clock source: 0 = Word Clock Input, 1 = S/PDIF Input ??? */
132 
133 /* M-Audio Delta 66 rev. E definitions.
134  * Newer revisions of Delta 66 have CS8427 over SPI for
135  * S/PDIF transceiver instead of CS8404/CS8414. */
136 /* 0x01 = DFS */
137 #define ICE1712_DELTA_66E_CCLK		0x02	/* SPI clock */
138 #define ICE1712_DELTA_66E_DIN		0x04	/* data input */
139 #define ICE1712_DELTA_66E_DOUT		0x08	/* data output */
140 #define ICE1712_DELTA_66E_CS_CS8427	0x10	/* chip select, low = CS8427 */
141 #define ICE1712_DELTA_66E_CS_CHIP_A	0x20	/* AK4524 #0 */
142 #define ICE1712_DELTA_66E_CS_CHIP_B	0x40	/* AK4524 #1 */
143 
144 /* Digigram VX442 definitions */
145 #define ICE1712_VX442_CCLK		0x02	/* SPI clock */
146 #define ICE1712_VX442_DIN		0x04	/* data input */
147 #define ICE1712_VX442_DOUT		0x08	/* data output */
148 #define ICE1712_VX442_CS_DIGITAL	0x10	/* chip select, low = CS8427 */
149 #define ICE1712_VX442_CODEC_CHIP_A	0x20	/* select chip A */
150 #define ICE1712_VX442_CODEC_CHIP_B	0x40	/* select chip B */
151 
152 #endif /* __SOUND_DELTA_H */
153