Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0
0002  *
0003  * linux/sound/cs35l41.h -- Platform data for CS35L41
0004  *
0005  * Copyright (c) 2017-2021 Cirrus Logic Inc.
0006  *
0007  * Author: David Rhodes <david.rhodes@cirrus.com>
0008  */
0009 
0010 #ifndef __CS35L41_H
0011 #define __CS35L41_H
0012 
0013 #include <linux/regmap.h>
0014 #include <linux/firmware/cirrus/cs_dsp.h>
0015 
0016 #define CS35L41_FIRSTREG        0x00000000
0017 #define CS35L41_LASTREG         0x03804FE8
0018 #define CS35L41_DEVID           0x00000000
0019 #define CS35L41_REVID           0x00000004
0020 #define CS35L41_FABID           0x00000008
0021 #define CS35L41_RELID           0x0000000C
0022 #define CS35L41_OTPID           0x00000010
0023 #define CS35L41_SFT_RESET       0x00000020
0024 #define CS35L41_TEST_KEY_CTL        0x00000040
0025 #define CS35L41_USER_KEY_CTL        0x00000044
0026 #define CS35L41_OTP_MEM0        0x00000400
0027 #define CS35L41_OTP_MEM31       0x0000047C
0028 #define CS35L41_OTP_CTRL0       0x00000500
0029 #define CS35L41_OTP_CTRL1       0x00000504
0030 #define CS35L41_OTP_CTRL3       0x00000508
0031 #define CS35L41_OTP_CTRL4       0x0000050C
0032 #define CS35L41_OTP_CTRL5       0x00000510
0033 #define CS35L41_OTP_CTRL6       0x00000514
0034 #define CS35L41_OTP_CTRL7       0x00000518
0035 #define CS35L41_OTP_CTRL8       0x0000051C
0036 #define CS35L41_PWR_CTRL1       0x00002014
0037 #define CS35L41_PWR_CTRL2       0x00002018
0038 #define CS35L41_PWR_CTRL3       0x0000201C
0039 #define CS35L41_CTRL_OVRRIDE        0x00002020
0040 #define CS35L41_AMP_OUT_MUTE        0x00002024
0041 #define CS35L41_PROTECT_REL_ERR_IGN 0x00002034
0042 #define CS35L41_GPIO_PAD_CONTROL    0x0000242C
0043 #define CS35L41_JTAG_CONTROL        0x00002438
0044 #define CS35L41_PWRMGT_CTL      0x00002900
0045 #define CS35L41_WAKESRC_CTL     0x00002904
0046 #define CS35L41_PWRMGT_STS      0x00002908
0047 #define CS35L41_PLL_CLK_CTRL        0x00002C04
0048 #define CS35L41_DSP_CLK_CTRL        0x00002C08
0049 #define CS35L41_GLOBAL_CLK_CTRL     0x00002C0C
0050 #define CS35L41_DATA_FS_SEL     0x00002C10
0051 #define CS35L41_TST_FS_MON0     0x00002D10
0052 #define CS35L41_MDSYNC_EN       0x00003400
0053 #define CS35L41_MDSYNC_TX_ID        0x00003408
0054 #define CS35L41_MDSYNC_PWR_CTRL     0x0000340C
0055 #define CS35L41_MDSYNC_DATA_TX      0x00003410
0056 #define CS35L41_MDSYNC_TX_STATUS    0x00003414
0057 #define CS35L41_MDSYNC_DATA_RX      0x0000341C
0058 #define CS35L41_MDSYNC_RX_STATUS    0x00003420
0059 #define CS35L41_MDSYNC_ERR_STATUS   0x00003424
0060 #define CS35L41_MDSYNC_SYNC_PTE2    0x00003528
0061 #define CS35L41_MDSYNC_SYNC_PTE3    0x0000352C
0062 #define CS35L41_MDSYNC_SYNC_MSM_STATUS  0x0000353C
0063 #define CS35L41_BSTCVRT_VCTRL1      0x00003800
0064 #define CS35L41_BSTCVRT_VCTRL2      0x00003804
0065 #define CS35L41_BSTCVRT_PEAK_CUR    0x00003808
0066 #define CS35L41_BSTCVRT_SFT_RAMP    0x0000380C
0067 #define CS35L41_BSTCVRT_COEFF       0x00003810
0068 #define CS35L41_BSTCVRT_SLOPE_LBST  0x00003814
0069 #define CS35L41_BSTCVRT_SW_FREQ     0x00003818
0070 #define CS35L41_BSTCVRT_DCM_CTRL    0x0000381C
0071 #define CS35L41_BSTCVRT_DCM_MODE_FORCE  0x00003820
0072 #define CS35L41_BSTCVRT_OVERVOLT_CTRL   0x00003830
0073 #define CS35L41_VI_VOL_POL      0x00004000
0074 #define CS35L41_VIMON_SPKMON_RESYNC 0x00004100
0075 #define CS35L41_DTEMP_WARN_THLD     0x00004220
0076 #define CS35L41_DTEMP_CFG       0x00004224
0077 #define CS35L41_DTEMP_EN        0x00004308
0078 #define CS35L41_VPVBST_FS_SEL       0x00004400
0079 #define CS35L41_SP_ENABLES      0x00004800
0080 #define CS35L41_SP_RATE_CTRL        0x00004804
0081 #define CS35L41_SP_FORMAT       0x00004808
0082 #define CS35L41_SP_HIZ_CTRL     0x0000480C
0083 #define CS35L41_SP_FRAME_TX_SLOT    0x00004810
0084 #define CS35L41_SP_FRAME_RX_SLOT    0x00004820
0085 #define CS35L41_SP_TX_WL        0x00004830
0086 #define CS35L41_SP_RX_WL        0x00004840
0087 #define CS35L41_ASP_CONTROL4        0x00004854
0088 #define CS35L41_DAC_PCM1_SRC        0x00004C00
0089 #define CS35L41_ASP_TX1_SRC     0x00004C20
0090 #define CS35L41_ASP_TX2_SRC     0x00004C24
0091 #define CS35L41_ASP_TX3_SRC     0x00004C28
0092 #define CS35L41_ASP_TX4_SRC     0x00004C2C
0093 #define CS35L41_DSP1_RX1_SRC        0x00004C40
0094 #define CS35L41_DSP1_RX2_SRC        0x00004C44
0095 #define CS35L41_DSP1_RX3_SRC        0x00004C48
0096 #define CS35L41_DSP1_RX4_SRC        0x00004C4C
0097 #define CS35L41_DSP1_RX5_SRC        0x00004C50
0098 #define CS35L41_DSP1_RX6_SRC        0x00004C54
0099 #define CS35L41_DSP1_RX7_SRC        0x00004C58
0100 #define CS35L41_DSP1_RX8_SRC        0x00004C5C
0101 #define CS35L41_NGATE1_SRC      0x00004C60
0102 #define CS35L41_NGATE2_SRC      0x00004C64
0103 #define CS35L41_AMP_DIG_VOL_CTRL    0x00006000
0104 #define CS35L41_VPBR_CFG        0x00006404
0105 #define CS35L41_VBBR_CFG        0x00006408
0106 #define CS35L41_VPBR_STATUS     0x0000640C
0107 #define CS35L41_VBBR_STATUS     0x00006410
0108 #define CS35L41_OVERTEMP_CFG        0x00006414
0109 #define CS35L41_AMP_ERR_VOL     0x00006418
0110 #define CS35L41_VOL_STATUS_TO_DSP   0x00006450
0111 #define CS35L41_CLASSH_CFG      0x00006800
0112 #define CS35L41_WKFET_CFG       0x00006804
0113 #define CS35L41_NG_CFG          0x00006808
0114 #define CS35L41_AMP_GAIN_CTRL       0x00006C04
0115 #define CS35L41_DAC_MSM_CFG     0x00007400
0116 #define CS35L41_IRQ1_CFG        0x00010000
0117 #define CS35L41_IRQ1_STATUS     0x00010004
0118 #define CS35L41_IRQ1_STATUS1        0x00010010
0119 #define CS35L41_IRQ1_STATUS2        0x00010014
0120 #define CS35L41_IRQ1_STATUS3        0x00010018
0121 #define CS35L41_IRQ1_STATUS4        0x0001001C
0122 #define CS35L41_IRQ1_RAW_STATUS1    0x00010090
0123 #define CS35L41_IRQ1_RAW_STATUS2    0x00010094
0124 #define CS35L41_IRQ1_RAW_STATUS3    0x00010098
0125 #define CS35L41_IRQ1_RAW_STATUS4    0x0001009C
0126 #define CS35L41_IRQ1_MASK1      0x00010110
0127 #define CS35L41_IRQ1_MASK2      0x00010114
0128 #define CS35L41_IRQ1_MASK3      0x00010118
0129 #define CS35L41_IRQ1_MASK4      0x0001011C
0130 #define CS35L41_IRQ1_FRC1       0x00010190
0131 #define CS35L41_IRQ1_FRC2       0x00010194
0132 #define CS35L41_IRQ1_FRC3       0x00010198
0133 #define CS35L41_IRQ1_FRC4       0x0001019C
0134 #define CS35L41_IRQ1_EDGE1      0x00010210
0135 #define CS35L41_IRQ1_EDGE4      0x0001021C
0136 #define CS35L41_IRQ1_POL1       0x00010290
0137 #define CS35L41_IRQ1_POL2       0x00010294
0138 #define CS35L41_IRQ1_POL3       0x00010298
0139 #define CS35L41_IRQ1_POL4       0x0001029C
0140 #define CS35L41_IRQ1_DB3        0x00010318
0141 #define CS35L41_IRQ2_CFG        0x00010800
0142 #define CS35L41_IRQ2_STATUS     0x00010804
0143 #define CS35L41_IRQ2_STATUS1        0x00010810
0144 #define CS35L41_IRQ2_STATUS2        0x00010814
0145 #define CS35L41_IRQ2_STATUS3        0x00010818
0146 #define CS35L41_IRQ2_STATUS4        0x0001081C
0147 #define CS35L41_IRQ2_RAW_STATUS1    0x00010890
0148 #define CS35L41_IRQ2_RAW_STATUS2    0x00010894
0149 #define CS35L41_IRQ2_RAW_STATUS3    0x00010898
0150 #define CS35L41_IRQ2_RAW_STATUS4    0x0001089C
0151 #define CS35L41_IRQ2_MASK1      0x00010910
0152 #define CS35L41_IRQ2_MASK2      0x00010914
0153 #define CS35L41_IRQ2_MASK3      0x00010918
0154 #define CS35L41_IRQ2_MASK4      0x0001091C
0155 #define CS35L41_IRQ2_FRC1       0x00010990
0156 #define CS35L41_IRQ2_FRC2       0x00010994
0157 #define CS35L41_IRQ2_FRC3       0x00010998
0158 #define CS35L41_IRQ2_FRC4       0x0001099C
0159 #define CS35L41_IRQ2_EDGE1      0x00010A10
0160 #define CS35L41_IRQ2_EDGE4      0x00010A1C
0161 #define CS35L41_IRQ2_POL1       0x00010A90
0162 #define CS35L41_IRQ2_POL2       0x00010A94
0163 #define CS35L41_IRQ2_POL3       0x00010A98
0164 #define CS35L41_IRQ2_POL4       0x00010A9C
0165 #define CS35L41_IRQ2_DB3        0x00010B18
0166 #define CS35L41_GPIO_STATUS1        0x00011000
0167 #define CS35L41_GPIO1_CTRL1     0x00011008
0168 #define CS35L41_GPIO2_CTRL1     0x0001100C
0169 #define CS35L41_MIXER_NGATE_CFG     0x00012000
0170 #define CS35L41_MIXER_NGATE_CH1_CFG 0x00012004
0171 #define CS35L41_MIXER_NGATE_CH2_CFG 0x00012008
0172 #define CS35L41_DSP_MBOX_1      0x00013000
0173 #define CS35L41_DSP_MBOX_2      0x00013004
0174 #define CS35L41_DSP_MBOX_3      0x00013008
0175 #define CS35L41_DSP_MBOX_4      0x0001300C
0176 #define CS35L41_DSP_MBOX_5      0x00013010
0177 #define CS35L41_DSP_MBOX_6      0x00013014
0178 #define CS35L41_DSP_MBOX_7      0x00013018
0179 #define CS35L41_DSP_MBOX_8      0x0001301C
0180 #define CS35L41_DSP_VIRT1_MBOX_1    0x00013020
0181 #define CS35L41_DSP_VIRT1_MBOX_2    0x00013024
0182 #define CS35L41_DSP_VIRT1_MBOX_3    0x00013028
0183 #define CS35L41_DSP_VIRT1_MBOX_4    0x0001302C
0184 #define CS35L41_DSP_VIRT1_MBOX_5    0x00013030
0185 #define CS35L41_DSP_VIRT1_MBOX_6    0x00013034
0186 #define CS35L41_DSP_VIRT1_MBOX_7    0x00013038
0187 #define CS35L41_DSP_VIRT1_MBOX_8    0x0001303C
0188 #define CS35L41_DSP_VIRT2_MBOX_1    0x00013040
0189 #define CS35L41_DSP_VIRT2_MBOX_2    0x00013044
0190 #define CS35L41_DSP_VIRT2_MBOX_3    0x00013048
0191 #define CS35L41_DSP_VIRT2_MBOX_4    0x0001304C
0192 #define CS35L41_DSP_VIRT2_MBOX_5    0x00013050
0193 #define CS35L41_DSP_VIRT2_MBOX_6    0x00013054
0194 #define CS35L41_DSP_VIRT2_MBOX_7    0x00013058
0195 #define CS35L41_DSP_VIRT2_MBOX_8    0x0001305C
0196 #define CS35L41_CLOCK_DETECT_1      0x00014000
0197 #define CS35L41_TIMER1_CONTROL      0x00015000
0198 #define CS35L41_TIMER1_COUNT_PRESET 0x00015004
0199 #define CS35L41_TIMER1_START_STOP   0x0001500C
0200 #define CS35L41_TIMER1_STATUS       0x00015010
0201 #define CS35L41_TIMER1_COUNT_READBACK   0x00015014
0202 #define CS35L41_TIMER1_DSP_CLK_CFG  0x00015018
0203 #define CS35L41_TIMER1_DSP_CLK_STATUS   0x0001501C
0204 #define CS35L41_TIMER2_CONTROL      0x00015100
0205 #define CS35L41_TIMER2_COUNT_PRESET 0x00015104
0206 #define CS35L41_TIMER2_START_STOP   0x0001510C
0207 #define CS35L41_TIMER2_STATUS       0x00015110
0208 #define CS35L41_TIMER2_COUNT_READBACK   0x00015114
0209 #define CS35L41_TIMER2_DSP_CLK_CFG  0x00015118
0210 #define CS35L41_TIMER2_DSP_CLK_STATUS   0x0001511C
0211 #define CS35L41_DFT_JTAG_CONTROL    0x00016000
0212 #define CS35L41_DIE_STS1        0x00017040
0213 #define CS35L41_DIE_STS2        0x00017044
0214 #define CS35L41_TEMP_CAL1       0x00017048
0215 #define CS35L41_TEMP_CAL2       0x0001704C
0216 #define CS35L41_DSP1_XMEM_PACK_0    0x02000000
0217 #define CS35L41_DSP1_XMEM_PACK_3068 0x02002FF0
0218 #define CS35L41_DSP1_XMEM_UNPACK32_0    0x02400000
0219 #define CS35L41_DSP1_XMEM_UNPACK32_2046 0x02401FF8
0220 #define CS35L41_DSP1_TIMESTAMP_COUNT    0x025C0800
0221 #define CS35L41_DSP1_SYS_ID     0x025E0000
0222 #define CS35L41_DSP1_SYS_VERSION    0x025E0004
0223 #define CS35L41_DSP1_SYS_CORE_ID    0x025E0008
0224 #define CS35L41_DSP1_SYS_AHB_ADDR   0x025E000C
0225 #define CS35L41_DSP1_SYS_XSRAM_SIZE 0x025E0010
0226 #define CS35L41_DSP1_SYS_YSRAM_SIZE 0x025E0018
0227 #define CS35L41_DSP1_SYS_PSRAM_SIZE 0x025E0020
0228 #define CS35L41_DSP1_SYS_PM_BOOT_SIZE   0x025E0028
0229 #define CS35L41_DSP1_SYS_FEATURES   0x025E002C
0230 #define CS35L41_DSP1_SYS_FIR_FILTERS    0x025E0030
0231 #define CS35L41_DSP1_SYS_LMS_FILTERS    0x025E0034
0232 #define CS35L41_DSP1_SYS_XM_BANK_SIZE   0x025E0038
0233 #define CS35L41_DSP1_SYS_YM_BANK_SIZE   0x025E003C
0234 #define CS35L41_DSP1_SYS_PM_BANK_SIZE   0x025E0040
0235 #define CS35L41_DSP1_AHBM_WIN0_CTRL0    0x025E2000
0236 #define CS35L41_DSP1_AHBM_WIN0_CTRL1    0x025E2004
0237 #define CS35L41_DSP1_AHBM_WIN1_CTRL0    0x025E2008
0238 #define CS35L41_DSP1_AHBM_WIN1_CTRL1    0x025E200C
0239 #define CS35L41_DSP1_AHBM_WIN2_CTRL0    0x025E2010
0240 #define CS35L41_DSP1_AHBM_WIN2_CTRL1    0x025E2014
0241 #define CS35L41_DSP1_AHBM_WIN3_CTRL0    0x025E2018
0242 #define CS35L41_DSP1_AHBM_WIN3_CTRL1    0x025E201C
0243 #define CS35L41_DSP1_AHBM_WIN4_CTRL0    0x025E2020
0244 #define CS35L41_DSP1_AHBM_WIN4_CTRL1    0x025E2024
0245 #define CS35L41_DSP1_AHBM_WIN5_CTRL0    0x025E2028
0246 #define CS35L41_DSP1_AHBM_WIN5_CTRL1    0x025E202C
0247 #define CS35L41_DSP1_AHBM_WIN6_CTRL0    0x025E2030
0248 #define CS35L41_DSP1_AHBM_WIN6_CTRL1    0x025E2034
0249 #define CS35L41_DSP1_AHBM_WIN7_CTRL0    0x025E2038
0250 #define CS35L41_DSP1_AHBM_WIN7_CTRL1    0x025E203C
0251 #define CS35L41_DSP1_AHBM_WIN_DBG_CTRL0 0x025E2040
0252 #define CS35L41_DSP1_AHBM_WIN_DBG_CTRL1 0x025E2044
0253 #define CS35L41_DSP1_XMEM_UNPACK24_0    0x02800000
0254 #define CS35L41_DSP1_XMEM_UNPACK24_4093 0x02803FF4
0255 #define CS35L41_DSP1_CTRL_BASE      0x02B80000
0256 #define CS35L41_DSP1_CORE_SOFT_RESET    0x02B80010
0257 #define CS35L41_DSP1_DEBUG      0x02B80040
0258 #define CS35L41_DSP1_TIMER_CTRL     0x02B80048
0259 #define CS35L41_DSP1_STREAM_ARB_CTRL    0x02B80050
0260 #define CS35L41_DSP1_RX1_RATE       0x02B80080
0261 #define CS35L41_DSP1_RX2_RATE       0x02B80088
0262 #define CS35L41_DSP1_RX3_RATE       0x02B80090
0263 #define CS35L41_DSP1_RX4_RATE       0x02B80098
0264 #define CS35L41_DSP1_RX5_RATE       0x02B800A0
0265 #define CS35L41_DSP1_RX6_RATE       0x02B800A8
0266 #define CS35L41_DSP1_RX7_RATE       0x02B800B0
0267 #define CS35L41_DSP1_RX8_RATE       0x02B800B8
0268 #define CS35L41_DSP1_TX1_RATE       0x02B80280
0269 #define CS35L41_DSP1_TX2_RATE       0x02B80288
0270 #define CS35L41_DSP1_TX3_RATE       0x02B80290
0271 #define CS35L41_DSP1_TX4_RATE       0x02B80298
0272 #define CS35L41_DSP1_TX5_RATE       0x02B802A0
0273 #define CS35L41_DSP1_TX6_RATE       0x02B802A8
0274 #define CS35L41_DSP1_TX7_RATE       0x02B802B0
0275 #define CS35L41_DSP1_TX8_RATE       0x02B802B8
0276 #define CS35L41_DSP1_NMI_CTRL1      0x02B80480
0277 #define CS35L41_DSP1_NMI_CTRL2      0x02B80488
0278 #define CS35L41_DSP1_NMI_CTRL3      0x02B80490
0279 #define CS35L41_DSP1_NMI_CTRL4      0x02B80498
0280 #define CS35L41_DSP1_NMI_CTRL5      0x02B804A0
0281 #define CS35L41_DSP1_NMI_CTRL6      0x02B804A8
0282 #define CS35L41_DSP1_NMI_CTRL7      0x02B804B0
0283 #define CS35L41_DSP1_NMI_CTRL8      0x02B804B8
0284 #define CS35L41_DSP1_RESUME_CTRL    0x02B80500
0285 #define CS35L41_DSP1_IRQ1_CTRL      0x02B80508
0286 #define CS35L41_DSP1_IRQ2_CTRL      0x02B80510
0287 #define CS35L41_DSP1_IRQ3_CTRL      0x02B80518
0288 #define CS35L41_DSP1_IRQ4_CTRL      0x02B80520
0289 #define CS35L41_DSP1_IRQ5_CTRL      0x02B80528
0290 #define CS35L41_DSP1_IRQ6_CTRL      0x02B80530
0291 #define CS35L41_DSP1_IRQ7_CTRL      0x02B80538
0292 #define CS35L41_DSP1_IRQ8_CTRL      0x02B80540
0293 #define CS35L41_DSP1_IRQ9_CTRL      0x02B80548
0294 #define CS35L41_DSP1_IRQ10_CTRL     0x02B80550
0295 #define CS35L41_DSP1_IRQ11_CTRL     0x02B80558
0296 #define CS35L41_DSP1_IRQ12_CTRL     0x02B80560
0297 #define CS35L41_DSP1_IRQ13_CTRL     0x02B80568
0298 #define CS35L41_DSP1_IRQ14_CTRL     0x02B80570
0299 #define CS35L41_DSP1_IRQ15_CTRL     0x02B80578
0300 #define CS35L41_DSP1_IRQ16_CTRL     0x02B80580
0301 #define CS35L41_DSP1_IRQ17_CTRL     0x02B80588
0302 #define CS35L41_DSP1_IRQ18_CTRL     0x02B80590
0303 #define CS35L41_DSP1_IRQ19_CTRL     0x02B80598
0304 #define CS35L41_DSP1_IRQ20_CTRL     0x02B805A0
0305 #define CS35L41_DSP1_IRQ21_CTRL     0x02B805A8
0306 #define CS35L41_DSP1_IRQ22_CTRL     0x02B805B0
0307 #define CS35L41_DSP1_IRQ23_CTRL     0x02B805B8
0308 #define CS35L41_DSP1_SCRATCH1       0x02B805C0
0309 #define CS35L41_DSP1_SCRATCH2       0x02B805C8
0310 #define CS35L41_DSP1_SCRATCH3       0x02B805D0
0311 #define CS35L41_DSP1_SCRATCH4       0x02B805D8
0312 #define CS35L41_DSP1_CCM_CORE_CTRL  0x02BC1000
0313 #define CS35L41_DSP1_CCM_CLK_OVERRIDE   0x02BC1008
0314 #define CS35L41_DSP1_XM_MSTR_EN     0x02BC2000
0315 #define CS35L41_DSP1_XM_CORE_PRI    0x02BC2008
0316 #define CS35L41_DSP1_XM_AHB_PACK_PL_PRI 0x02BC2010
0317 #define CS35L41_DSP1_XM_AHB_UP_PL_PRI   0x02BC2018
0318 #define CS35L41_DSP1_XM_ACCEL_PL0_PRI   0x02BC2020
0319 #define CS35L41_DSP1_XM_NPL0_PRI    0x02BC2078
0320 #define CS35L41_DSP1_YM_MSTR_EN     0x02BC20C0
0321 #define CS35L41_DSP1_YM_CORE_PRI    0x02BC20C8
0322 #define CS35L41_DSP1_YM_AHB_PACK_PL_PRI 0x02BC20D0
0323 #define CS35L41_DSP1_YM_AHB_UP_PL_PRI   0x02BC20D8
0324 #define CS35L41_DSP1_YM_ACCEL_PL0_PRI   0x02BC20E0
0325 #define CS35L41_DSP1_YM_NPL0_PRI    0x02BC2138
0326 #define CS35L41_DSP1_PM_MSTR_EN     0x02BC2180
0327 #define CS35L41_DSP1_PM_PATCH0_ADDR 0x02BC2188
0328 #define CS35L41_DSP1_PM_PATCH0_EN   0x02BC218C
0329 #define CS35L41_DSP1_PM_PATCH0_DATA_LO  0x02BC2190
0330 #define CS35L41_DSP1_PM_PATCH0_DATA_HI  0x02BC2194
0331 #define CS35L41_DSP1_PM_PATCH1_ADDR 0x02BC2198
0332 #define CS35L41_DSP1_PM_PATCH1_EN   0x02BC219C
0333 #define CS35L41_DSP1_PM_PATCH1_DATA_LO  0x02BC21A0
0334 #define CS35L41_DSP1_PM_PATCH1_DATA_HI  0x02BC21A4
0335 #define CS35L41_DSP1_PM_PATCH2_ADDR 0x02BC21A8
0336 #define CS35L41_DSP1_PM_PATCH2_EN   0x02BC21AC
0337 #define CS35L41_DSP1_PM_PATCH2_DATA_LO  0x02BC21B0
0338 #define CS35L41_DSP1_PM_PATCH2_DATA_HI  0x02BC21B4
0339 #define CS35L41_DSP1_PM_PATCH3_ADDR 0x02BC21B8
0340 #define CS35L41_DSP1_PM_PATCH3_EN   0x02BC21BC
0341 #define CS35L41_DSP1_PM_PATCH3_DATA_LO  0x02BC21C0
0342 #define CS35L41_DSP1_PM_PATCH3_DATA_HI  0x02BC21C4
0343 #define CS35L41_DSP1_PM_PATCH4_ADDR 0x02BC21C8
0344 #define CS35L41_DSP1_PM_PATCH4_EN   0x02BC21CC
0345 #define CS35L41_DSP1_PM_PATCH4_DATA_LO  0x02BC21D0
0346 #define CS35L41_DSP1_PM_PATCH4_DATA_HI  0x02BC21D4
0347 #define CS35L41_DSP1_PM_PATCH5_ADDR 0x02BC21D8
0348 #define CS35L41_DSP1_PM_PATCH5_EN   0x02BC21DC
0349 #define CS35L41_DSP1_PM_PATCH5_DATA_LO  0x02BC21E0
0350 #define CS35L41_DSP1_PM_PATCH5_DATA_HI  0x02BC21E4
0351 #define CS35L41_DSP1_PM_PATCH6_ADDR 0x02BC21E8
0352 #define CS35L41_DSP1_PM_PATCH6_EN   0x02BC21EC
0353 #define CS35L41_DSP1_PM_PATCH6_DATA_LO  0x02BC21F0
0354 #define CS35L41_DSP1_PM_PATCH6_DATA_HI  0x02BC21F4
0355 #define CS35L41_DSP1_PM_PATCH7_ADDR 0x02BC21F8
0356 #define CS35L41_DSP1_PM_PATCH7_EN   0x02BC21FC
0357 #define CS35L41_DSP1_PM_PATCH7_DATA_LO  0x02BC2200
0358 #define CS35L41_DSP1_PM_PATCH7_DATA_HI  0x02BC2204
0359 #define CS35L41_DSP1_MPU_XM_ACCESS0 0x02BC3000
0360 #define CS35L41_DSP1_MPU_YM_ACCESS0 0x02BC3004
0361 #define CS35L41_DSP1_MPU_WNDW_ACCESS0   0x02BC3008
0362 #define CS35L41_DSP1_MPU_XREG_ACCESS0   0x02BC300C
0363 #define CS35L41_DSP1_MPU_YREG_ACCESS0   0x02BC3014
0364 #define CS35L41_DSP1_MPU_XM_ACCESS1 0x02BC3018
0365 #define CS35L41_DSP1_MPU_YM_ACCESS1 0x02BC301C
0366 #define CS35L41_DSP1_MPU_WNDW_ACCESS1   0x02BC3020
0367 #define CS35L41_DSP1_MPU_XREG_ACCESS1   0x02BC3024
0368 #define CS35L41_DSP1_MPU_YREG_ACCESS1   0x02BC302C
0369 #define CS35L41_DSP1_MPU_XM_ACCESS2 0x02BC3030
0370 #define CS35L41_DSP1_MPU_YM_ACCESS2 0x02BC3034
0371 #define CS35L41_DSP1_MPU_WNDW_ACCESS2   0x02BC3038
0372 #define CS35L41_DSP1_MPU_XREG_ACCESS2   0x02BC303C
0373 #define CS35L41_DSP1_MPU_YREG_ACCESS2   0x02BC3044
0374 #define CS35L41_DSP1_MPU_XM_ACCESS3 0x02BC3048
0375 #define CS35L41_DSP1_MPU_YM_ACCESS3 0x02BC304C
0376 #define CS35L41_DSP1_MPU_WNDW_ACCESS3   0x02BC3050
0377 #define CS35L41_DSP1_MPU_XREG_ACCESS3   0x02BC3054
0378 #define CS35L41_DSP1_MPU_YREG_ACCESS3   0x02BC305C
0379 #define CS35L41_DSP1_MPU_XM_VIO_ADDR    0x02BC3100
0380 #define CS35L41_DSP1_MPU_XM_VIO_STATUS  0x02BC3104
0381 #define CS35L41_DSP1_MPU_YM_VIO_ADDR    0x02BC3108
0382 #define CS35L41_DSP1_MPU_YM_VIO_STATUS  0x02BC310C
0383 #define CS35L41_DSP1_MPU_PM_VIO_ADDR    0x02BC3110
0384 #define CS35L41_DSP1_MPU_PM_VIO_STATUS  0x02BC3114
0385 #define CS35L41_DSP1_MPU_LOCK_CONFIG    0x02BC3140
0386 #define CS35L41_DSP1_MPU_WDT_RST_CTRL   0x02BC3180
0387 #define CS35L41_DSP1_STRMARB_MSTR0_CFG0 0x02BC5000
0388 #define CS35L41_DSP1_STRMARB_MSTR0_CFG1 0x02BC5004
0389 #define CS35L41_DSP1_STRMARB_MSTR0_CFG2 0x02BC5008
0390 #define CS35L41_DSP1_STRMARB_MSTR1_CFG0 0x02BC5010
0391 #define CS35L41_DSP1_STRMARB_MSTR1_CFG1 0x02BC5014
0392 #define CS35L41_DSP1_STRMARB_MSTR1_CFG2 0x02BC5018
0393 #define CS35L41_DSP1_STRMARB_MSTR2_CFG0 0x02BC5020
0394 #define CS35L41_DSP1_STRMARB_MSTR2_CFG1 0x02BC5024
0395 #define CS35L41_DSP1_STRMARB_MSTR2_CFG2 0x02BC5028
0396 #define CS35L41_DSP1_STRMARB_MSTR3_CFG0 0x02BC5030
0397 #define CS35L41_DSP1_STRMARB_MSTR3_CFG1 0x02BC5034
0398 #define CS35L41_DSP1_STRMARB_MSTR3_CFG2 0x02BC5038
0399 #define CS35L41_DSP1_STRMARB_MSTR4_CFG0 0x02BC5040
0400 #define CS35L41_DSP1_STRMARB_MSTR4_CFG1 0x02BC5044
0401 #define CS35L41_DSP1_STRMARB_MSTR4_CFG2 0x02BC5048
0402 #define CS35L41_DSP1_STRMARB_MSTR5_CFG0 0x02BC5050
0403 #define CS35L41_DSP1_STRMARB_MSTR5_CFG1 0x02BC5054
0404 #define CS35L41_DSP1_STRMARB_MSTR5_CFG2 0x02BC5058
0405 #define CS35L41_DSP1_STRMARB_MSTR6_CFG0 0x02BC5060
0406 #define CS35L41_DSP1_STRMARB_MSTR6_CFG1 0x02BC5064
0407 #define CS35L41_DSP1_STRMARB_MSTR6_CFG2 0x02BC5068
0408 #define CS35L41_DSP1_STRMARB_MSTR7_CFG0 0x02BC5070
0409 #define CS35L41_DSP1_STRMARB_MSTR7_CFG1 0x02BC5074
0410 #define CS35L41_DSP1_STRMARB_MSTR7_CFG2 0x02BC5078
0411 #define CS35L41_DSP1_STRMARB_TX0_CFG0   0x02BC5200
0412 #define CS35L41_DSP1_STRMARB_TX0_CFG1   0x02BC5204
0413 #define CS35L41_DSP1_STRMARB_TX1_CFG0   0x02BC5208
0414 #define CS35L41_DSP1_STRMARB_TX1_CFG1   0x02BC520C
0415 #define CS35L41_DSP1_STRMARB_TX2_CFG0   0x02BC5210
0416 #define CS35L41_DSP1_STRMARB_TX2_CFG1   0x02BC5214
0417 #define CS35L41_DSP1_STRMARB_TX3_CFG0   0x02BC5218
0418 #define CS35L41_DSP1_STRMARB_TX3_CFG1   0x02BC521C
0419 #define CS35L41_DSP1_STRMARB_TX4_CFG0   0x02BC5220
0420 #define CS35L41_DSP1_STRMARB_TX4_CFG1   0x02BC5224
0421 #define CS35L41_DSP1_STRMARB_TX5_CFG0   0x02BC5228
0422 #define CS35L41_DSP1_STRMARB_TX5_CFG1   0x02BC522C
0423 #define CS35L41_DSP1_STRMARB_TX6_CFG0   0x02BC5230
0424 #define CS35L41_DSP1_STRMARB_TX6_CFG1   0x02BC5234
0425 #define CS35L41_DSP1_STRMARB_TX7_CFG0   0x02BC5238
0426 #define CS35L41_DSP1_STRMARB_TX7_CFG1   0x02BC523C
0427 #define CS35L41_DSP1_STRMARB_RX0_CFG0   0x02BC5400
0428 #define CS35L41_DSP1_STRMARB_RX0_CFG1   0x02BC5404
0429 #define CS35L41_DSP1_STRMARB_RX1_CFG0   0x02BC5408
0430 #define CS35L41_DSP1_STRMARB_RX1_CFG1   0x02BC540C
0431 #define CS35L41_DSP1_STRMARB_RX2_CFG0   0x02BC5410
0432 #define CS35L41_DSP1_STRMARB_RX2_CFG1   0x02BC5414
0433 #define CS35L41_DSP1_STRMARB_RX3_CFG0   0x02BC5418
0434 #define CS35L41_DSP1_STRMARB_RX3_CFG1   0x02BC541C
0435 #define CS35L41_DSP1_STRMARB_RX4_CFG0   0x02BC5420
0436 #define CS35L41_DSP1_STRMARB_RX4_CFG1   0x02BC5424
0437 #define CS35L41_DSP1_STRMARB_RX5_CFG0   0x02BC5428
0438 #define CS35L41_DSP1_STRMARB_RX5_CFG1   0x02BC542C
0439 #define CS35L41_DSP1_STRMARB_RX6_CFG0   0x02BC5430
0440 #define CS35L41_DSP1_STRMARB_RX6_CFG1   0x02BC5434
0441 #define CS35L41_DSP1_STRMARB_RX7_CFG0   0x02BC5438
0442 #define CS35L41_DSP1_STRMARB_RX7_CFG1   0x02BC543C
0443 #define CS35L41_DSP1_STRMARB_IRQ0_CFG0  0x02BC5600
0444 #define CS35L41_DSP1_STRMARB_IRQ0_CFG1  0x02BC5604
0445 #define CS35L41_DSP1_STRMARB_IRQ0_CFG2  0x02BC5608
0446 #define CS35L41_DSP1_STRMARB_IRQ1_CFG0  0x02BC5610
0447 #define CS35L41_DSP1_STRMARB_IRQ1_CFG1  0x02BC5614
0448 #define CS35L41_DSP1_STRMARB_IRQ1_CFG2  0x02BC5618
0449 #define CS35L41_DSP1_STRMARB_IRQ2_CFG0  0x02BC5620
0450 #define CS35L41_DSP1_STRMARB_IRQ2_CFG1  0x02BC5624
0451 #define CS35L41_DSP1_STRMARB_IRQ2_CFG2  0x02BC5628
0452 #define CS35L41_DSP1_STRMARB_IRQ3_CFG0  0x02BC5630
0453 #define CS35L41_DSP1_STRMARB_IRQ3_CFG1  0x02BC5634
0454 #define CS35L41_DSP1_STRMARB_IRQ3_CFG2  0x02BC5638
0455 #define CS35L41_DSP1_STRMARB_IRQ4_CFG0  0x02BC5640
0456 #define CS35L41_DSP1_STRMARB_IRQ4_CFG1  0x02BC5644
0457 #define CS35L41_DSP1_STRMARB_IRQ4_CFG2  0x02BC5648
0458 #define CS35L41_DSP1_STRMARB_IRQ5_CFG0  0x02BC5650
0459 #define CS35L41_DSP1_STRMARB_IRQ5_CFG1  0x02BC5654
0460 #define CS35L41_DSP1_STRMARB_IRQ5_CFG2  0x02BC5658
0461 #define CS35L41_DSP1_STRMARB_IRQ6_CFG0  0x02BC5660
0462 #define CS35L41_DSP1_STRMARB_IRQ6_CFG1  0x02BC5664
0463 #define CS35L41_DSP1_STRMARB_IRQ6_CFG2  0x02BC5668
0464 #define CS35L41_DSP1_STRMARB_IRQ7_CFG0  0x02BC5670
0465 #define CS35L41_DSP1_STRMARB_IRQ7_CFG1  0x02BC5674
0466 #define CS35L41_DSP1_STRMARB_IRQ7_CFG2  0x02BC5678
0467 #define CS35L41_DSP1_STRMARB_RESYNC_MSK 0x02BC5A00
0468 #define CS35L41_DSP1_STRMARB_ERR_STATUS 0x02BC5A08
0469 #define CS35L41_DSP1_INTPCTL_RES_STATIC 0x02BC6000
0470 #define CS35L41_DSP1_INTPCTL_RES_DYN    0x02BC6004
0471 #define CS35L41_DSP1_INTPCTL_NMI_CTRL   0x02BC6008
0472 #define CS35L41_DSP1_INTPCTL_IRQ_INV    0x02BC6010
0473 #define CS35L41_DSP1_INTPCTL_IRQ_MODE   0x02BC6014
0474 #define CS35L41_DSP1_INTPCTL_IRQ_EN 0x02BC6018
0475 #define CS35L41_DSP1_INTPCTL_IRQ_MSK    0x02BC601C
0476 #define CS35L41_DSP1_INTPCTL_IRQ_FLUSH  0x02BC6020
0477 #define CS35L41_DSP1_INTPCTL_IRQ_MSKCLR 0x02BC6024
0478 #define CS35L41_DSP1_INTPCTL_IRQ_FRC    0x02BC6028
0479 #define CS35L41_DSP1_INTPCTL_IRQ_MSKSET 0x02BC602C
0480 #define CS35L41_DSP1_INTPCTL_IRQ_ERR    0x02BC6030
0481 #define CS35L41_DSP1_INTPCTL_IRQ_PEND   0x02BC6034
0482 #define CS35L41_DSP1_INTPCTL_IRQ_GEN    0x02BC6038
0483 #define CS35L41_DSP1_INTPCTL_TESTBITS   0x02BC6040
0484 #define CS35L41_DSP1_WDT_CONTROL    0x02BC7000
0485 #define CS35L41_DSP1_WDT_STATUS     0x02BC7008
0486 #define CS35L41_DSP1_YMEM_PACK_0    0x02C00000
0487 #define CS35L41_DSP1_YMEM_PACK_1532 0x02C017F0
0488 #define CS35L41_DSP1_YMEM_UNPACK32_0    0x03000000
0489 #define CS35L41_DSP1_YMEM_UNPACK32_1022 0x03000FF8
0490 #define CS35L41_DSP1_YMEM_UNPACK24_0    0x03400000
0491 #define CS35L41_DSP1_YMEM_UNPACK24_2045 0x03401FF4
0492 #define CS35L41_DSP1_PMEM_0     0x03800000
0493 #define CS35L41_DSP1_PMEM_5114      0x03804FE8
0494 
0495 /*test regs for emulation bringup*/
0496 #define CS35L41_PLL_OVR         0x00003018
0497 #define CS35L41_BST_TEST_DUTY       0x00003900
0498 #define CS35L41_DIGPWM_IOCTRL       0x0000706C
0499 
0500 /*registers populated by OTP*/
0501 #define CS35L41_OTP_TRIM_1      0x0000208c
0502 #define CS35L41_OTP_TRIM_2      0x00002090
0503 #define CS35L41_OTP_TRIM_3      0x00003010
0504 #define CS35L41_OTP_TRIM_4      0x0000300C
0505 #define CS35L41_OTP_TRIM_5      0x0000394C
0506 #define CS35L41_OTP_TRIM_6      0x00003950
0507 #define CS35L41_OTP_TRIM_7      0x00003954
0508 #define CS35L41_OTP_TRIM_8      0x00003958
0509 #define CS35L41_OTP_TRIM_9      0x0000395C
0510 #define CS35L41_OTP_TRIM_10     0x0000416C
0511 #define CS35L41_OTP_TRIM_11     0x00004160
0512 #define CS35L41_OTP_TRIM_12     0x00004170
0513 #define CS35L41_OTP_TRIM_13     0x00004360
0514 #define CS35L41_OTP_TRIM_14     0x00004448
0515 #define CS35L41_OTP_TRIM_15     0x0000444C
0516 #define CS35L41_OTP_TRIM_16     0x00006E30
0517 #define CS35L41_OTP_TRIM_17     0x00006E34
0518 #define CS35L41_OTP_TRIM_18     0x00006E38
0519 #define CS35L41_OTP_TRIM_19     0x00006E3C
0520 #define CS35L41_OTP_TRIM_20     0x00006E40
0521 #define CS35L41_OTP_TRIM_21     0x00006E44
0522 #define CS35L41_OTP_TRIM_22     0x00006E48
0523 #define CS35L41_OTP_TRIM_23     0x00006E4C
0524 #define CS35L41_OTP_TRIM_24     0x00006E50
0525 #define CS35L41_OTP_TRIM_25     0x00006E54
0526 #define CS35L41_OTP_TRIM_26     0x00006E58
0527 #define CS35L41_OTP_TRIM_27     0x00006E5C
0528 #define CS35L41_OTP_TRIM_28     0x00006E60
0529 #define CS35L41_OTP_TRIM_29     0x00006E64
0530 #define CS35L41_OTP_TRIM_30     0x00007418
0531 #define CS35L41_OTP_TRIM_31     0x0000741C
0532 #define CS35L41_OTP_TRIM_32     0x00007434
0533 #define CS35L41_OTP_TRIM_33     0x00007068
0534 #define CS35L41_OTP_TRIM_34     0x0000410C
0535 #define CS35L41_OTP_TRIM_35     0x0000400C
0536 #define CS35L41_OTP_TRIM_36     0x00002030
0537 
0538 #define CS35L41_MAX_CACHE_REG       36
0539 #define CS35L41_OTP_SIZE_WORDS      32
0540 
0541 #define CS35L41_NUM_SUPPLIES            2
0542 
0543 #define CS35L41_SCLK_MSTR_MASK      0x10
0544 #define CS35L41_SCLK_MSTR_SHIFT     4
0545 #define CS35L41_LRCLK_MSTR_MASK     0x01
0546 #define CS35L41_LRCLK_MSTR_SHIFT    0
0547 #define CS35L41_SCLK_INV_MASK       0x40
0548 #define CS35L41_SCLK_INV_SHIFT      6
0549 #define CS35L41_LRCLK_INV_MASK      0x04
0550 #define CS35L41_LRCLK_INV_SHIFT     2
0551 #define CS35L41_SCLK_FRC_MASK       0x20
0552 #define CS35L41_SCLK_FRC_SHIFT      5
0553 #define CS35L41_LRCLK_FRC_MASK      0x02
0554 #define CS35L41_LRCLK_FRC_SHIFT     1
0555 
0556 #define CS35L41_AMP_GAIN_PCM_MASK   0x3E0
0557 #define CS35L41_AMP_GAIN_ZC_MASK    0x0400
0558 #define CS35L41_AMP_GAIN_ZC_SHIFT   10
0559 
0560 #define CS35L41_BST_CTL_MASK        0xFF
0561 #define CS35L41_BST_CTL_SEL_MASK    0x03
0562 #define CS35L41_BST_CTL_SEL_REG     0x00
0563 #define CS35L41_BST_CTL_SEL_CLASSH  0x01
0564 #define CS35L41_BST_IPK_MASK        0x7F
0565 #define CS35L41_BST_IPK_SHIFT       0
0566 #define CS35L41_BST_LIM_MASK        0x4
0567 #define CS35L41_BST_LIM_SHIFT       2
0568 #define CS35L41_BST_K1_MASK     0x000000FF
0569 #define CS35L41_BST_K1_SHIFT        0
0570 #define CS35L41_BST_K2_MASK     0x0000FF00
0571 #define CS35L41_BST_K2_SHIFT        8
0572 #define CS35L41_BST_SLOPE_MASK      0x0000FF00
0573 #define CS35L41_BST_SLOPE_SHIFT     8
0574 #define CS35L41_BST_LBST_VAL_MASK   0x00000003
0575 #define CS35L41_BST_LBST_VAL_SHIFT  0
0576 
0577 #define CS35L41_TEMP_THLD_MASK      0x03
0578 #define CS35L41_VMON_IMON_VOL_MASK  0x07FF07FF
0579 #define CS35L41_PDM_MODE_MASK       0x01
0580 #define CS35L41_PDM_MODE_SHIFT      0
0581 
0582 #define CS35L41_CH_MEM_DEPTH_MASK   0x07
0583 #define CS35L41_CH_MEM_DEPTH_SHIFT  0
0584 #define CS35L41_CH_HDRM_CTL_MASK    0x007F0000
0585 #define CS35L41_CH_HDRM_CTL_SHIFT   16
0586 #define CS35L41_CH_REL_RATE_MASK    0xFF00
0587 #define CS35L41_CH_REL_RATE_SHIFT   8
0588 #define CS35L41_CH_WKFET_DLY_MASK   0x001C
0589 #define CS35L41_CH_WKFET_DLY_SHIFT  2
0590 #define CS35L41_CH_WKFET_THLD_MASK  0x0F00
0591 #define CS35L41_CH_WKFET_THLD_SHIFT 8
0592 
0593 #define CS35L41_HW_NG_SEL_MASK      0x3F00
0594 #define CS35L41_HW_NG_SEL_SHIFT     8
0595 #define CS35L41_HW_NG_DLY_MASK      0x0070
0596 #define CS35L41_HW_NG_DLY_SHIFT     4
0597 #define CS35L41_HW_NG_THLD_MASK     0x0007
0598 #define CS35L41_HW_NG_THLD_SHIFT    0
0599 
0600 #define CS35L41_DSP_NG_ENABLE_MASK  0x00010000
0601 #define CS35L41_DSP_NG_ENABLE_SHIFT 16
0602 #define CS35L41_DSP_NG_THLD_MASK    0x7
0603 #define CS35L41_DSP_NG_THLD_SHIFT   0
0604 #define CS35L41_DSP_NG_DELAY_MASK   0x0F00
0605 #define CS35L41_DSP_NG_DELAY_SHIFT  8
0606 
0607 #define CS35L41_ASP_FMT_MASK        0x0700
0608 #define CS35L41_ASP_FMT_SHIFT       8
0609 #define CS35L41_ASP_DOUT_HIZ_MASK   0x03
0610 #define CS35L41_ASP_DOUT_HIZ_SHIFT  0
0611 #define CS35L41_ASP_WIDTH_16        0x10
0612 #define CS35L41_ASP_WIDTH_24        0x18
0613 #define CS35L41_ASP_WIDTH_32        0x20
0614 #define CS35L41_ASP_WIDTH_TX_MASK   0xFF0000
0615 #define CS35L41_ASP_WIDTH_TX_SHIFT  16
0616 #define CS35L41_ASP_WIDTH_RX_MASK   0xFF000000
0617 #define CS35L41_ASP_WIDTH_RX_SHIFT  24
0618 #define CS35L41_ASP_RX1_SLOT_MASK   0x3F
0619 #define CS35L41_ASP_RX1_SLOT_SHIFT  0
0620 #define CS35L41_ASP_RX2_SLOT_MASK   0x3F00
0621 #define CS35L41_ASP_RX2_SLOT_SHIFT  8
0622 #define CS35L41_ASP_RX_WL_MASK      0x3F
0623 #define CS35L41_ASP_TX_WL_MASK      0x3F
0624 #define CS35L41_ASP_RX_WL_SHIFT     0
0625 #define CS35L41_ASP_TX_WL_SHIFT     0
0626 #define CS35L41_ASP_SOURCE_MASK     0x7F
0627 
0628 #define CS35L41_INPUT_SRC_ASPRX1    0x08
0629 #define CS35L41_INPUT_SRC_ASPRX2    0x09
0630 #define CS35L41_INPUT_SRC_VMON      0x18
0631 #define CS35L41_INPUT_SRC_IMON      0x19
0632 #define CS35L41_INPUT_SRC_CLASSH    0x21
0633 #define CS35L41_INPUT_SRC_VPMON     0x28
0634 #define CS35L41_INPUT_SRC_VBSTMON   0x29
0635 #define CS35L41_INPUT_SRC_TEMPMON   0x3A
0636 #define CS35L41_INPUT_SRC_RSVD      0x3B
0637 #define CS35L41_INPUT_DSP_TX1       0x32
0638 #define CS35L41_INPUT_DSP_TX2       0x33
0639 
0640 #define CS35L41_WR_PEND_STS_MASK    0x2
0641 
0642 #define CS35L41_PLL_CLK_SEL_MASK    0x07
0643 #define CS35L41_PLL_CLK_SEL_SHIFT   0
0644 #define CS35L41_PLL_CLK_EN_MASK     0x10
0645 #define CS35L41_PLL_CLK_EN_SHIFT    4
0646 #define CS35L41_PLL_OPENLOOP_MASK   0x0800
0647 #define CS35L41_PLL_OPENLOOP_SHIFT  11
0648 #define CS35L41_PLLSRC_SCLK     0
0649 #define CS35L41_PLLSRC_LRCLK        1
0650 #define CS35L41_PLLSRC_SELF     3
0651 #define CS35L41_PLLSRC_PDMCLK       4
0652 #define CS35L41_PLLSRC_MCLK     5
0653 #define CS35L41_PLLSRC_SWIRE        7
0654 #define CS35L41_REFCLK_FREQ_MASK    0x7E0
0655 #define CS35L41_REFCLK_FREQ_SHIFT   5
0656 
0657 #define CS35L41_GLOBAL_FS_MASK      0x1F
0658 #define CS35L41_GLOBAL_FS_SHIFT     0
0659 
0660 #define CS35L41_GLOBAL_EN_MASK      0x01
0661 #define CS35L41_GLOBAL_EN_SHIFT     0
0662 #define CS35L41_BST_EN_MASK     0x0030
0663 #define CS35L41_BST_EN_SHIFT        4
0664 #define CS35L41_BST_DIS_FET_OFF     0x00
0665 #define CS35L41_BST_EN_DEFAULT      0x2
0666 #define CS35L41_AMP_EN_SHIFT        0
0667 #define CS35L41_AMP_EN_MASK     1
0668 #define CS35L41_VMON_EN_MASK        0x1000
0669 #define CS35L41_VMON_EN_SHIFT       12
0670 #define CS35L41_IMON_EN_MASK        0x2000
0671 #define CS35L41_IMON_EN_SHIFT       13
0672 
0673 #define CS35L41_PDN_DONE_MASK       0x00800000
0674 #define CS35L41_PDN_DONE_SHIFT      23
0675 #define CS35L41_PUP_DONE_MASK       0x01000000
0676 #define CS35L41_PUP_DONE_SHIFT      24
0677 
0678 #define CS35L36_PUP_DONE_IRQ_UNMASK 0x5F
0679 #define CS35L36_PUP_DONE_IRQ_MASK   0xBF
0680 
0681 #define CS35L41_AMP_SHORT_ERR       0x80000000
0682 #define CS35L41_BST_SHORT_ERR       0x0100
0683 #define CS35L41_TEMP_WARN       0x8000
0684 #define CS35L41_TEMP_ERR        0x00020000
0685 #define CS35L41_BST_OVP_ERR     0x40
0686 #define CS35L41_BST_DCM_UVP_ERR     0x80
0687 #define CS35L41_OTP_BOOT_DONE       0x02
0688 #define CS35L41_PLL_UNLOCK      0x10
0689 #define CS35L41_OTP_BOOT_ERR        0x80000000
0690 
0691 #define CS35L41_AMP_SHORT_ERR_RLS   0x02
0692 #define CS35L41_BST_SHORT_ERR_RLS   0x04
0693 #define CS35L41_BST_OVP_ERR_RLS     0x08
0694 #define CS35L41_BST_UVP_ERR_RLS     0x10
0695 #define CS35L41_TEMP_WARN_ERR_RLS   0x20
0696 #define CS35L41_TEMP_ERR_RLS        0x40
0697 
0698 #define CS35L41_AMP_SHORT_ERR_RLS_SHIFT 1
0699 #define CS35L41_BST_SHORT_ERR_RLS_SHIFT 2
0700 #define CS35L41_BST_OVP_ERR_RLS_SHIFT   3
0701 #define CS35L41_BST_UVP_ERR_RLS_SHIFT   4
0702 #define CS35L41_TEMP_WARN_ERR_RLS_SHIFT 5
0703 #define CS35L41_TEMP_ERR_RLS_SHIFT  6
0704 
0705 #define CS35L41_INT1_MASK_DEFAULT   0x7FFCFE3F
0706 #define CS35L41_INT1_UNMASK_PUP     0xFEFFFFFF
0707 #define CS35L41_INT1_UNMASK_PDN     0xFF7FFFFF
0708 
0709 #define CS35L41_GPIO_DIR_MASK       0x80000000
0710 #define CS35L41_GPIO_DIR_SHIFT      31
0711 #define CS35L41_GPIO1_CTRL_MASK     0x00030000
0712 #define CS35L41_GPIO1_CTRL_SHIFT    16
0713 #define CS35L41_GPIO2_CTRL_MASK     0x07000000
0714 #define CS35L41_GPIO2_CTRL_SHIFT    24
0715 #define CS35L41_GPIO_LVL_SHIFT      15
0716 #define CS35L41_GPIO_LVL_MASK       BIT(CS35L41_GPIO_LVL_SHIFT)
0717 #define CS35L41_GPIO_POL_MASK       0x1000
0718 #define CS35L41_GPIO_POL_SHIFT      12
0719 
0720 #define CS35L41_AMP_INV_PCM_SHIFT   14
0721 #define CS35L41_AMP_INV_PCM_MASK    BIT(CS35L41_AMP_INV_PCM_SHIFT)
0722 #define CS35L41_AMP_PCM_VOL_SHIFT   3
0723 #define CS35L41_AMP_PCM_VOL_MASK    (0x7FF << 3)
0724 #define CS35L41_AMP_PCM_VOL_MUTE    0x4CF
0725 
0726 #define CS35L41_CHIP_ID         0x35a40
0727 #define CS35L41R_CHIP_ID        0x35b40
0728 #define CS35L41_MTLREVID_MASK       0x0F
0729 #define CS35L41_REVID_A0        0xA0
0730 #define CS35L41_REVID_B0        0xB0
0731 #define CS35L41_REVID_B2        0xB2
0732 
0733 #define CS35L41_HALO_CORE_RESET     0x00000200
0734 
0735 #define CS35L41_FS1_WINDOW_MASK     0x000007FF
0736 #define CS35L41_FS2_WINDOW_MASK     0x00FFF800
0737 #define CS35L41_FS2_WINDOW_SHIFT    12
0738 
0739 #define CS35L41_SPI_MAX_FREQ        4000000
0740 #define CS35L41_REGSTRIDE       4
0741 
0742 enum cs35l41_boost_type {
0743     CS35L41_INT_BOOST,
0744     CS35L41_EXT_BOOST,
0745     CS35L41_EXT_BOOST_NO_VSPK_SWITCH,
0746 };
0747 
0748 enum cs35l41_clk_ids {
0749     CS35L41_CLKID_SCLK = 0,
0750     CS35L41_CLKID_LRCLK = 1,
0751     CS35L41_CLKID_MCLK = 4,
0752 };
0753 
0754 enum cs35l41_gpio1_func {
0755     CS35L41_GPIO1_HIZ,
0756     CS35L41_GPIO1_GPIO,
0757     CS35L41_GPIO1_MDSYNC,
0758     CS35L41_GPIO1_MCLK,
0759     CS35L41_GPIO1_PDM_CLK,
0760     CS35L41_GPIO1_PDM_DATA,
0761 };
0762 
0763 enum cs35l41_gpio2_func {
0764     CS35L41_GPIO2_HIZ,
0765     CS35L41_GPIO2_GPIO,
0766     CS35L41_GPIO2_INT_OPEN_DRAIN,
0767     CS35L41_GPIO2_MCLK,
0768     CS35L41_GPIO2_INT_PUSH_PULL_LOW,
0769     CS35L41_GPIO2_INT_PUSH_PULL_HIGH,
0770     CS35L41_GPIO2_PDM_CLK,
0771     CS35L41_GPIO2_PDM_DATA,
0772 };
0773 
0774 struct cs35l41_gpio_cfg {
0775     bool valid;
0776     bool pol_inv;
0777     bool out_en;
0778     unsigned int func;
0779 };
0780 
0781 struct cs35l41_hw_cfg {
0782     bool valid;
0783     int bst_ind;
0784     int bst_ipk;
0785     int bst_cap;
0786     int dout_hiz;
0787     struct cs35l41_gpio_cfg gpio1;
0788     struct cs35l41_gpio_cfg gpio2;
0789     unsigned int spk_pos;
0790 
0791     enum cs35l41_boost_type bst_type;
0792 };
0793 
0794 struct cs35l41_otp_packed_element_t {
0795     u32 reg;
0796     u8 shift;
0797     u8 size;
0798 };
0799 
0800 struct cs35l41_otp_map_element_t {
0801     u32 id;
0802     u32 num_elements;
0803     const struct cs35l41_otp_packed_element_t *map;
0804     u32 bit_offset;
0805     u32 word_offset;
0806 };
0807 
0808 enum cs35l41_cspl_mbox_status {
0809     CSPL_MBOX_STS_RUNNING = 0,
0810     CSPL_MBOX_STS_PAUSED = 1,
0811     CSPL_MBOX_STS_RDY_FOR_REINIT = 2,
0812 };
0813 
0814 enum cs35l41_cspl_mbox_cmd {
0815     CSPL_MBOX_CMD_NONE = 0,
0816     CSPL_MBOX_CMD_PAUSE = 1,
0817     CSPL_MBOX_CMD_RESUME = 2,
0818     CSPL_MBOX_CMD_REINIT = 3,
0819     CSPL_MBOX_CMD_STOP_PRE_REINIT = 4,
0820     CSPL_MBOX_CMD_HIBERNATE = 5,
0821     CSPL_MBOX_CMD_OUT_OF_HIBERNATE = 6,
0822     CSPL_MBOX_CMD_UNKNOWN_CMD = -1,
0823     CSPL_MBOX_CMD_INVALID_SEQUENCE = -2,
0824 };
0825 
0826 /*
0827  * IRQs
0828  */
0829 #define CS35L41_IRQ(_irq, _name, _hand)     \
0830     {                   \
0831         .irq = CS35L41_ ## _irq ## _IRQ,\
0832         .name = _name,          \
0833         .handler = _hand,       \
0834     }
0835 
0836 struct cs35l41_irq {
0837     int irq;
0838     const char *name;
0839     irqreturn_t (*handler)(int irq, void *data);
0840 };
0841 
0842 #define CS35L41_REG_IRQ(_reg, _irq)                 \
0843     [CS35L41_ ## _irq ## _IRQ] = {                  \
0844         .reg_offset = (CS35L41_ ## _reg) - CS35L41_IRQ1_STATUS1,\
0845         .mask = CS35L41_ ## _irq ## _MASK           \
0846     }
0847 
0848 /* (0x0000E010) CS35L41_IRQ1_STATUS1 */
0849 #define CS35L41_BST_OVP_ERR_SHIFT       6
0850 #define CS35L41_BST_OVP_ERR_MASK        BIT(CS35L41_BST_OVP_ERR_SHIFT)
0851 #define CS35L41_BST_DCM_UVP_ERR_SHIFT       7
0852 #define CS35L41_BST_DCM_UVP_ERR_MASK        BIT(CS35L41_BST_DCM_UVP_ERR_SHIFT)
0853 #define CS35L41_BST_SHORT_ERR_SHIFT     8
0854 #define CS35L41_BST_SHORT_ERR_MASK      BIT(CS35L41_BST_SHORT_ERR_SHIFT)
0855 #define CS35L41_TEMP_WARN_SHIFT         15
0856 #define CS35L41_TEMP_WARN_MASK          BIT(CS35L41_TEMP_WARN_SHIFT)
0857 #define CS35L41_TEMP_ERR_SHIFT          17
0858 #define CS35L41_TEMP_ERR_MASK           BIT(CS35L41_TEMP_ERR_SHIFT)
0859 #define CS35L41_AMP_SHORT_ERR_SHIFT     31
0860 #define CS35L41_AMP_SHORT_ERR_MASK      BIT(CS35L41_AMP_SHORT_ERR_SHIFT)
0861 
0862 enum cs35l41_irq_list {
0863     CS35L41_BST_OVP_ERR_IRQ,
0864     CS35L41_BST_DCM_UVP_ERR_IRQ,
0865     CS35L41_BST_SHORT_ERR_IRQ,
0866     CS35L41_TEMP_WARN_IRQ,
0867     CS35L41_TEMP_ERR_IRQ,
0868     CS35L41_AMP_SHORT_ERR_IRQ,
0869 
0870     CS35L41_NUM_IRQ
0871 };
0872 
0873 extern struct regmap_config cs35l41_regmap_i2c;
0874 extern struct regmap_config cs35l41_regmap_spi;
0875 
0876 int cs35l41_test_key_unlock(struct device *dev, struct regmap *regmap);
0877 int cs35l41_test_key_lock(struct device *dev, struct regmap *regmap);
0878 int cs35l41_otp_unpack(struct device *dev, struct regmap *regmap);
0879 int cs35l41_register_errata_patch(struct device *dev, struct regmap *reg, unsigned int reg_revid);
0880 int cs35l41_set_channels(struct device *dev, struct regmap *reg,
0881              unsigned int tx_num, unsigned int *tx_slot,
0882              unsigned int rx_num, unsigned int *rx_slot);
0883 int cs35l41_gpio_config(struct regmap *regmap, struct cs35l41_hw_cfg *hw_cfg);
0884 void cs35l41_configure_cs_dsp(struct device *dev, struct regmap *reg, struct cs_dsp *dsp);
0885 int cs35l41_set_cspl_mbox_cmd(struct device *dev, struct regmap *regmap,
0886                   enum cs35l41_cspl_mbox_cmd cmd);
0887 int cs35l41_write_fs_errata(struct device *dev, struct regmap *regmap);
0888 int cs35l41_enter_hibernate(struct device *dev, struct regmap *regmap,
0889                 enum cs35l41_boost_type b_type);
0890 int cs35l41_exit_hibernate(struct device *dev, struct regmap *regmap);
0891 int cs35l41_init_boost(struct device *dev, struct regmap *regmap,
0892                struct cs35l41_hw_cfg *hw_cfg);
0893 bool cs35l41_safe_reset(struct regmap *regmap, enum cs35l41_boost_type b_type);
0894 int cs35l41_global_enable(struct regmap *regmap, enum cs35l41_boost_type b_type, int enable);
0895 
0896 #endif /* __CS35L41_H */