1 /* SPDX-License-Identifier: GPL-2.0-or-later * << 2 /* 1 /* 3 * Codec driver for ST STA350 2.1-channel high 2 * Codec driver for ST STA350 2.1-channel high-efficiency digital audio system 4 * 3 * 5 * Copyright: 2011 Raumfeld GmbH 4 * Copyright: 2011 Raumfeld GmbH 6 * Author: Sven Brandau <info@brandau.biz> 5 * Author: Sven Brandau <info@brandau.biz> 7 * 6 * 8 * based on code from: 7 * based on code from: 9 * Raumfeld GmbH 8 * Raumfeld GmbH 10 * Johannes Stezenbach <js@sig21.net> 9 * Johannes Stezenbach <js@sig21.net> 11 * Wolfson Microelectronics PLC. 10 * Wolfson Microelectronics PLC. 12 * Mark Brown <broonie@opensource.wolfs 11 * Mark Brown <broonie@opensource.wolfsonmicro.com> >> 12 * >> 13 * This program is free software; you can redistribute it and/or modify it >> 14 * under the terms of the GNU General Public License as published by the >> 15 * Free Software Foundation; either version 2 of the License, or (at your >> 16 * option) any later version. 13 */ 17 */ 14 #ifndef _ASOC_STA_350_H 18 #ifndef _ASOC_STA_350_H 15 #define _ASOC_STA_350_H 19 #define _ASOC_STA_350_H 16 20 17 /* STA350 register addresses */ !! 21 /* STA50 register addresses */ 18 22 19 #define STA350_REGISTER_COUNT 0x4D 23 #define STA350_REGISTER_COUNT 0x4D 20 #define STA350_COEF_COUNT 62 24 #define STA350_COEF_COUNT 62 21 25 22 #define STA350_CONFA 0x00 26 #define STA350_CONFA 0x00 23 #define STA350_CONFB 0x01 27 #define STA350_CONFB 0x01 24 #define STA350_CONFC 0x02 28 #define STA350_CONFC 0x02 25 #define STA350_CONFD 0x03 29 #define STA350_CONFD 0x03 26 #define STA350_CONFE 0x04 30 #define STA350_CONFE 0x04 27 #define STA350_CONFF 0x05 31 #define STA350_CONFF 0x05 28 #define STA350_MMUTE 0x06 32 #define STA350_MMUTE 0x06 29 #define STA350_MVOL 0x07 33 #define STA350_MVOL 0x07 30 #define STA350_C1VOL 0x08 34 #define STA350_C1VOL 0x08 31 #define STA350_C2VOL 0x09 35 #define STA350_C2VOL 0x09 32 #define STA350_C3VOL 0x0a 36 #define STA350_C3VOL 0x0a 33 #define STA350_AUTO1 0x0b 37 #define STA350_AUTO1 0x0b 34 #define STA350_AUTO2 0x0c 38 #define STA350_AUTO2 0x0c 35 #define STA350_AUTO3 0x0d 39 #define STA350_AUTO3 0x0d 36 #define STA350_C1CFG 0x0e 40 #define STA350_C1CFG 0x0e 37 #define STA350_C2CFG 0x0f 41 #define STA350_C2CFG 0x0f 38 #define STA350_C3CFG 0x10 42 #define STA350_C3CFG 0x10 39 #define STA350_TONE 0x11 43 #define STA350_TONE 0x11 40 #define STA350_L1AR 0x12 44 #define STA350_L1AR 0x12 41 #define STA350_L1ATRT 0x13 45 #define STA350_L1ATRT 0x13 42 #define STA350_L2AR 0x14 46 #define STA350_L2AR 0x14 43 #define STA350_L2ATRT 0x15 47 #define STA350_L2ATRT 0x15 44 #define STA350_CFADDR2 0x16 48 #define STA350_CFADDR2 0x16 45 #define STA350_B1CF1 0x17 49 #define STA350_B1CF1 0x17 46 #define STA350_B1CF2 0x18 50 #define STA350_B1CF2 0x18 47 #define STA350_B1CF3 0x19 51 #define STA350_B1CF3 0x19 48 #define STA350_B2CF1 0x1a 52 #define STA350_B2CF1 0x1a 49 #define STA350_B2CF2 0x1b 53 #define STA350_B2CF2 0x1b 50 #define STA350_B2CF3 0x1c 54 #define STA350_B2CF3 0x1c 51 #define STA350_A1CF1 0x1d 55 #define STA350_A1CF1 0x1d 52 #define STA350_A1CF2 0x1e 56 #define STA350_A1CF2 0x1e 53 #define STA350_A1CF3 0x1f 57 #define STA350_A1CF3 0x1f 54 #define STA350_A2CF1 0x20 58 #define STA350_A2CF1 0x20 55 #define STA350_A2CF2 0x21 59 #define STA350_A2CF2 0x21 56 #define STA350_A2CF3 0x22 60 #define STA350_A2CF3 0x22 57 #define STA350_B0CF1 0x23 61 #define STA350_B0CF1 0x23 58 #define STA350_B0CF2 0x24 62 #define STA350_B0CF2 0x24 59 #define STA350_B0CF3 0x25 63 #define STA350_B0CF3 0x25 60 #define STA350_CFUD 0x26 64 #define STA350_CFUD 0x26 61 #define STA350_MPCC1 0x27 65 #define STA350_MPCC1 0x27 62 #define STA350_MPCC2 0x28 66 #define STA350_MPCC2 0x28 63 #define STA350_DCC1 0x29 67 #define STA350_DCC1 0x29 64 #define STA350_DCC2 0x2a 68 #define STA350_DCC2 0x2a 65 #define STA350_FDRC1 0x2b 69 #define STA350_FDRC1 0x2b 66 #define STA350_FDRC2 0x2c 70 #define STA350_FDRC2 0x2c 67 #define STA350_STATUS 0x2d 71 #define STA350_STATUS 0x2d 68 /* reserved: 0x2d - 0x30 */ 72 /* reserved: 0x2d - 0x30 */ 69 #define STA350_EQCFG 0x31 73 #define STA350_EQCFG 0x31 70 #define STA350_EATH1 0x32 74 #define STA350_EATH1 0x32 71 #define STA350_ERTH1 0x33 75 #define STA350_ERTH1 0x33 72 #define STA350_EATH2 0x34 76 #define STA350_EATH2 0x34 73 #define STA350_ERTH2 0x35 77 #define STA350_ERTH2 0x35 74 #define STA350_CONFX 0x36 78 #define STA350_CONFX 0x36 75 #define STA350_SVCA 0x37 79 #define STA350_SVCA 0x37 76 #define STA350_SVCB 0x38 80 #define STA350_SVCB 0x38 77 #define STA350_RMS0A 0x39 81 #define STA350_RMS0A 0x39 78 #define STA350_RMS0B 0x3a 82 #define STA350_RMS0B 0x3a 79 #define STA350_RMS0C 0x3b 83 #define STA350_RMS0C 0x3b 80 #define STA350_RMS1A 0x3c 84 #define STA350_RMS1A 0x3c 81 #define STA350_RMS1B 0x3d 85 #define STA350_RMS1B 0x3d 82 #define STA350_RMS1C 0x3e 86 #define STA350_RMS1C 0x3e 83 #define STA350_EVOLRES 0x3f 87 #define STA350_EVOLRES 0x3f 84 /* reserved: 0x40 - 0x47 */ 88 /* reserved: 0x40 - 0x47 */ 85 #define STA350_NSHAPE 0x48 89 #define STA350_NSHAPE 0x48 86 #define STA350_CTXB4B1 0x49 90 #define STA350_CTXB4B1 0x49 87 #define STA350_CTXB7B5 0x4a 91 #define STA350_CTXB7B5 0x4a 88 #define STA350_MISC1 0x4b 92 #define STA350_MISC1 0x4b 89 #define STA350_MISC2 0x4c 93 #define STA350_MISC2 0x4c 90 94 91 /* 0x00 CONFA */ 95 /* 0x00 CONFA */ 92 #define STA350_CONFA_MCS_MASK 0x03 96 #define STA350_CONFA_MCS_MASK 0x03 93 #define STA350_CONFA_MCS_SHIFT 0 97 #define STA350_CONFA_MCS_SHIFT 0 94 #define STA350_CONFA_IR_MASK 0x18 98 #define STA350_CONFA_IR_MASK 0x18 95 #define STA350_CONFA_IR_SHIFT 3 99 #define STA350_CONFA_IR_SHIFT 3 96 #define STA350_CONFA_TWRB BIT(5) 100 #define STA350_CONFA_TWRB BIT(5) 97 #define STA350_CONFA_TWAB BIT(6) 101 #define STA350_CONFA_TWAB BIT(6) 98 #define STA350_CONFA_FDRB BIT(7) 102 #define STA350_CONFA_FDRB BIT(7) 99 103 100 /* 0x01 CONFB */ 104 /* 0x01 CONFB */ 101 #define STA350_CONFB_SAI_MASK 0x0f 105 #define STA350_CONFB_SAI_MASK 0x0f 102 #define STA350_CONFB_SAI_SHIFT 0 106 #define STA350_CONFB_SAI_SHIFT 0 103 #define STA350_CONFB_SAIFB BIT(4) 107 #define STA350_CONFB_SAIFB BIT(4) 104 #define STA350_CONFB_DSCKE BIT(5) 108 #define STA350_CONFB_DSCKE BIT(5) 105 #define STA350_CONFB_C1IM BIT(6) 109 #define STA350_CONFB_C1IM BIT(6) 106 #define STA350_CONFB_C2IM BIT(7) 110 #define STA350_CONFB_C2IM BIT(7) 107 111 108 /* 0x02 CONFC */ 112 /* 0x02 CONFC */ 109 #define STA350_CONFC_OM_MASK 0x03 113 #define STA350_CONFC_OM_MASK 0x03 110 #define STA350_CONFC_OM_SHIFT 0 114 #define STA350_CONFC_OM_SHIFT 0 111 #define STA350_CONFC_CSZ_MASK 0x3c 115 #define STA350_CONFC_CSZ_MASK 0x3c 112 #define STA350_CONFC_CSZ_SHIFT 2 116 #define STA350_CONFC_CSZ_SHIFT 2 113 #define STA350_CONFC_OCRB BIT(7) 117 #define STA350_CONFC_OCRB BIT(7) 114 118 115 /* 0x03 CONFD */ 119 /* 0x03 CONFD */ 116 #define STA350_CONFD_HPB_SHIFT 0 120 #define STA350_CONFD_HPB_SHIFT 0 117 #define STA350_CONFD_DEMP_SHIFT 1 121 #define STA350_CONFD_DEMP_SHIFT 1 118 #define STA350_CONFD_DSPB_SHIFT 2 122 #define STA350_CONFD_DSPB_SHIFT 2 119 #define STA350_CONFD_PSL_SHIFT 3 123 #define STA350_CONFD_PSL_SHIFT 3 120 #define STA350_CONFD_BQL_SHIFT 4 124 #define STA350_CONFD_BQL_SHIFT 4 121 #define STA350_CONFD_DRC_SHIFT 5 125 #define STA350_CONFD_DRC_SHIFT 5 122 #define STA350_CONFD_ZDE_SHIFT 6 126 #define STA350_CONFD_ZDE_SHIFT 6 123 #define STA350_CONFD_SME_SHIFT 7 127 #define STA350_CONFD_SME_SHIFT 7 124 128 125 /* 0x04 CONFE */ 129 /* 0x04 CONFE */ 126 #define STA350_CONFE_MPCV BIT(0) 130 #define STA350_CONFE_MPCV BIT(0) 127 #define STA350_CONFE_MPCV_SHIFT 0 131 #define STA350_CONFE_MPCV_SHIFT 0 128 #define STA350_CONFE_MPC BIT(1) 132 #define STA350_CONFE_MPC BIT(1) 129 #define STA350_CONFE_MPC_SHIFT 1 133 #define STA350_CONFE_MPC_SHIFT 1 130 #define STA350_CONFE_NSBW BIT(2) 134 #define STA350_CONFE_NSBW BIT(2) 131 #define STA350_CONFE_NSBW_SHIFT 2 135 #define STA350_CONFE_NSBW_SHIFT 2 132 #define STA350_CONFE_AME BIT(3) 136 #define STA350_CONFE_AME BIT(3) 133 #define STA350_CONFE_AME_SHIFT 3 137 #define STA350_CONFE_AME_SHIFT 3 134 #define STA350_CONFE_PWMS BIT(4) 138 #define STA350_CONFE_PWMS BIT(4) 135 #define STA350_CONFE_PWMS_SHIFT 4 139 #define STA350_CONFE_PWMS_SHIFT 4 136 #define STA350_CONFE_DCCV BIT(5) 140 #define STA350_CONFE_DCCV BIT(5) 137 #define STA350_CONFE_DCCV_SHIFT 5 141 #define STA350_CONFE_DCCV_SHIFT 5 138 #define STA350_CONFE_ZCE BIT(6) 142 #define STA350_CONFE_ZCE BIT(6) 139 #define STA350_CONFE_ZCE_SHIFT 6 143 #define STA350_CONFE_ZCE_SHIFT 6 140 #define STA350_CONFE_SVE BIT(7) 144 #define STA350_CONFE_SVE BIT(7) 141 #define STA350_CONFE_SVE_SHIFT 7 145 #define STA350_CONFE_SVE_SHIFT 7 142 146 143 /* 0x05 CONFF */ 147 /* 0x05 CONFF */ 144 #define STA350_CONFF_OCFG_MASK 0x03 148 #define STA350_CONFF_OCFG_MASK 0x03 145 #define STA350_CONFF_OCFG_SHIFT 0 149 #define STA350_CONFF_OCFG_SHIFT 0 146 #define STA350_CONFF_IDE BIT(2) 150 #define STA350_CONFF_IDE BIT(2) 147 #define STA350_CONFF_BCLE BIT(3) 151 #define STA350_CONFF_BCLE BIT(3) 148 #define STA350_CONFF_LDTE BIT(4) 152 #define STA350_CONFF_LDTE BIT(4) 149 #define STA350_CONFF_ECLE BIT(5) 153 #define STA350_CONFF_ECLE BIT(5) 150 #define STA350_CONFF_PWDN BIT(6) 154 #define STA350_CONFF_PWDN BIT(6) 151 #define STA350_CONFF_EAPD BIT(7) 155 #define STA350_CONFF_EAPD BIT(7) 152 156 153 /* 0x06 MMUTE */ 157 /* 0x06 MMUTE */ 154 #define STA350_MMUTE_MMUTE 0x01 158 #define STA350_MMUTE_MMUTE 0x01 155 #define STA350_MMUTE_MMUTE_SHIFT 0 159 #define STA350_MMUTE_MMUTE_SHIFT 0 156 #define STA350_MMUTE_C1M 0x02 160 #define STA350_MMUTE_C1M 0x02 157 #define STA350_MMUTE_C1M_SHIFT 1 161 #define STA350_MMUTE_C1M_SHIFT 1 158 #define STA350_MMUTE_C2M 0x04 162 #define STA350_MMUTE_C2M 0x04 159 #define STA350_MMUTE_C2M_SHIFT 2 163 #define STA350_MMUTE_C2M_SHIFT 2 160 #define STA350_MMUTE_C3M 0x08 164 #define STA350_MMUTE_C3M 0x08 161 #define STA350_MMUTE_C3M_SHIFT 3 165 #define STA350_MMUTE_C3M_SHIFT 3 162 #define STA350_MMUTE_LOC_MASK 0xC0 166 #define STA350_MMUTE_LOC_MASK 0xC0 163 #define STA350_MMUTE_LOC_SHIFT 6 167 #define STA350_MMUTE_LOC_SHIFT 6 164 168 165 /* 0x0b AUTO1 */ 169 /* 0x0b AUTO1 */ 166 #define STA350_AUTO1_AMGC_MASK 0x30 170 #define STA350_AUTO1_AMGC_MASK 0x30 167 #define STA350_AUTO1_AMGC_SHIFT 4 171 #define STA350_AUTO1_AMGC_SHIFT 4 168 172 169 /* 0x0c AUTO2 */ 173 /* 0x0c AUTO2 */ 170 #define STA350_AUTO2_AMAME 0x01 174 #define STA350_AUTO2_AMAME 0x01 171 #define STA350_AUTO2_AMAM_MASK 0x0e 175 #define STA350_AUTO2_AMAM_MASK 0x0e 172 #define STA350_AUTO2_AMAM_SHIFT 1 176 #define STA350_AUTO2_AMAM_SHIFT 1 173 #define STA350_AUTO2_XO_MASK 0xf0 177 #define STA350_AUTO2_XO_MASK 0xf0 174 #define STA350_AUTO2_XO_SHIFT 4 178 #define STA350_AUTO2_XO_SHIFT 4 175 179 176 /* 0x0d AUTO3 */ 180 /* 0x0d AUTO3 */ 177 #define STA350_AUTO3_PEQ_MASK 0x1f 181 #define STA350_AUTO3_PEQ_MASK 0x1f 178 #define STA350_AUTO3_PEQ_SHIFT 0 182 #define STA350_AUTO3_PEQ_SHIFT 0 179 183 180 /* 0x0e 0x0f 0x10 CxCFG */ 184 /* 0x0e 0x0f 0x10 CxCFG */ 181 #define STA350_CxCFG_TCB_SHIFT 0 185 #define STA350_CxCFG_TCB_SHIFT 0 182 #define STA350_CxCFG_EQBP_SHIFT 1 186 #define STA350_CxCFG_EQBP_SHIFT 1 183 #define STA350_CxCFG_VBP_SHIFT 2 187 #define STA350_CxCFG_VBP_SHIFT 2 184 #define STA350_CxCFG_BO_SHIFT 3 188 #define STA350_CxCFG_BO_SHIFT 3 185 #define STA350_CxCFG_LS_SHIFT 4 189 #define STA350_CxCFG_LS_SHIFT 4 186 #define STA350_CxCFG_OM_MASK 0xc0 190 #define STA350_CxCFG_OM_MASK 0xc0 187 #define STA350_CxCFG_OM_SHIFT 6 191 #define STA350_CxCFG_OM_SHIFT 6 188 192 189 /* 0x11 TONE */ 193 /* 0x11 TONE */ 190 #define STA350_TONE_BTC_SHIFT 0 194 #define STA350_TONE_BTC_SHIFT 0 191 #define STA350_TONE_TTC_SHIFT 4 195 #define STA350_TONE_TTC_SHIFT 4 192 196 193 /* 0x12 0x13 0x14 0x15 limiter attack/release 197 /* 0x12 0x13 0x14 0x15 limiter attack/release */ 194 #define STA350_LxA_SHIFT 0 198 #define STA350_LxA_SHIFT 0 195 #define STA350_LxR_SHIFT 4 199 #define STA350_LxR_SHIFT 4 196 200 197 /* 0x26 CFUD */ 201 /* 0x26 CFUD */ 198 #define STA350_CFUD_W1 0x01 202 #define STA350_CFUD_W1 0x01 199 #define STA350_CFUD_WA 0x02 203 #define STA350_CFUD_WA 0x02 200 #define STA350_CFUD_R1 0x04 204 #define STA350_CFUD_R1 0x04 201 #define STA350_CFUD_RA 0x08 205 #define STA350_CFUD_RA 0x08 202 206 203 207 204 /* biquad filter coefficient table offsets */ 208 /* biquad filter coefficient table offsets */ 205 #define STA350_C1_BQ_BASE 0 209 #define STA350_C1_BQ_BASE 0 206 #define STA350_C2_BQ_BASE 20 210 #define STA350_C2_BQ_BASE 20 207 #define STA350_CH_BQ_NUM 4 211 #define STA350_CH_BQ_NUM 4 208 #define STA350_BQ_NUM_COEF 5 212 #define STA350_BQ_NUM_COEF 5 209 #define STA350_XO_HP_BQ_BASE 40 213 #define STA350_XO_HP_BQ_BASE 40 210 #define STA350_XO_LP_BQ_BASE 45 214 #define STA350_XO_LP_BQ_BASE 45 211 #define STA350_C1_PRESCALE 50 215 #define STA350_C1_PRESCALE 50 212 #define STA350_C2_PRESCALE 51 216 #define STA350_C2_PRESCALE 51 213 #define STA350_C1_POSTSCALE 52 217 #define STA350_C1_POSTSCALE 52 214 #define STA350_C2_POSTSCALE 53 218 #define STA350_C2_POSTSCALE 53 215 #define STA350_C3_POSTSCALE 54 219 #define STA350_C3_POSTSCALE 54 216 #define STA350_TW_POSTSCALE 55 220 #define STA350_TW_POSTSCALE 55 217 #define STA350_C1_MIX1 56 221 #define STA350_C1_MIX1 56 218 #define STA350_C1_MIX2 57 222 #define STA350_C1_MIX2 57 219 #define STA350_C2_MIX1 58 223 #define STA350_C2_MIX1 58 220 #define STA350_C2_MIX2 59 224 #define STA350_C2_MIX2 59 221 #define STA350_C3_MIX1 60 225 #define STA350_C3_MIX1 60 222 #define STA350_C3_MIX2 61 226 #define STA350_C3_MIX2 61 223 227 224 /* miscellaneous register 1 */ 228 /* miscellaneous register 1 */ 225 #define STA350_MISC1_CPWMEN BIT(2) 229 #define STA350_MISC1_CPWMEN BIT(2) 226 #define STA350_MISC1_BRIDGOFF BIT(5) 230 #define STA350_MISC1_BRIDGOFF BIT(5) 227 #define STA350_MISC1_NSHHPEN BIT(6) 231 #define STA350_MISC1_NSHHPEN BIT(6) 228 #define STA350_MISC1_RPDNEN BIT(7) 232 #define STA350_MISC1_RPDNEN BIT(7) 229 233 230 /* miscellaneous register 2 */ 234 /* miscellaneous register 2 */ 231 #define STA350_MISC2_PNDLSL_MASK 0x1c 235 #define STA350_MISC2_PNDLSL_MASK 0x1c 232 #define STA350_MISC2_PNDLSL_SHIFT 2 236 #define STA350_MISC2_PNDLSL_SHIFT 2 233 237 234 #endif /* _ASOC_STA_350_H */ 238 #endif /* _ASOC_STA_350_H */ 235 239
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.