/* <:copyright-BRCM:2018:DUAL/GPL:standard Copyright (c) 2018 Broadcom All Rights Reserved Unless you and Broadcom execute a separate written software license agreement governing use of this software, this software is licensed to you under the terms of the GNU General Public License version 2 (the "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php, with the following added to such license: As a special exception, the copyright holders of this software give you permission to link this software with independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from this software. The special exception does not apply to any modifications of the software. Not withstanding the above, under no circumstances may you combine this software in any way with any other Broadcom software provided under a license other than the GPL, without Broadcom's express prior written consent. :> */ #ifndef _TLV320ADC3101_H #define _TLV320ADC3101_H #define ADC3101_RATES SNDRV_PCM_RATE_8000_192000 #define ADC3101_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \ SNDRV_PCM_FMTBIT_S24_LE | \ SNDRV_PCM_FMTBIT_S32_LE) #define STUB_RATES SNDRV_PCM_RATE_8000_192000 #define STUB_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \ SNDRV_PCM_FMTBIT_S24_LE | \ SNDRV_PCM_FMTBIT_S32_LE) #define MCLK_8192000 8192000 #define MCLK_11289600 11289600 #define MCLK_12288000 12288000 #define MCLK_16384000 16384000 #define MCLK_22579200 22579200 #define MCLK_24576000 24576000 #define MCLK_32768000 32768000 #define MCLK_45158400 45158400 #define MCLK_49152000 49152000 #define ADC3101_PAGE1 128 /* page 0 */ #define ADC3101_PSEL 0 /*reg 0*/ #define ADC3101_RESET 1 #define ADC3101_CLKMUX 4 /* reg 4 */ #define ADC3101_PLLCLKIN 0x03 #define ADC3101_CODECCLKIN_MCLK ( 0x00 << 0 ) #define ADC3101_CODECCLKIN_BCLK ( 0x01 << 0 ) #define ADC3101_CODECCLKIN_PLL ( 0x11 << 0 ) #define ADC3101_PLLCLKIN_MCLK ( 0x00 << 2 ) #define ADC3101_PLLCLKIN_BCLK ( 0x01 << 2 ) #define ADC3101_PLLCLKIN_LOGIC ( 0x11 << 2 ) #define ADC3101_PLLPR 5 #define ADC3101_PLLEN ( 0x01 << 7 ) #define ADC3101_PLLJ 6 #define ADC3101_PLLDMSB 7 #define ADC3101_PLLDLSB 8 #define ADC3101_NDAC 11 #define ADC3101_NDACEN ( 0x01 << 7 ) #define ADC3101_MDAC 12 #define ADC3101_MDACEN ( 0x01 << 7 ) #define ADC3101_DOSRMSB 13 #define ADC3101_DOSRLSB 14 #define ADC3101_NADC 18 #define ADC3101_NADCEN ( 0x01 << 7 ) #define ADC3101_MADC 19 #define ADC3101_MADCEN ( 0x01 << 7 ) #define ADC3101_AOSR 20 #define ADC3101_CLKMUX2 25 #define ADC3101_CLKOUTM 26 #define ADC3101_IFACE1 27 #define ADC3101_AUDIO_INTERFACE_SHIFT 6 #define ADC3101_I2S_MODE 0x00 #define ADC3101_DSP_MODE 0x01 #define ADC3101_RIGHT_JUSTIFIED_MODE 0x02 #define ADC3101_LEFT_JUSTIFIED_MODE 0x03 #define ADC3101_AUDIO_DATA_LENGTH_SHIFT 4 #define ADC3101_WORD_LEN_16BITS 0x00 #define ADC3101_WORD_LEN_20BITS 0x01 #define ADC3101_WORD_LEN_24BITS 0x02 #define ADC3101_WORD_LEN_32BITS 0x03 #define ADC3101_BCLK_DIR_SHIFT 3 #define ADC3101_WCLK_DIR_SHIFT 2 #define ADC3101_PLLJ_SHIFT 6 #define ADC3101_DOSRMSB_SHIFT 4 #define ADC3101_DATASLOT_OFFSET 28 #define ADC3101_IFACE2 29 #define ADC3101_DACMOD2BCLK 0x01 #define I2S_DEFAULT_BIT_POL 0 #define I2S_DEFAULT_BIT_POL_SHIFT 3 #define I2S_DEFAULT_BIT_POL_MASK ( 1<