xref: /openbmc/linux/sound/pci/ice1712/delta.h (revision bf748ed7)
11da177e4SLinus Torvalds #ifndef __SOUND_DELTA_H
21da177e4SLinus Torvalds #define __SOUND_DELTA_H
31da177e4SLinus Torvalds 
41da177e4SLinus Torvalds /*
51da177e4SLinus Torvalds  *   ALSA driver for ICEnsemble ICE1712 (Envy24)
61da177e4SLinus Torvalds  *
71da177e4SLinus Torvalds  *   Lowlevel functions for M-Audio Delta 1010, 44, 66, Dio2496, Audiophile
81da177e4SLinus Torvalds  *                          Digigram VX442
91da177e4SLinus Torvalds  *
101da177e4SLinus Torvalds  *	Copyright (c) 2000 Jaroslav Kysela <perex@suse.cz>
111da177e4SLinus Torvalds  *
121da177e4SLinus Torvalds  *   This program is free software; you can redistribute it and/or modify
131da177e4SLinus Torvalds  *   it under the terms of the GNU General Public License as published by
141da177e4SLinus Torvalds  *   the Free Software Foundation; either version 2 of the License, or
151da177e4SLinus Torvalds  *   (at your option) any later version.
161da177e4SLinus Torvalds  *
171da177e4SLinus Torvalds  *   This program is distributed in the hope that it will be useful,
181da177e4SLinus Torvalds  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
191da177e4SLinus Torvalds  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
201da177e4SLinus Torvalds  *   GNU General Public License for more details.
211da177e4SLinus Torvalds  *
221da177e4SLinus Torvalds  *   You should have received a copy of the GNU General Public License
231da177e4SLinus Torvalds  *   along with this program; if not, write to the Free Software
241da177e4SLinus Torvalds  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
251da177e4SLinus Torvalds  *
261da177e4SLinus Torvalds  */
271da177e4SLinus Torvalds 
281da177e4SLinus Torvalds #define DELTA_DEVICE_DESC \
291da177e4SLinus Torvalds 		"{MidiMan M Audio,Delta 1010},"\
301da177e4SLinus Torvalds 		"{MidiMan M Audio,Delta 1010LT},"\
311da177e4SLinus Torvalds 		"{MidiMan M Audio,Delta DiO 2496},"\
321da177e4SLinus Torvalds 		"{MidiMan M Audio,Delta 66},"\
331da177e4SLinus Torvalds 		"{MidiMan M Audio,Delta 44},"\
341da177e4SLinus Torvalds 		"{MidiMan M Audio,Audiophile 24/96},"\
351da177e4SLinus Torvalds 		"{Digigram,VX442},"\
361da177e4SLinus Torvalds 		"{Lionstracs,Mediastation},"
371da177e4SLinus Torvalds 
381da177e4SLinus Torvalds #define ICE1712_SUBDEVICE_DELTA1010	0x121430d6
391da177e4SLinus Torvalds #define ICE1712_SUBDEVICE_DELTADIO2496	0x121431d6
401da177e4SLinus Torvalds #define ICE1712_SUBDEVICE_DELTA66	0x121432d6
411da177e4SLinus Torvalds #define ICE1712_SUBDEVICE_DELTA44	0x121433d6
421da177e4SLinus Torvalds #define ICE1712_SUBDEVICE_AUDIOPHILE	0x121434d6
431da177e4SLinus Torvalds #define ICE1712_SUBDEVICE_DELTA410	0x121438d6
441da177e4SLinus Torvalds #define ICE1712_SUBDEVICE_DELTA1010LT	0x12143bd6
451da177e4SLinus Torvalds #define ICE1712_SUBDEVICE_VX442		0x12143cd6
461da177e4SLinus Torvalds #define ICE1712_SUBDEVICE_MEDIASTATION	0x694c0100
471da177e4SLinus Torvalds 
481da177e4SLinus Torvalds /* entry point */
49bf748ed7SRalf Baechle extern struct snd_ice1712_card_info snd_ice1712_delta_cards[];
501da177e4SLinus Torvalds 
511da177e4SLinus Torvalds 
521da177e4SLinus Torvalds /*
531da177e4SLinus Torvalds  *  MidiMan M-Audio Delta GPIO definitions
541da177e4SLinus Torvalds  */
551da177e4SLinus Torvalds 
561da177e4SLinus Torvalds /* MidiMan M-Audio Delta shared pins */
571da177e4SLinus Torvalds #define ICE1712_DELTA_DFS 0x01		/* fast/slow sample rate mode */
581da177e4SLinus Torvalds 					/* (>48kHz must be 1) */
591da177e4SLinus Torvalds #define ICE1712_DELTA_SPDIF_IN_STAT 0x02
601da177e4SLinus Torvalds 					/* S/PDIF input status */
611da177e4SLinus Torvalds 					/* 0 = valid signal is present */
621da177e4SLinus Torvalds 					/* all except Delta44 */
631da177e4SLinus Torvalds 					/* look to CS8414 datasheet */
641da177e4SLinus Torvalds #define ICE1712_DELTA_SPDIF_OUT_STAT_CLOCK 0x04
651da177e4SLinus Torvalds 					/* S/PDIF output status clock */
66beb7dd86SRobert P. J. Day 					/* (writing on rising edge - 0->1) */
671da177e4SLinus Torvalds 					/* all except Delta44 */
681da177e4SLinus Torvalds 					/* look to CS8404A datasheet */
691da177e4SLinus Torvalds #define ICE1712_DELTA_SPDIF_OUT_STAT_DATA 0x08
701da177e4SLinus Torvalds 					/* S/PDIF output status data */
711da177e4SLinus Torvalds 					/* all except Delta44 */
721da177e4SLinus Torvalds 					/* look to CS8404A datasheet */
731da177e4SLinus Torvalds /* MidiMan M-Audio DeltaDiO */
741da177e4SLinus Torvalds /* 0x01 = DFS */
751da177e4SLinus Torvalds /* 0x02 = SPDIF_IN_STAT */
761da177e4SLinus Torvalds /* 0x04 = SPDIF_OUT_STAT_CLOCK */
771da177e4SLinus Torvalds /* 0x08 = SPDIF_OUT_STAT_DATA */
781da177e4SLinus Torvalds #define ICE1712_DELTA_SPDIF_INPUT_SELECT 0x10
791da177e4SLinus Torvalds 					/* coaxial (0), optical (1) */
801da177e4SLinus Torvalds 					/* S/PDIF input select*/
811da177e4SLinus Torvalds 
821da177e4SLinus Torvalds /* MidiMan M-Audio Delta1010 */
831da177e4SLinus Torvalds /* 0x01 = DFS */
841da177e4SLinus Torvalds /* 0x02 = SPDIF_IN_STAT */
851da177e4SLinus Torvalds /* 0x04 = SPDIF_OUT_STAT_CLOCK */
861da177e4SLinus Torvalds /* 0x08 = SPDIF_OUT_STAT_DATA */
871da177e4SLinus Torvalds #define ICE1712_DELTA_WORD_CLOCK_SELECT 0x10
881da177e4SLinus Torvalds 					/* 1 - clock are taken from S/PDIF input */
891da177e4SLinus Torvalds 					/* 0 - clock are taken from Word Clock input */
901da177e4SLinus Torvalds 					/* affected SPMCLKIN pin of Envy24 */
911da177e4SLinus Torvalds #define ICE1712_DELTA_WORD_CLOCK_STATUS	0x20
921da177e4SLinus Torvalds 					/* 0 = valid word clock signal is present */
931da177e4SLinus Torvalds 
941da177e4SLinus Torvalds /* MidiMan M-Audio Delta66 */
951da177e4SLinus Torvalds /* 0x01 = DFS */
961da177e4SLinus Torvalds /* 0x02 = SPDIF_IN_STAT */
971da177e4SLinus Torvalds /* 0x04 = SPDIF_OUT_STAT_CLOCK */
981da177e4SLinus Torvalds /* 0x08 = SPDIF_OUT_STAT_DATA */
991da177e4SLinus Torvalds #define ICE1712_DELTA_CODEC_SERIAL_DATA 0x10
1001da177e4SLinus Torvalds 					/* AKM4524 serial data */
1011da177e4SLinus Torvalds #define ICE1712_DELTA_CODEC_SERIAL_CLOCK 0x20
1021da177e4SLinus Torvalds 					/* AKM4524 serial clock */
103beb7dd86SRobert P. J. Day 					/* (writing on rising edge - 0->1 */
1041da177e4SLinus Torvalds #define ICE1712_DELTA_CODEC_CHIP_A	0x40
1051da177e4SLinus Torvalds #define ICE1712_DELTA_CODEC_CHIP_B	0x80
1061da177e4SLinus Torvalds 					/* 1 - select chip A or B */
1071da177e4SLinus Torvalds 
1081da177e4SLinus Torvalds /* MidiMan M-Audio Delta44 */
1091da177e4SLinus Torvalds /* 0x01 = DFS */
1101da177e4SLinus Torvalds /* 0x10 = CODEC_SERIAL_DATA */
1111da177e4SLinus Torvalds /* 0x20 = CODEC_SERIAL_CLOCK */
1121da177e4SLinus Torvalds /* 0x40 = CODEC_CHIP_A */
1131da177e4SLinus Torvalds /* 0x80 = CODEC_CHIP_B */
1141da177e4SLinus Torvalds 
1151da177e4SLinus Torvalds /* MidiMan M-Audio Audiophile/Delta410 definitions */
1161da177e4SLinus Torvalds /* thanks to Kristof Pelckmans <Kristof.Pelckmans@antwerpen.be> for Delta410 info */
1171da177e4SLinus Torvalds /* 0x01 = DFS */
1181da177e4SLinus Torvalds #define ICE1712_DELTA_AP_CCLK	0x02	/* SPI clock */
1191da177e4SLinus Torvalds 					/* (clocking on rising edge - 0->1) */
1201da177e4SLinus Torvalds #define ICE1712_DELTA_AP_DIN	0x04	/* data input */
1211da177e4SLinus Torvalds #define ICE1712_DELTA_AP_DOUT	0x08	/* data output */
1221da177e4SLinus Torvalds #define ICE1712_DELTA_AP_CS_DIGITAL 0x10 /* CS8427 chip select */
1231da177e4SLinus Torvalds 					/* low signal = select */
1241da177e4SLinus Torvalds #define ICE1712_DELTA_AP_CS_CODEC 0x20	/* AK4528 (audiophile), AK4529 (Delta410) chip select */
1251da177e4SLinus Torvalds 					/* low signal = select */
1261da177e4SLinus Torvalds 
1271da177e4SLinus Torvalds /* MidiMan M-Audio Delta1010LT definitions */
1281da177e4SLinus Torvalds /* thanks to Anders Johansson <ajh@watri.uwa.edu.au> */
1291da177e4SLinus Torvalds /* 0x01 = DFS */
1301da177e4SLinus Torvalds #define ICE1712_DELTA_1010LT_CCLK	0x02	/* SPI clock (AK4524 + CS8427) */
1311da177e4SLinus Torvalds #define ICE1712_DELTA_1010LT_DIN	0x04	/* data input (CS8427) */
1321da177e4SLinus Torvalds #define ICE1712_DELTA_1010LT_DOUT	0x08	/* data output (AK4524 + CS8427) */
1331da177e4SLinus Torvalds #define ICE1712_DELTA_1010LT_CS		0x70	/* mask for CS address */
1341da177e4SLinus Torvalds #define ICE1712_DELTA_1010LT_CS_CHIP_A	0x00	/* AK4524 #0 */
1351da177e4SLinus Torvalds #define ICE1712_DELTA_1010LT_CS_CHIP_B	0x10	/* AK4524 #1 */
1361da177e4SLinus Torvalds #define ICE1712_DELTA_1010LT_CS_CHIP_C	0x20	/* AK4524 #2 */
1371da177e4SLinus Torvalds #define ICE1712_DELTA_1010LT_CS_CHIP_D	0x30	/* AK4524 #3 */
1381da177e4SLinus Torvalds #define ICE1712_DELTA_1010LT_CS_CS8427	0x40	/* CS8427 */
1391da177e4SLinus Torvalds #define ICE1712_DELTA_1010LT_CS_NONE	0x50	/* nothing */
1401da177e4SLinus Torvalds #define ICE1712_DELTA_1010LT_WORDCLOCK 0x80	/* sample clock source: 0 = Word Clock Input, 1 = S/PDIF Input ??? */
1411da177e4SLinus Torvalds 
1421da177e4SLinus Torvalds /* Digigram VX442 definitions */
1431da177e4SLinus Torvalds #define ICE1712_VX442_CCLK		0x02	/* SPI clock */
1441da177e4SLinus Torvalds #define ICE1712_VX442_DIN		0x04	/* data input */
1451da177e4SLinus Torvalds #define ICE1712_VX442_DOUT		0x08	/* data output */
1461da177e4SLinus Torvalds #define ICE1712_VX442_CS_DIGITAL	0x10	/* chip select, low = CS8427 */
1471da177e4SLinus Torvalds #define ICE1712_VX442_CODEC_CHIP_A	0x20	/* select chip A */
1481da177e4SLinus Torvalds #define ICE1712_VX442_CODEC_CHIP_B	0x40	/* select chip B */
1491da177e4SLinus Torvalds 
1501da177e4SLinus Torvalds #endif /* __SOUND_DELTA_H */
151