/*****************************************************************************1*2* Copyright (C) 2008 Cedric Bregardis <[email protected]> and3* Jean-Christian Hassler <[email protected]>4* Copyright 1998 Emagic Soft- und Hardware GmbH5* Copyright 2002 Martijn Sipkema6*7* This file is part of the Audiowerk2 ALSA driver8*9* The Audiowerk2 ALSA driver is free software; you can redistribute it and/or10* modify it under the terms of the GNU General Public License as published by11* the Free Software Foundation; version 2.12*13* The Audiowerk2 ALSA driver is distributed in the hope that it will be useful,14* but WITHOUT ANY WARRANTY; without even the implied warranty of15* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16* GNU General Public License for more details.17*18* You should have received a copy of the GNU General Public License19* along with the Audiowerk2 ALSA driver; if not, write to the Free Software20* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,21* USA.22*23*****************************************************************************/2425#define TSL_WS0 (1UL << 31)26#define TSL_WS1 (1UL << 30)27#define TSL_WS2 (1UL << 29)28#define TSL_WS3 (1UL << 28)29#define TSL_WS4 (1UL << 27)30#define TSL_DIS_A1 (1UL << 24)31#define TSL_SDW_A1 (1UL << 23)32#define TSL_SIB_A1 (1UL << 22)33#define TSL_SF_A1 (1UL << 21)34#define TSL_LF_A1 (1UL << 20)35#define TSL_BSEL_A1 (1UL << 17)36#define TSL_DOD_A1 (1UL << 15)37#define TSL_LOW_A1 (1UL << 14)38#define TSL_DIS_A2 (1UL << 11)39#define TSL_SDW_A2 (1UL << 10)40#define TSL_SIB_A2 (1UL << 9)41#define TSL_SF_A2 (1UL << 8)42#define TSL_LF_A2 (1UL << 7)43#define TSL_BSEL_A2 (1UL << 4)44#define TSL_DOD_A2 (1UL << 2)45#define TSL_LOW_A2 (1UL << 1)46#define TSL_EOS (1UL << 0)4748/* Audiowerk8 hardware setup: */49/* WS0, SD4, TSL1 - Analog/ digital in */50/* WS1, SD0, TSL1 - Analog out #1, digital out */51/* WS2, SD2, TSL1 - Analog out #2 */52/* WS3, SD1, TSL2 - Analog out #3 */53/* WS4, SD3, TSL2 - Analog out #4 */5455/* Audiowerk8 timing: */56/* Timeslot: | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | ... */5758/* A1_INPUT: */59/* SD4: <_ADC-L_>-------<_ADC-R_>-------< */60/* WS0: _______________/---------------\_ */6162/* A1_OUTPUT: */63/* SD0: <_1-L___>-------<_1-R___>-------< */64/* WS1: _______________/---------------\_ */65/* SD2: >-------<_2-L___>-------<_2-R___> */66/* WS2: -------\_______________/--------- */6768/* A2_OUTPUT: */69/* SD1: <_3-L___>-------<_3-R___>-------< */70/* WS3: _______________/---------------\_ */71/* SD3: >-------<_4-L___>-------<_4-R___> */72/* WS4: -------\_______________/--------- */7374static int tsl1[8] = {751 * TSL_SDW_A1 | 3 * TSL_BSEL_A1 |760 * TSL_DIS_A1 | 0 * TSL_DOD_A1 | TSL_LF_A1,77781 * TSL_SDW_A1 | 2 * TSL_BSEL_A1 |790 * TSL_DIS_A1 | 0 * TSL_DOD_A1,80810 * TSL_SDW_A1 | 3 * TSL_BSEL_A1 |820 * TSL_DIS_A1 | 0 * TSL_DOD_A1,83840 * TSL_SDW_A1 | 2 * TSL_BSEL_A1 |850 * TSL_DIS_A1 | 0 * TSL_DOD_A1,86871 * TSL_SDW_A1 | 1 * TSL_BSEL_A1 |880 * TSL_DIS_A1 | 0 * TSL_DOD_A1 | TSL_WS1 | TSL_WS0,89901 * TSL_SDW_A1 | 0 * TSL_BSEL_A1 |910 * TSL_DIS_A1 | 0 * TSL_DOD_A1 | TSL_WS1 | TSL_WS0,92930 * TSL_SDW_A1 | 1 * TSL_BSEL_A1 |940 * TSL_DIS_A1 | 0 * TSL_DOD_A1 | TSL_WS1 | TSL_WS0,95960 * TSL_SDW_A1 | 0 * TSL_BSEL_A1 | 0 * TSL_DIS_A1 |970 * TSL_DOD_A1 | TSL_WS1 | TSL_WS0 | TSL_SF_A1 | TSL_EOS,98};99100static int tsl2[8] = {1010 * TSL_SDW_A2 | 3 * TSL_BSEL_A2 | 2 * TSL_DOD_A2 | TSL_LF_A2,1020 * TSL_SDW_A2 | 2 * TSL_BSEL_A2 | 2 * TSL_DOD_A2,1030 * TSL_SDW_A2 | 3 * TSL_BSEL_A2 | 2 * TSL_DOD_A2,1040 * TSL_SDW_A2 | 2 * TSL_BSEL_A2 | 2 * TSL_DOD_A2,1050 * TSL_SDW_A2 | 1 * TSL_BSEL_A2 | 2 * TSL_DOD_A2 | TSL_WS2,1060 * TSL_SDW_A2 | 0 * TSL_BSEL_A2 | 2 * TSL_DOD_A2 | TSL_WS2,1070 * TSL_SDW_A2 | 1 * TSL_BSEL_A2 | 2 * TSL_DOD_A2 | TSL_WS2,1080 * TSL_SDW_A2 | 0 * TSL_BSEL_A2 | 2 * TSL_DOD_A2 | TSL_WS2 | TSL_EOS109};110111112