xref: /linux/sound/pci/aw2/aw2-tsl.c (revision 26170691ffbb05f161d1ba21465497b4ba2502cd)
1023b915eSThomas Gleixner // SPDX-License-Identifier: GPL-2.0-only
291662577STakashi Iwai /*****************************************************************************
391662577STakashi Iwai  *
491662577STakashi Iwai  * Copyright (C) 2008 Cedric Bregardis <cedric.bregardis@free.fr> and
591662577STakashi Iwai  * Jean-Christian Hassler <jhassler@free.fr>
691662577STakashi Iwai  * Copyright 1998 Emagic Soft- und Hardware GmbH
791662577STakashi Iwai  * Copyright 2002 Martijn Sipkema
891662577STakashi Iwai  *
991662577STakashi Iwai  * This file is part of the Audiowerk2 ALSA driver
1091662577STakashi Iwai  *
1191662577STakashi Iwai  *****************************************************************************/
1291662577STakashi Iwai 
1391662577STakashi Iwai #define TSL_WS0		(1UL << 31)
1491662577STakashi Iwai #define	TSL_WS1		(1UL << 30)
1591662577STakashi Iwai #define	TSL_WS2		(1UL << 29)
1691662577STakashi Iwai #define TSL_WS3		(1UL << 28)
1791662577STakashi Iwai #define TSL_WS4		(1UL << 27)
1891662577STakashi Iwai #define	TSL_DIS_A1	(1UL << 24)
1991662577STakashi Iwai #define TSL_SDW_A1	(1UL << 23)
2091662577STakashi Iwai #define TSL_SIB_A1	(1UL << 22)
2191662577STakashi Iwai #define TSL_SF_A1	(1UL << 21)
2291662577STakashi Iwai #define	TSL_LF_A1	(1UL << 20)
2391662577STakashi Iwai #define TSL_BSEL_A1	(1UL << 17)
2491662577STakashi Iwai #define TSL_DOD_A1	(1UL << 15)
2591662577STakashi Iwai #define TSL_LOW_A1	(1UL << 14)
2691662577STakashi Iwai #define TSL_DIS_A2	(1UL << 11)
2791662577STakashi Iwai #define TSL_SDW_A2	(1UL << 10)
2891662577STakashi Iwai #define TSL_SIB_A2	(1UL << 9)
2991662577STakashi Iwai #define TSL_SF_A2	(1UL << 8)
3091662577STakashi Iwai #define TSL_LF_A2	(1UL << 7)
3191662577STakashi Iwai #define TSL_BSEL_A2	(1UL << 4)
3291662577STakashi Iwai #define TSL_DOD_A2	(1UL << 2)
3391662577STakashi Iwai #define TSL_LOW_A2	(1UL << 1)
3491662577STakashi Iwai #define TSL_EOS		(1UL << 0)
3591662577STakashi Iwai 
3691662577STakashi Iwai     /* Audiowerk8 hardware setup: */
3791662577STakashi Iwai     /*      WS0, SD4, TSL1  - Analog/ digital in */
3891662577STakashi Iwai     /*      WS1, SD0, TSL1  - Analog out #1, digital out */
3991662577STakashi Iwai     /*      WS2, SD2, TSL1  - Analog out #2 */
4091662577STakashi Iwai     /*      WS3, SD1, TSL2  - Analog out #3 */
4191662577STakashi Iwai     /*      WS4, SD3, TSL2  - Analog out #4 */
4291662577STakashi Iwai 
4391662577STakashi Iwai     /* Audiowerk8 timing: */
4491662577STakashi Iwai     /*      Timeslot:     | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | ... */
4591662577STakashi Iwai 
4691662577STakashi Iwai     /*      A1_INPUT: */
4791662577STakashi Iwai     /*      SD4:          <_ADC-L_>-------<_ADC-R_>-------< */
4891662577STakashi Iwai     /*      WS0:          _______________/---------------\_ */
4991662577STakashi Iwai 
5091662577STakashi Iwai     /*      A1_OUTPUT: */
5191662577STakashi Iwai     /*      SD0:          <_1-L___>-------<_1-R___>-------< */
5291662577STakashi Iwai     /*      WS1:          _______________/---------------\_ */
5391662577STakashi Iwai     /*      SD2:          >-------<_2-L___>-------<_2-R___> */
5491662577STakashi Iwai     /*      WS2:          -------\_______________/--------- */
5591662577STakashi Iwai 
5691662577STakashi Iwai     /*      A2_OUTPUT: */
5791662577STakashi Iwai     /*      SD1:          <_3-L___>-------<_3-R___>-------< */
5891662577STakashi Iwai     /*      WS3:          _______________/---------------\_ */
5991662577STakashi Iwai     /*      SD3:          >-------<_4-L___>-------<_4-R___> */
6091662577STakashi Iwai     /*      WS4:          -------\_______________/--------- */
6191662577STakashi Iwai 
62*26170691STakashi Iwai static const int tsl1[8] = {
6391662577STakashi Iwai 	1 * TSL_SDW_A1 | 3 * TSL_BSEL_A1 |
6491662577STakashi Iwai 	0 * TSL_DIS_A1 | 0 * TSL_DOD_A1 | TSL_LF_A1,
6591662577STakashi Iwai 
6691662577STakashi Iwai 	1 * TSL_SDW_A1 | 2 * TSL_BSEL_A1 |
6791662577STakashi Iwai 	0 * TSL_DIS_A1 | 0 * TSL_DOD_A1,
6891662577STakashi Iwai 
6991662577STakashi Iwai 	0 * TSL_SDW_A1 | 3 * TSL_BSEL_A1 |
7091662577STakashi Iwai 	0 * TSL_DIS_A1 | 0 * TSL_DOD_A1,
7191662577STakashi Iwai 
7291662577STakashi Iwai 	0 * TSL_SDW_A1 | 2 * TSL_BSEL_A1 |
7391662577STakashi Iwai 	0 * TSL_DIS_A1 | 0 * TSL_DOD_A1,
7491662577STakashi Iwai 
7591662577STakashi Iwai 	1 * TSL_SDW_A1 | 1 * TSL_BSEL_A1 |
7691662577STakashi Iwai 	0 * TSL_DIS_A1 | 0 * TSL_DOD_A1 | TSL_WS1 | TSL_WS0,
7791662577STakashi Iwai 
7891662577STakashi Iwai 	1 * TSL_SDW_A1 | 0 * TSL_BSEL_A1 |
7991662577STakashi Iwai 	0 * TSL_DIS_A1 | 0 * TSL_DOD_A1 | TSL_WS1 | TSL_WS0,
8091662577STakashi Iwai 
8191662577STakashi Iwai 	0 * TSL_SDW_A1 | 1 * TSL_BSEL_A1 |
8291662577STakashi Iwai 	0 * TSL_DIS_A1 | 0 * TSL_DOD_A1 | TSL_WS1 | TSL_WS0,
8391662577STakashi Iwai 
8491662577STakashi Iwai 	0 * TSL_SDW_A1 | 0 * TSL_BSEL_A1 | 0 * TSL_DIS_A1 |
8591662577STakashi Iwai 	0 * TSL_DOD_A1 | TSL_WS1 | TSL_WS0 | TSL_SF_A1 | TSL_EOS,
8691662577STakashi Iwai };
8791662577STakashi Iwai 
88*26170691STakashi Iwai static const int tsl2[8] = {
8991662577STakashi Iwai 	0 * TSL_SDW_A2 | 3 * TSL_BSEL_A2 | 2 * TSL_DOD_A2 | TSL_LF_A2,
9091662577STakashi Iwai 	0 * TSL_SDW_A2 | 2 * TSL_BSEL_A2 | 2 * TSL_DOD_A2,
9191662577STakashi Iwai 	0 * TSL_SDW_A2 | 3 * TSL_BSEL_A2 | 2 * TSL_DOD_A2,
9291662577STakashi Iwai 	0 * TSL_SDW_A2 | 2 * TSL_BSEL_A2 | 2 * TSL_DOD_A2,
9391662577STakashi Iwai 	0 * TSL_SDW_A2 | 1 * TSL_BSEL_A2 | 2 * TSL_DOD_A2 | TSL_WS2,
9491662577STakashi Iwai 	0 * TSL_SDW_A2 | 0 * TSL_BSEL_A2 | 2 * TSL_DOD_A2 | TSL_WS2,
9591662577STakashi Iwai 	0 * TSL_SDW_A2 | 1 * TSL_BSEL_A2 | 2 * TSL_DOD_A2 | TSL_WS2,
9691662577STakashi Iwai 	0 * TSL_SDW_A2 | 0 * TSL_BSEL_A2 | 2 * TSL_DOD_A2 | TSL_WS2 | TSL_EOS
9791662577STakashi Iwai };
98