Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 // TLV320ADCX104 Sound driver
0003 // Copyright (C) 2020 Texas Instruments Incorporated - https://www.ti.com/
0004 
0005 #ifndef _TLV320ADCX140_H
0006 #define _TLV320ADCX140_H
0007 
0008 #define ADCX140_RATES   (SNDRV_PCM_RATE_44100 | \
0009              SNDRV_PCM_RATE_48000)
0010 
0011 #define ADCX140_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \
0012              SNDRV_PCM_FMTBIT_S20_3LE | \
0013              SNDRV_PCM_FMTBIT_S24_3LE | \
0014              SNDRV_PCM_FMTBIT_S24_LE | \
0015              SNDRV_PCM_FMTBIT_S32_LE)
0016 
0017 #define ADCX140_PAGE_SELECT 0x00
0018 #define ADCX140_SW_RESET    0x01
0019 #define ADCX140_SLEEP_CFG   0x02
0020 #define ADCX140_SHDN_CFG    0x05
0021 #define ADCX140_ASI_CFG0    0x07
0022 #define ADCX140_ASI_CFG1    0x08
0023 #define ADCX140_ASI_CFG2    0x09
0024 #define ADCX140_ASI_CH1     0x0b
0025 #define ADCX140_ASI_CH2     0x0c
0026 #define ADCX140_ASI_CH3     0x0d
0027 #define ADCX140_ASI_CH4     0x0e
0028 #define ADCX140_ASI_CH5     0x0f
0029 #define ADCX140_ASI_CH6     0x10
0030 #define ADCX140_ASI_CH7     0x11
0031 #define ADCX140_ASI_CH8     0x12
0032 #define ADCX140_MST_CFG0    0x13
0033 #define ADCX140_MST_CFG1    0x14
0034 #define ADCX140_ASI_STS     0x15
0035 #define ADCX140_CLK_SRC     0x16
0036 #define ADCX140_PDMCLK_CFG  0x1f
0037 #define ADCX140_PDM_CFG     0x20
0038 #define ADCX140_GPIO_CFG0   0x21
0039 #define ADCX140_GPO_CFG0    0x22
0040 #define ADCX140_GPO_CFG1    0x23
0041 #define ADCX140_GPO_CFG2    0x24
0042 #define ADCX140_GPO_CFG3    0x25
0043 #define ADCX140_GPO_VAL     0x29
0044 #define ADCX140_GPIO_MON    0x2a
0045 #define ADCX140_GPI_CFG0    0x2b
0046 #define ADCX140_GPI_CFG1    0x2c
0047 #define ADCX140_GPI_MON     0x2f
0048 #define ADCX140_INT_CFG     0x32
0049 #define ADCX140_INT_MASK0   0x33
0050 #define ADCX140_INT_LTCH0   0x36
0051 #define ADCX140_BIAS_CFG    0x3b
0052 #define ADCX140_CH1_CFG0    0x3c
0053 #define ADCX140_CH1_CFG1    0x3d
0054 #define ADCX140_CH1_CFG2    0x3e
0055 #define ADCX140_CH1_CFG3    0x3f
0056 #define ADCX140_CH1_CFG4    0x40
0057 #define ADCX140_CH2_CFG0    0x41
0058 #define ADCX140_CH2_CFG1    0x42
0059 #define ADCX140_CH2_CFG2    0x43
0060 #define ADCX140_CH2_CFG3    0x44
0061 #define ADCX140_CH2_CFG4    0x45
0062 #define ADCX140_CH3_CFG0    0x46
0063 #define ADCX140_CH3_CFG1    0x47
0064 #define ADCX140_CH3_CFG2    0x48
0065 #define ADCX140_CH3_CFG3    0x49
0066 #define ADCX140_CH3_CFG4    0x4a
0067 #define ADCX140_CH4_CFG0    0x4b
0068 #define ADCX140_CH4_CFG1    0x4c
0069 #define ADCX140_CH4_CFG2    0x4d
0070 #define ADCX140_CH4_CFG3    0x4e
0071 #define ADCX140_CH4_CFG4    0x4f
0072 #define ADCX140_CH5_CFG2    0x52
0073 #define ADCX140_CH5_CFG3    0x53
0074 #define ADCX140_CH5_CFG4    0x54
0075 #define ADCX140_CH6_CFG2    0x57
0076 #define ADCX140_CH6_CFG3    0x58
0077 #define ADCX140_CH6_CFG4    0x59
0078 #define ADCX140_CH7_CFG2    0x5c
0079 #define ADCX140_CH7_CFG3    0x5d
0080 #define ADCX140_CH7_CFG4    0x5e
0081 #define ADCX140_CH8_CFG2    0x61
0082 #define ADCX140_CH8_CFG3    0x62
0083 #define ADCX140_CH8_CFG4    0x63
0084 #define ADCX140_DSP_CFG0    0x6b
0085 #define ADCX140_DSP_CFG1    0x6c
0086 #define ADCX140_DRE_CFG0    0x6d
0087 #define ADCX140_AGC_CFG0    0x70
0088 #define ADCX140_IN_CH_EN    0x73
0089 #define ADCX140_ASI_OUT_CH_EN   0x74
0090 #define ADCX140_PWR_CFG     0x75
0091 #define ADCX140_DEV_STS0    0x76
0092 #define ADCX140_DEV_STS1    0x77
0093 
0094 #define ADCX140_RESET   BIT(0)
0095 
0096 #define ADCX140_WAKE_DEV    BIT(0)
0097 #define ADCX140_AREG_INTERNAL   BIT(7)
0098 
0099 #define ADCX140_BCLKINV_BIT BIT(2)
0100 #define ADCX140_FSYNCINV_BIT    BIT(3)
0101 #define ADCX140_INV_MSK     (ADCX140_BCLKINV_BIT | ADCX140_FSYNCINV_BIT)
0102 #define ADCX140_BCLK_FSYNC_MASTER   BIT(7)
0103 #define ADCX140_I2S_MODE_BIT    BIT(6)
0104 #define ADCX140_LEFT_JUST_BIT   BIT(7)
0105 #define ADCX140_ASI_FORMAT_MSK  (ADCX140_I2S_MODE_BIT | ADCX140_LEFT_JUST_BIT)
0106 
0107 #define ADCX140_16_BIT_WORD 0x0
0108 #define ADCX140_20_BIT_WORD BIT(4)
0109 #define ADCX140_24_BIT_WORD BIT(5)
0110 #define ADCX140_32_BIT_WORD (BIT(4) | BIT(5))
0111 #define ADCX140_WORD_LEN_MSK    0x30
0112 
0113 #define ADCX140_MAX_CHANNELS    8
0114 
0115 #define ADCX140_MIC_BIAS_VAL_VREF   0
0116 #define ADCX140_MIC_BIAS_VAL_VREF_1096  1
0117 #define ADCX140_MIC_BIAS_VAL_AVDD   6
0118 #define ADCX140_MIC_BIAS_VAL_MSK GENMASK(6, 4)
0119 #define ADCX140_MIC_BIAS_SHIFT      4
0120 
0121 #define ADCX140_MIC_BIAS_VREF_275V  0
0122 #define ADCX140_MIC_BIAS_VREF_25V   1
0123 #define ADCX140_MIC_BIAS_VREF_1375V 2
0124 #define ADCX140_MIC_BIAS_VREF_MSK GENMASK(1, 0)
0125 
0126 #define ADCX140_PWR_CTRL_MSK    GENMASK(7, 5)
0127 #define ADCX140_PWR_CFG_BIAS_PDZ    BIT(7)
0128 #define ADCX140_PWR_CFG_ADC_PDZ     BIT(6)
0129 #define ADCX140_PWR_CFG_PLL_PDZ     BIT(5)
0130 
0131 #define ADCX140_TX_OFFSET_MASK      GENMASK(4, 0)
0132 
0133 #define ADCX140_NUM_PDM_EDGES       4
0134 #define ADCX140_PDM_EDGE_SHIFT      7
0135 
0136 #define ADCX140_NUM_GPI_PINS        4
0137 #define ADCX140_GPI_SHIFT       4
0138 #define ADCX140_GPI1_INDEX      0
0139 #define ADCX140_GPI2_INDEX      1
0140 #define ADCX140_GPI3_INDEX      2
0141 #define ADCX140_GPI4_INDEX      3
0142 
0143 #define ADCX140_NUM_GPOS        4
0144 #define ADCX140_NUM_GPO_CFGS        2
0145 #define ADCX140_GPO_SHIFT       4
0146 #define ADCX140_GPO_CFG_MAX     4
0147 #define ADCX140_GPO_DRV_MAX     5
0148 
0149 #define ADCX140_TX_FILL    BIT(0)
0150 
0151 #define ADCX140_NUM_GPIO_CFGS       2
0152 #define ADCX140_GPIO_SHIFT      4
0153 #define ADCX140_GPIO_CFG_MAX        15
0154 #define ADCX140_GPIO_DRV_MAX        5
0155 
0156 #endif /* _TLV320ADCX140_ */