/* <:copyright-BRCM:2018:DUAL/GPL:standard Copyright (c) 2018 Broadcom All Rights Reserved This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation (the "GPL"). This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. A copy of the GPL is available at http://www.broadcom.com/licenses/GPLv2.php, or by writing to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. :> */ #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<