1 // SPDX-License-Identifier: GPL-2.0-only << 2 /* 1 /* 3 * lm49453.c - LM49453 ALSA Soc Audio driver 2 * lm49453.c - LM49453 ALSA Soc Audio driver 4 * 3 * 5 * Copyright (c) 2012 Texas Instruments, Inc 4 * Copyright (c) 2012 Texas Instruments, Inc 6 * 5 * >> 6 * This program is free software; you can redistribute it and/or modify >> 7 * it under the terms of the GNU General Public License as published by >> 8 * the Free Software Foundation; version 2 of the License. >> 9 * 7 * Initially based on sound/soc/codecs/wm8350. 10 * Initially based on sound/soc/codecs/wm8350.c 8 */ 11 */ 9 12 10 #include <linux/module.h> 13 #include <linux/module.h> 11 #include <linux/moduleparam.h> 14 #include <linux/moduleparam.h> 12 #include <linux/kernel.h> 15 #include <linux/kernel.h> 13 #include <linux/init.h> 16 #include <linux/init.h> 14 #include <linux/delay.h> 17 #include <linux/delay.h> 15 #include <linux/pm.h> 18 #include <linux/pm.h> 16 #include <linux/i2c.h> 19 #include <linux/i2c.h> 17 #include <linux/regmap.h> 20 #include <linux/regmap.h> 18 #include <linux/slab.h> 21 #include <linux/slab.h> 19 #include <sound/core.h> 22 #include <sound/core.h> 20 #include <sound/pcm.h> 23 #include <sound/pcm.h> 21 #include <sound/pcm_params.h> 24 #include <sound/pcm_params.h> 22 #include <sound/soc.h> 25 #include <sound/soc.h> 23 #include <sound/soc-dapm.h> 26 #include <sound/soc-dapm.h> 24 #include <sound/tlv.h> 27 #include <sound/tlv.h> 25 #include <sound/jack.h> 28 #include <sound/jack.h> 26 #include <sound/initval.h> 29 #include <sound/initval.h> 27 #include <asm/div64.h> 30 #include <asm/div64.h> 28 #include "lm49453.h" 31 #include "lm49453.h" 29 32 30 static const struct reg_default lm49453_reg_de 33 static const struct reg_default lm49453_reg_defs[] = { 31 { 0, 0x00 }, 34 { 0, 0x00 }, 32 { 1, 0x00 }, 35 { 1, 0x00 }, 33 { 2, 0x00 }, 36 { 2, 0x00 }, 34 { 3, 0x00 }, 37 { 3, 0x00 }, 35 { 4, 0x00 }, 38 { 4, 0x00 }, 36 { 5, 0x00 }, 39 { 5, 0x00 }, 37 { 6, 0x00 }, 40 { 6, 0x00 }, 38 { 7, 0x00 }, 41 { 7, 0x00 }, 39 { 8, 0x00 }, 42 { 8, 0x00 }, 40 { 9, 0x00 }, 43 { 9, 0x00 }, 41 { 10, 0x00 }, 44 { 10, 0x00 }, 42 { 11, 0x00 }, 45 { 11, 0x00 }, 43 { 12, 0x00 }, 46 { 12, 0x00 }, 44 { 13, 0x00 }, 47 { 13, 0x00 }, 45 { 14, 0x00 }, 48 { 14, 0x00 }, 46 { 15, 0x00 }, 49 { 15, 0x00 }, 47 { 16, 0x00 }, 50 { 16, 0x00 }, 48 { 17, 0x00 }, 51 { 17, 0x00 }, 49 { 18, 0x00 }, 52 { 18, 0x00 }, 50 { 19, 0x00 }, 53 { 19, 0x00 }, 51 { 20, 0x00 }, 54 { 20, 0x00 }, 52 { 21, 0x00 }, 55 { 21, 0x00 }, 53 { 22, 0x00 }, 56 { 22, 0x00 }, 54 { 23, 0x00 }, 57 { 23, 0x00 }, 55 { 32, 0x00 }, 58 { 32, 0x00 }, 56 { 33, 0x00 }, 59 { 33, 0x00 }, 57 { 35, 0x00 }, 60 { 35, 0x00 }, 58 { 36, 0x00 }, 61 { 36, 0x00 }, 59 { 37, 0x00 }, 62 { 37, 0x00 }, 60 { 46, 0x00 }, 63 { 46, 0x00 }, 61 { 48, 0x00 }, 64 { 48, 0x00 }, 62 { 49, 0x00 }, 65 { 49, 0x00 }, 63 { 51, 0x00 }, 66 { 51, 0x00 }, 64 { 56, 0x00 }, 67 { 56, 0x00 }, 65 { 58, 0x00 }, 68 { 58, 0x00 }, 66 { 59, 0x00 }, 69 { 59, 0x00 }, 67 { 60, 0x00 }, 70 { 60, 0x00 }, 68 { 61, 0x00 }, 71 { 61, 0x00 }, 69 { 62, 0x00 }, 72 { 62, 0x00 }, 70 { 63, 0x00 }, 73 { 63, 0x00 }, 71 { 64, 0x00 }, 74 { 64, 0x00 }, 72 { 65, 0x00 }, 75 { 65, 0x00 }, 73 { 66, 0x00 }, 76 { 66, 0x00 }, 74 { 67, 0x00 }, 77 { 67, 0x00 }, 75 { 68, 0x00 }, 78 { 68, 0x00 }, 76 { 69, 0x00 }, 79 { 69, 0x00 }, 77 { 70, 0x00 }, 80 { 70, 0x00 }, 78 { 71, 0x00 }, 81 { 71, 0x00 }, 79 { 72, 0x00 }, 82 { 72, 0x00 }, 80 { 73, 0x00 }, 83 { 73, 0x00 }, 81 { 74, 0x00 }, 84 { 74, 0x00 }, 82 { 75, 0x00 }, 85 { 75, 0x00 }, 83 { 76, 0x00 }, 86 { 76, 0x00 }, 84 { 77, 0x00 }, 87 { 77, 0x00 }, 85 { 78, 0x00 }, 88 { 78, 0x00 }, 86 { 79, 0x00 }, 89 { 79, 0x00 }, 87 { 80, 0x00 }, 90 { 80, 0x00 }, 88 { 81, 0x00 }, 91 { 81, 0x00 }, 89 { 82, 0x00 }, 92 { 82, 0x00 }, 90 { 83, 0x00 }, 93 { 83, 0x00 }, 91 { 85, 0x00 }, 94 { 85, 0x00 }, 92 { 85, 0x00 }, 95 { 85, 0x00 }, 93 { 86, 0x00 }, 96 { 86, 0x00 }, 94 { 87, 0x00 }, 97 { 87, 0x00 }, 95 { 88, 0x00 }, 98 { 88, 0x00 }, 96 { 89, 0x00 }, 99 { 89, 0x00 }, 97 { 90, 0x00 }, 100 { 90, 0x00 }, 98 { 91, 0x00 }, 101 { 91, 0x00 }, 99 { 92, 0x00 }, 102 { 92, 0x00 }, 100 { 93, 0x00 }, 103 { 93, 0x00 }, 101 { 94, 0x00 }, 104 { 94, 0x00 }, 102 { 95, 0x00 }, 105 { 95, 0x00 }, 103 { 96, 0x01 }, 106 { 96, 0x01 }, 104 { 97, 0x00 }, 107 { 97, 0x00 }, 105 { 98, 0x00 }, 108 { 98, 0x00 }, 106 { 99, 0x00 }, 109 { 99, 0x00 }, 107 { 100, 0x00 }, 110 { 100, 0x00 }, 108 { 101, 0x00 }, 111 { 101, 0x00 }, 109 { 102, 0x00 }, 112 { 102, 0x00 }, 110 { 103, 0x01 }, 113 { 103, 0x01 }, 111 { 104, 0x01 }, 114 { 104, 0x01 }, 112 { 105, 0x00 }, 115 { 105, 0x00 }, 113 { 106, 0x01 }, 116 { 106, 0x01 }, 114 { 107, 0x00 }, 117 { 107, 0x00 }, 115 { 108, 0x00 }, 118 { 108, 0x00 }, 116 { 109, 0x00 }, 119 { 109, 0x00 }, 117 { 110, 0x00 }, 120 { 110, 0x00 }, 118 { 111, 0x02 }, 121 { 111, 0x02 }, 119 { 112, 0x02 }, 122 { 112, 0x02 }, 120 { 113, 0x00 }, 123 { 113, 0x00 }, 121 { 121, 0x80 }, 124 { 121, 0x80 }, 122 { 122, 0xBB }, 125 { 122, 0xBB }, 123 { 123, 0x80 }, 126 { 123, 0x80 }, 124 { 124, 0xBB }, 127 { 124, 0xBB }, 125 { 128, 0x00 }, 128 { 128, 0x00 }, 126 { 130, 0x00 }, 129 { 130, 0x00 }, 127 { 131, 0x00 }, 130 { 131, 0x00 }, 128 { 132, 0x00 }, 131 { 132, 0x00 }, 129 { 133, 0x0A }, 132 { 133, 0x0A }, 130 { 134, 0x0A }, 133 { 134, 0x0A }, 131 { 135, 0x0A }, 134 { 135, 0x0A }, 132 { 136, 0x0F }, 135 { 136, 0x0F }, 133 { 137, 0x00 }, 136 { 137, 0x00 }, 134 { 138, 0x73 }, 137 { 138, 0x73 }, 135 { 139, 0x33 }, 138 { 139, 0x33 }, 136 { 140, 0x73 }, 139 { 140, 0x73 }, 137 { 141, 0x33 }, 140 { 141, 0x33 }, 138 { 142, 0x73 }, 141 { 142, 0x73 }, 139 { 143, 0x33 }, 142 { 143, 0x33 }, 140 { 144, 0x73 }, 143 { 144, 0x73 }, 141 { 145, 0x33 }, 144 { 145, 0x33 }, 142 { 146, 0x73 }, 145 { 146, 0x73 }, 143 { 147, 0x33 }, 146 { 147, 0x33 }, 144 { 148, 0x73 }, 147 { 148, 0x73 }, 145 { 149, 0x33 }, 148 { 149, 0x33 }, 146 { 150, 0x73 }, 149 { 150, 0x73 }, 147 { 151, 0x33 }, 150 { 151, 0x33 }, 148 { 152, 0x00 }, 151 { 152, 0x00 }, 149 { 153, 0x00 }, 152 { 153, 0x00 }, 150 { 154, 0x00 }, 153 { 154, 0x00 }, 151 { 155, 0x00 }, 154 { 155, 0x00 }, 152 { 176, 0x00 }, 155 { 176, 0x00 }, 153 { 177, 0x00 }, 156 { 177, 0x00 }, 154 { 178, 0x00 }, 157 { 178, 0x00 }, 155 { 179, 0x00 }, 158 { 179, 0x00 }, 156 { 180, 0x00 }, 159 { 180, 0x00 }, 157 { 181, 0x00 }, 160 { 181, 0x00 }, 158 { 182, 0x00 }, 161 { 182, 0x00 }, 159 { 183, 0x00 }, 162 { 183, 0x00 }, 160 { 184, 0x00 }, 163 { 184, 0x00 }, 161 { 185, 0x00 }, 164 { 185, 0x00 }, 162 { 186, 0x00 }, 165 { 186, 0x00 }, 163 { 187, 0x00 }, 166 { 187, 0x00 }, 164 { 188, 0x00 }, 167 { 188, 0x00 }, 165 { 189, 0x00 }, 168 { 189, 0x00 }, 166 { 208, 0x06 }, 169 { 208, 0x06 }, 167 { 209, 0x00 }, 170 { 209, 0x00 }, 168 { 210, 0x08 }, 171 { 210, 0x08 }, 169 { 211, 0x54 }, 172 { 211, 0x54 }, 170 { 212, 0x14 }, 173 { 212, 0x14 }, 171 { 213, 0x0d }, 174 { 213, 0x0d }, 172 { 214, 0x0d }, 175 { 214, 0x0d }, 173 { 215, 0x14 }, 176 { 215, 0x14 }, 174 { 216, 0x60 }, 177 { 216, 0x60 }, 175 { 221, 0x00 }, 178 { 221, 0x00 }, 176 { 222, 0x00 }, 179 { 222, 0x00 }, 177 { 223, 0x00 }, 180 { 223, 0x00 }, 178 { 224, 0x00 }, 181 { 224, 0x00 }, 179 { 248, 0x00 }, 182 { 248, 0x00 }, 180 { 249, 0x00 }, 183 { 249, 0x00 }, 181 { 250, 0x00 }, 184 { 250, 0x00 }, 182 { 255, 0x00 }, 185 { 255, 0x00 }, 183 }; 186 }; 184 187 185 /* codec private data */ 188 /* codec private data */ 186 struct lm49453_priv { 189 struct lm49453_priv { 187 struct regmap *regmap; 190 struct regmap *regmap; 188 }; 191 }; 189 192 190 /* capture path controls */ 193 /* capture path controls */ 191 194 192 static const char *lm49453_mic2mode_text[] = { 195 static const char *lm49453_mic2mode_text[] = {"Single Ended", "Differential"}; 193 196 194 static SOC_ENUM_SINGLE_DECL(lm49453_mic2mode_e 197 static SOC_ENUM_SINGLE_DECL(lm49453_mic2mode_enum, LM49453_P0_MICR_REG, 5, 195 lm49453_mic2mode_t 198 lm49453_mic2mode_text); 196 199 197 static const char *lm49453_dmic_cfg_text[] = { 200 static const char *lm49453_dmic_cfg_text[] = {"DMICDAT1", "DMICDAT2"}; 198 201 199 static SOC_ENUM_SINGLE_DECL(lm49453_dmic12_cfg 202 static SOC_ENUM_SINGLE_DECL(lm49453_dmic12_cfg_enum, 200 LM49453_P0_DIGITAL 203 LM49453_P0_DIGITAL_MIC1_CONFIG_REG, 7, 201 lm49453_dmic_cfg_t 204 lm49453_dmic_cfg_text); 202 205 203 static SOC_ENUM_SINGLE_DECL(lm49453_dmic34_cfg 206 static SOC_ENUM_SINGLE_DECL(lm49453_dmic34_cfg_enum, 204 LM49453_P0_DIGITAL 207 LM49453_P0_DIGITAL_MIC2_CONFIG_REG, 7, 205 lm49453_dmic_cfg_t 208 lm49453_dmic_cfg_text); 206 209 207 /* MUX Controls */ 210 /* MUX Controls */ 208 static const char *lm49453_adcl_mux_text[] = { 211 static const char *lm49453_adcl_mux_text[] = { "MIC1", "Aux_L" }; 209 212 210 static const char *lm49453_adcr_mux_text[] = { 213 static const char *lm49453_adcr_mux_text[] = { "MIC2", "Aux_R" }; 211 214 212 static SOC_ENUM_SINGLE_DECL(lm49453_adcl_enum, 215 static SOC_ENUM_SINGLE_DECL(lm49453_adcl_enum, 213 LM49453_P0_ANALOG_ 216 LM49453_P0_ANALOG_MIXER_ADC_REG, 0, 214 lm49453_adcl_mux_t 217 lm49453_adcl_mux_text); 215 218 216 static SOC_ENUM_SINGLE_DECL(lm49453_adcr_enum, 219 static SOC_ENUM_SINGLE_DECL(lm49453_adcr_enum, 217 LM49453_P0_ANALOG_ 220 LM49453_P0_ANALOG_MIXER_ADC_REG, 1, 218 lm49453_adcr_mux_t 221 lm49453_adcr_mux_text); 219 222 220 static const struct snd_kcontrol_new lm49453_a 223 static const struct snd_kcontrol_new lm49453_adcl_mux_control = 221 SOC_DAPM_ENUM("ADC Left Mux", lm49453_ 224 SOC_DAPM_ENUM("ADC Left Mux", lm49453_adcl_enum); 222 225 223 static const struct snd_kcontrol_new lm49453_a 226 static const struct snd_kcontrol_new lm49453_adcr_mux_control = 224 SOC_DAPM_ENUM("ADC Right Mux", lm49453 227 SOC_DAPM_ENUM("ADC Right Mux", lm49453_adcr_enum); 225 228 226 static const struct snd_kcontrol_new lm49453_h 229 static const struct snd_kcontrol_new lm49453_headset_left_mixer[] = { 227 SOC_DAPM_SINGLE("Port1_1 Switch", LM49453_P0_D 230 SOC_DAPM_SINGLE("Port1_1 Switch", LM49453_P0_DACHPL1_REG, 0, 1, 0), 228 SOC_DAPM_SINGLE("Port1_2 Switch", LM49453_P0_D 231 SOC_DAPM_SINGLE("Port1_2 Switch", LM49453_P0_DACHPL1_REG, 1, 1, 0), 229 SOC_DAPM_SINGLE("Port1_3 Switch", LM49453_P0_D 232 SOC_DAPM_SINGLE("Port1_3 Switch", LM49453_P0_DACHPL1_REG, 2, 1, 0), 230 SOC_DAPM_SINGLE("Port1_4 Switch", LM49453_P0_D 233 SOC_DAPM_SINGLE("Port1_4 Switch", LM49453_P0_DACHPL1_REG, 3, 1, 0), 231 SOC_DAPM_SINGLE("Port1_5 Switch", LM49453_P0_D 234 SOC_DAPM_SINGLE("Port1_5 Switch", LM49453_P0_DACHPL1_REG, 4, 1, 0), 232 SOC_DAPM_SINGLE("Port1_6 Switch", LM49453_P0_D 235 SOC_DAPM_SINGLE("Port1_6 Switch", LM49453_P0_DACHPL1_REG, 5, 1, 0), 233 SOC_DAPM_SINGLE("Port1_7 Switch", LM49453_P0_D 236 SOC_DAPM_SINGLE("Port1_7 Switch", LM49453_P0_DACHPL1_REG, 6, 1, 0), 234 SOC_DAPM_SINGLE("Port1_8 Switch", LM49453_P0_D 237 SOC_DAPM_SINGLE("Port1_8 Switch", LM49453_P0_DACHPL1_REG, 7, 1, 0), 235 SOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_DA 238 SOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_DACHPL2_REG, 0, 1, 0), 236 SOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_DA 239 SOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_DACHPL2_REG, 1, 1, 0), 237 SOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_DA 240 SOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_DACHPL2_REG, 2, 1, 0), 238 SOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_DA 241 SOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_DACHPL2_REG, 3, 1, 0), 239 SOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_DACH 242 SOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_DACHPL2_REG, 4, 1, 0), 240 SOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_DACH 243 SOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_DACHPL2_REG, 5, 1, 0), 241 SOC_DAPM_SINGLE("Port2_1 Switch", LM49453_P0_D 244 SOC_DAPM_SINGLE("Port2_1 Switch", LM49453_P0_DACHPL2_REG, 6, 1, 0), 242 SOC_DAPM_SINGLE("Port2_2 Switch", LM49453_P0_D 245 SOC_DAPM_SINGLE("Port2_2 Switch", LM49453_P0_DACHPL2_REG, 7, 1, 0), 243 SOC_DAPM_SINGLE("Sidetone Switch", LM49453_P0_ 246 SOC_DAPM_SINGLE("Sidetone Switch", LM49453_P0_STN_SEL_REG, 0, 0, 0), 244 }; 247 }; 245 248 246 static const struct snd_kcontrol_new lm49453_h 249 static const struct snd_kcontrol_new lm49453_headset_right_mixer[] = { 247 SOC_DAPM_SINGLE("Port1_1 Switch", LM49453_P0_D 250 SOC_DAPM_SINGLE("Port1_1 Switch", LM49453_P0_DACHPR1_REG, 0, 1, 0), 248 SOC_DAPM_SINGLE("Port1_2 Switch", LM49453_P0_D 251 SOC_DAPM_SINGLE("Port1_2 Switch", LM49453_P0_DACHPR1_REG, 1, 1, 0), 249 SOC_DAPM_SINGLE("Port1_3 Switch", LM49453_P0_D 252 SOC_DAPM_SINGLE("Port1_3 Switch", LM49453_P0_DACHPR1_REG, 2, 1, 0), 250 SOC_DAPM_SINGLE("Port1_4 Switch", LM49453_P0_D 253 SOC_DAPM_SINGLE("Port1_4 Switch", LM49453_P0_DACHPR1_REG, 3, 1, 0), 251 SOC_DAPM_SINGLE("Port1_5 Switch", LM49453_P0_D 254 SOC_DAPM_SINGLE("Port1_5 Switch", LM49453_P0_DACHPR1_REG, 4, 1, 0), 252 SOC_DAPM_SINGLE("Port1_6 Switch", LM49453_P0_D 255 SOC_DAPM_SINGLE("Port1_6 Switch", LM49453_P0_DACHPR1_REG, 5, 1, 0), 253 SOC_DAPM_SINGLE("Port1_7 Switch", LM49453_P0_D 256 SOC_DAPM_SINGLE("Port1_7 Switch", LM49453_P0_DACHPR1_REG, 6, 1, 0), 254 SOC_DAPM_SINGLE("Port1_8 Switch", LM49453_P0_D 257 SOC_DAPM_SINGLE("Port1_8 Switch", LM49453_P0_DACHPR1_REG, 7, 1, 0), 255 SOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_DA 258 SOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_DACHPR2_REG, 0, 1, 0), 256 SOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_DA 259 SOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_DACHPR2_REG, 1, 1, 0), 257 SOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_DA 260 SOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_DACHPR2_REG, 2, 1, 0), 258 SOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_DA 261 SOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_DACHPR2_REG, 3, 1, 0), 259 SOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_DACH 262 SOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_DACHPR2_REG, 4, 1, 0), 260 SOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_DACH 263 SOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_DACHPR2_REG, 5, 1, 0), 261 SOC_DAPM_SINGLE("Port2_1 Switch", LM49453_P0_D 264 SOC_DAPM_SINGLE("Port2_1 Switch", LM49453_P0_DACHPR2_REG, 6, 1, 0), 262 SOC_DAPM_SINGLE("Port2_2 Switch", LM49453_P0_D 265 SOC_DAPM_SINGLE("Port2_2 Switch", LM49453_P0_DACHPR2_REG, 7, 1, 0), 263 SOC_DAPM_SINGLE("Sidetone Switch", LM49453_P0_ 266 SOC_DAPM_SINGLE("Sidetone Switch", LM49453_P0_STN_SEL_REG, 1, 0, 0), 264 }; 267 }; 265 268 266 static const struct snd_kcontrol_new lm49453_s 269 static const struct snd_kcontrol_new lm49453_speaker_left_mixer[] = { 267 SOC_DAPM_SINGLE("Port1_1 Switch", LM49453_P0_D 270 SOC_DAPM_SINGLE("Port1_1 Switch", LM49453_P0_DACLSL1_REG, 0, 1, 0), 268 SOC_DAPM_SINGLE("Port1_2 Switch", LM49453_P0_D 271 SOC_DAPM_SINGLE("Port1_2 Switch", LM49453_P0_DACLSL1_REG, 1, 1, 0), 269 SOC_DAPM_SINGLE("Port1_3 Switch", LM49453_P0_D 272 SOC_DAPM_SINGLE("Port1_3 Switch", LM49453_P0_DACLSL1_REG, 2, 1, 0), 270 SOC_DAPM_SINGLE("Port1_4 Switch", LM49453_P0_D 273 SOC_DAPM_SINGLE("Port1_4 Switch", LM49453_P0_DACLSL1_REG, 3, 1, 0), 271 SOC_DAPM_SINGLE("Port1_5 Switch", LM49453_P0_D 274 SOC_DAPM_SINGLE("Port1_5 Switch", LM49453_P0_DACLSL1_REG, 4, 1, 0), 272 SOC_DAPM_SINGLE("Port1_6 Switch", LM49453_P0_D 275 SOC_DAPM_SINGLE("Port1_6 Switch", LM49453_P0_DACLSL1_REG, 5, 1, 0), 273 SOC_DAPM_SINGLE("Port1_7 Switch", LM49453_P0_D 276 SOC_DAPM_SINGLE("Port1_7 Switch", LM49453_P0_DACLSL1_REG, 6, 1, 0), 274 SOC_DAPM_SINGLE("Port1_8 Switch", LM49453_P0_D 277 SOC_DAPM_SINGLE("Port1_8 Switch", LM49453_P0_DACLSL1_REG, 7, 1, 0), 275 SOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_DA 278 SOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_DACLSL2_REG, 0, 1, 0), 276 SOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_DA 279 SOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_DACLSL2_REG, 1, 1, 0), 277 SOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_DA 280 SOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_DACLSL2_REG, 2, 1, 0), 278 SOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_DA 281 SOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_DACLSL2_REG, 3, 1, 0), 279 SOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_DACL 282 SOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_DACLSL2_REG, 4, 1, 0), 280 SOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_DACL 283 SOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_DACLSL2_REG, 5, 1, 0), 281 SOC_DAPM_SINGLE("Port2_1 Switch", LM49453_P0_D 284 SOC_DAPM_SINGLE("Port2_1 Switch", LM49453_P0_DACLSL2_REG, 6, 1, 0), 282 SOC_DAPM_SINGLE("Port2_2 Switch", LM49453_P0_D 285 SOC_DAPM_SINGLE("Port2_2 Switch", LM49453_P0_DACLSL2_REG, 7, 1, 0), 283 SOC_DAPM_SINGLE("Sidetone Switch", LM49453_P0_ 286 SOC_DAPM_SINGLE("Sidetone Switch", LM49453_P0_STN_SEL_REG, 2, 0, 0), 284 }; 287 }; 285 288 286 static const struct snd_kcontrol_new lm49453_s 289 static const struct snd_kcontrol_new lm49453_speaker_right_mixer[] = { 287 SOC_DAPM_SINGLE("Port1_1 Switch", LM49453_P0_D 290 SOC_DAPM_SINGLE("Port1_1 Switch", LM49453_P0_DACLSR1_REG, 0, 1, 0), 288 SOC_DAPM_SINGLE("Port1_2 Switch", LM49453_P0_D 291 SOC_DAPM_SINGLE("Port1_2 Switch", LM49453_P0_DACLSR1_REG, 1, 1, 0), 289 SOC_DAPM_SINGLE("Port1_3 Switch", LM49453_P0_D 292 SOC_DAPM_SINGLE("Port1_3 Switch", LM49453_P0_DACLSR1_REG, 2, 1, 0), 290 SOC_DAPM_SINGLE("Port1_4 Switch", LM49453_P0_D 293 SOC_DAPM_SINGLE("Port1_4 Switch", LM49453_P0_DACLSR1_REG, 3, 1, 0), 291 SOC_DAPM_SINGLE("Port1_5 Switch", LM49453_P0_D 294 SOC_DAPM_SINGLE("Port1_5 Switch", LM49453_P0_DACLSR1_REG, 4, 1, 0), 292 SOC_DAPM_SINGLE("Port1_6 Switch", LM49453_P0_D 295 SOC_DAPM_SINGLE("Port1_6 Switch", LM49453_P0_DACLSR1_REG, 5, 1, 0), 293 SOC_DAPM_SINGLE("Port1_7 Switch", LM49453_P0_D 296 SOC_DAPM_SINGLE("Port1_7 Switch", LM49453_P0_DACLSR1_REG, 6, 1, 0), 294 SOC_DAPM_SINGLE("Port1_8 Switch", LM49453_P0_D 297 SOC_DAPM_SINGLE("Port1_8 Switch", LM49453_P0_DACLSR1_REG, 7, 1, 0), 295 SOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_DA 298 SOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_DACLSR2_REG, 0, 1, 0), 296 SOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_DA 299 SOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_DACLSR2_REG, 1, 1, 0), 297 SOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_DA 300 SOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_DACLSR2_REG, 2, 1, 0), 298 SOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_DA 301 SOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_DACLSR2_REG, 3, 1, 0), 299 SOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_DACL 302 SOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_DACLSR2_REG, 4, 1, 0), 300 SOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_DACL 303 SOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_DACLSR2_REG, 5, 1, 0), 301 SOC_DAPM_SINGLE("Port2_1 Switch", LM49453_P0_D 304 SOC_DAPM_SINGLE("Port2_1 Switch", LM49453_P0_DACLSR2_REG, 6, 1, 0), 302 SOC_DAPM_SINGLE("Port2_2 Switch", LM49453_P0_D 305 SOC_DAPM_SINGLE("Port2_2 Switch", LM49453_P0_DACLSR2_REG, 7, 1, 0), 303 SOC_DAPM_SINGLE("Sidetone Switch", LM49453_P0_ 306 SOC_DAPM_SINGLE("Sidetone Switch", LM49453_P0_STN_SEL_REG, 3, 0, 0), 304 }; 307 }; 305 308 306 static const struct snd_kcontrol_new lm49453_h 309 static const struct snd_kcontrol_new lm49453_haptic_left_mixer[] = { 307 SOC_DAPM_SINGLE("Port1_1 Switch", LM49453_P0_D 310 SOC_DAPM_SINGLE("Port1_1 Switch", LM49453_P0_DACHAL1_REG, 0, 1, 0), 308 SOC_DAPM_SINGLE("Port1_2 Switch", LM49453_P0_D 311 SOC_DAPM_SINGLE("Port1_2 Switch", LM49453_P0_DACHAL1_REG, 1, 1, 0), 309 SOC_DAPM_SINGLE("Port1_3 Switch", LM49453_P0_D 312 SOC_DAPM_SINGLE("Port1_3 Switch", LM49453_P0_DACHAL1_REG, 2, 1, 0), 310 SOC_DAPM_SINGLE("Port1_4 Switch", LM49453_P0_D 313 SOC_DAPM_SINGLE("Port1_4 Switch", LM49453_P0_DACHAL1_REG, 3, 1, 0), 311 SOC_DAPM_SINGLE("Port1_5 Switch", LM49453_P0_D 314 SOC_DAPM_SINGLE("Port1_5 Switch", LM49453_P0_DACHAL1_REG, 4, 1, 0), 312 SOC_DAPM_SINGLE("Port1_6 Switch", LM49453_P0_D 315 SOC_DAPM_SINGLE("Port1_6 Switch", LM49453_P0_DACHAL1_REG, 5, 1, 0), 313 SOC_DAPM_SINGLE("Port1_7 Switch", LM49453_P0_D 316 SOC_DAPM_SINGLE("Port1_7 Switch", LM49453_P0_DACHAL1_REG, 6, 1, 0), 314 SOC_DAPM_SINGLE("Port1_8 Switch", LM49453_P0_D 317 SOC_DAPM_SINGLE("Port1_8 Switch", LM49453_P0_DACHAL1_REG, 7, 1, 0), 315 SOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_DA 318 SOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_DACHAL2_REG, 0, 1, 0), 316 SOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_DA 319 SOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_DACHAL2_REG, 1, 1, 0), 317 SOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_DA 320 SOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_DACHAL2_REG, 2, 1, 0), 318 SOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_DA 321 SOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_DACHAL2_REG, 3, 1, 0), 319 SOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_DACH 322 SOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_DACHAL2_REG, 4, 1, 0), 320 SOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_DACH 323 SOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_DACHAL2_REG, 5, 1, 0), 321 SOC_DAPM_SINGLE("Port2_1 Switch", LM49453_P0_D 324 SOC_DAPM_SINGLE("Port2_1 Switch", LM49453_P0_DACHAL2_REG, 6, 1, 0), 322 SOC_DAPM_SINGLE("Port2_2 Switch", LM49453_P0_D 325 SOC_DAPM_SINGLE("Port2_2 Switch", LM49453_P0_DACHAL2_REG, 7, 1, 0), 323 SOC_DAPM_SINGLE("Sidetone Switch", LM49453_P0_ 326 SOC_DAPM_SINGLE("Sidetone Switch", LM49453_P0_STN_SEL_REG, 4, 0, 0), 324 }; 327 }; 325 328 326 static const struct snd_kcontrol_new lm49453_h 329 static const struct snd_kcontrol_new lm49453_haptic_right_mixer[] = { 327 SOC_DAPM_SINGLE("Port1_1 Switch", LM49453_P0_D 330 SOC_DAPM_SINGLE("Port1_1 Switch", LM49453_P0_DACHAR1_REG, 0, 1, 0), 328 SOC_DAPM_SINGLE("Port1_2 Switch", LM49453_P0_D 331 SOC_DAPM_SINGLE("Port1_2 Switch", LM49453_P0_DACHAR1_REG, 1, 1, 0), 329 SOC_DAPM_SINGLE("Port1_3 Switch", LM49453_P0_D 332 SOC_DAPM_SINGLE("Port1_3 Switch", LM49453_P0_DACHAR1_REG, 2, 1, 0), 330 SOC_DAPM_SINGLE("Port1_4 Switch", LM49453_P0_D 333 SOC_DAPM_SINGLE("Port1_4 Switch", LM49453_P0_DACHAR1_REG, 3, 1, 0), 331 SOC_DAPM_SINGLE("Port1_5 Switch", LM49453_P0_D 334 SOC_DAPM_SINGLE("Port1_5 Switch", LM49453_P0_DACHAR1_REG, 4, 1, 0), 332 SOC_DAPM_SINGLE("Port1_6 Switch", LM49453_P0_D 335 SOC_DAPM_SINGLE("Port1_6 Switch", LM49453_P0_DACHAR1_REG, 5, 1, 0), 333 SOC_DAPM_SINGLE("Port1_7 Switch", LM49453_P0_D 336 SOC_DAPM_SINGLE("Port1_7 Switch", LM49453_P0_DACHAR1_REG, 6, 1, 0), 334 SOC_DAPM_SINGLE("Port1_8 Switch", LM49453_P0_D 337 SOC_DAPM_SINGLE("Port1_8 Switch", LM49453_P0_DACHAR1_REG, 7, 1, 0), 335 SOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_DA 338 SOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_DACHAR2_REG, 0, 1, 0), 336 SOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_DA 339 SOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_DACHAR2_REG, 1, 1, 0), 337 SOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_DA 340 SOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_DACHAR2_REG, 2, 1, 0), 338 SOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_DA 341 SOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_DACHAR2_REG, 3, 1, 0), 339 SOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_DACH 342 SOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_DACHAR2_REG, 4, 1, 0), 340 SOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_DACH 343 SOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_DACHAR2_REG, 5, 1, 0), 341 SOC_DAPM_SINGLE("Port2_1 Switch", LM49453_P0_D 344 SOC_DAPM_SINGLE("Port2_1 Switch", LM49453_P0_DACHAR2_REG, 6, 1, 0), 342 SOC_DAPM_SINGLE("Port2_2 Switch", LM49453_P0_D 345 SOC_DAPM_SINGLE("Port2_2 Switch", LM49453_P0_DACHAR2_REG, 7, 1, 0), 343 SOC_DAPM_SINGLE("Sidetone Switch", LM49453_P0_ 346 SOC_DAPM_SINGLE("Sidetone Switch", LM49453_P0_STN_SEL_REG, 5, 0, 0), 344 }; 347 }; 345 348 346 static const struct snd_kcontrol_new lm49453_l 349 static const struct snd_kcontrol_new lm49453_lineout_left_mixer[] = { 347 SOC_DAPM_SINGLE("Port1_1 Switch", LM49453_P0_D 350 SOC_DAPM_SINGLE("Port1_1 Switch", LM49453_P0_DACLOL1_REG, 0, 1, 0), 348 SOC_DAPM_SINGLE("Port1_2 Switch", LM49453_P0_D 351 SOC_DAPM_SINGLE("Port1_2 Switch", LM49453_P0_DACLOL1_REG, 1, 1, 0), 349 SOC_DAPM_SINGLE("Port1_3 Switch", LM49453_P0_D 352 SOC_DAPM_SINGLE("Port1_3 Switch", LM49453_P0_DACLOL1_REG, 2, 1, 0), 350 SOC_DAPM_SINGLE("Port1_4 Switch", LM49453_P0_D 353 SOC_DAPM_SINGLE("Port1_4 Switch", LM49453_P0_DACLOL1_REG, 3, 1, 0), 351 SOC_DAPM_SINGLE("Port1_5 Switch", LM49453_P0_D 354 SOC_DAPM_SINGLE("Port1_5 Switch", LM49453_P0_DACLOL1_REG, 4, 1, 0), 352 SOC_DAPM_SINGLE("Port1_6 Switch", LM49453_P0_D 355 SOC_DAPM_SINGLE("Port1_6 Switch", LM49453_P0_DACLOL1_REG, 5, 1, 0), 353 SOC_DAPM_SINGLE("Port1_7 Switch", LM49453_P0_D 356 SOC_DAPM_SINGLE("Port1_7 Switch", LM49453_P0_DACLOL1_REG, 6, 1, 0), 354 SOC_DAPM_SINGLE("Port1_8 Switch", LM49453_P0_D 357 SOC_DAPM_SINGLE("Port1_8 Switch", LM49453_P0_DACLOL1_REG, 7, 1, 0), 355 SOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_DA 358 SOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_DACLOL2_REG, 0, 1, 0), 356 SOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_DA 359 SOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_DACLOL2_REG, 1, 1, 0), 357 SOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_DA 360 SOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_DACLOL2_REG, 2, 1, 0), 358 SOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_DA 361 SOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_DACLOL2_REG, 3, 1, 0), 359 SOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_DACL 362 SOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_DACLOL2_REG, 4, 1, 0), 360 SOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_DACL 363 SOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_DACLOL2_REG, 5, 1, 0), 361 SOC_DAPM_SINGLE("Port2_1 Switch", LM49453_P0_D 364 SOC_DAPM_SINGLE("Port2_1 Switch", LM49453_P0_DACLOL2_REG, 6, 1, 0), 362 SOC_DAPM_SINGLE("Port2_2 Switch", LM49453_P0_D 365 SOC_DAPM_SINGLE("Port2_2 Switch", LM49453_P0_DACLOL2_REG, 7, 1, 0), 363 SOC_DAPM_SINGLE("Sidetone Switch", LM49453_P0_ 366 SOC_DAPM_SINGLE("Sidetone Switch", LM49453_P0_STN_SEL_REG, 6, 0, 0), 364 }; 367 }; 365 368 366 static const struct snd_kcontrol_new lm49453_l 369 static const struct snd_kcontrol_new lm49453_lineout_right_mixer[] = { 367 SOC_DAPM_SINGLE("Port1_1 Switch", LM49453_P0_D 370 SOC_DAPM_SINGLE("Port1_1 Switch", LM49453_P0_DACLOR1_REG, 0, 1, 0), 368 SOC_DAPM_SINGLE("Port1_2 Switch", LM49453_P0_D 371 SOC_DAPM_SINGLE("Port1_2 Switch", LM49453_P0_DACLOR1_REG, 1, 1, 0), 369 SOC_DAPM_SINGLE("Port1_3 Switch", LM49453_P0_D 372 SOC_DAPM_SINGLE("Port1_3 Switch", LM49453_P0_DACLOR1_REG, 2, 1, 0), 370 SOC_DAPM_SINGLE("Port1_4 Switch", LM49453_P0_D 373 SOC_DAPM_SINGLE("Port1_4 Switch", LM49453_P0_DACLOR1_REG, 3, 1, 0), 371 SOC_DAPM_SINGLE("Port1_5 Switch", LM49453_P0_D 374 SOC_DAPM_SINGLE("Port1_5 Switch", LM49453_P0_DACLOR1_REG, 4, 1, 0), 372 SOC_DAPM_SINGLE("Port1_6 Switch", LM49453_P0_D 375 SOC_DAPM_SINGLE("Port1_6 Switch", LM49453_P0_DACLOR1_REG, 5, 1, 0), 373 SOC_DAPM_SINGLE("Port1_7 Switch", LM49453_P0_D 376 SOC_DAPM_SINGLE("Port1_7 Switch", LM49453_P0_DACLOR1_REG, 6, 1, 0), 374 SOC_DAPM_SINGLE("Port1_8 Switch", LM49453_P0_D 377 SOC_DAPM_SINGLE("Port1_8 Switch", LM49453_P0_DACLOR1_REG, 7, 1, 0), 375 SOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_DA 378 SOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_DACLOR2_REG, 0, 1, 0), 376 SOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_DA 379 SOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_DACLOR2_REG, 1, 1, 0), 377 SOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_DA 380 SOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_DACLOR2_REG, 2, 1, 0), 378 SOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_DA 381 SOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_DACLOR2_REG, 3, 1, 0), 379 SOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_DACL 382 SOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_DACLOR2_REG, 4, 1, 0), 380 SOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_DACL 383 SOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_DACLOR2_REG, 5, 1, 0), 381 SOC_DAPM_SINGLE("Port2_1 Switch", LM49453_P0_D 384 SOC_DAPM_SINGLE("Port2_1 Switch", LM49453_P0_DACLOR2_REG, 6, 1, 0), 382 SOC_DAPM_SINGLE("Port2_2 Switch", LM49453_P0_D 385 SOC_DAPM_SINGLE("Port2_2 Switch", LM49453_P0_DACLOR2_REG, 7, 1, 0), 383 SOC_DAPM_SINGLE("Sidetone Switch", LM49453_P0_ 386 SOC_DAPM_SINGLE("Sidetone Switch", LM49453_P0_STN_SEL_REG, 7, 0, 0), 384 }; 387 }; 385 388 386 static const struct snd_kcontrol_new lm49453_p 389 static const struct snd_kcontrol_new lm49453_port1_tx1_mixer[] = { 387 SOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_PO 390 SOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_PORT1_TX1_REG, 0, 1, 0), 388 SOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_PO 391 SOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_PORT1_TX1_REG, 1, 1, 0), 389 SOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_PO 392 SOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_PORT1_TX1_REG, 2, 1, 0), 390 SOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_PO 393 SOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_PORT1_TX1_REG, 3, 1, 0), 391 SOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_PORT 394 SOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_PORT1_TX1_REG, 4, 1, 0), 392 SOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_PORT 395 SOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_PORT1_TX1_REG, 5, 1, 0), 393 SOC_DAPM_SINGLE("Port1_1 Switch", LM49453_P0_P 396 SOC_DAPM_SINGLE("Port1_1 Switch", LM49453_P0_PORT1_TX1_REG, 6, 1, 0), 394 SOC_DAPM_SINGLE("Port2_1 Switch", LM49453_P0_P 397 SOC_DAPM_SINGLE("Port2_1 Switch", LM49453_P0_PORT1_TX1_REG, 7, 1, 0), 395 }; 398 }; 396 399 397 static const struct snd_kcontrol_new lm49453_p 400 static const struct snd_kcontrol_new lm49453_port1_tx2_mixer[] = { 398 SOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_PO 401 SOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_PORT1_TX2_REG, 0, 1, 0), 399 SOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_PO 402 SOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_PORT1_TX2_REG, 1, 1, 0), 400 SOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_PO 403 SOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_PORT1_TX2_REG, 2, 1, 0), 401 SOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_PO 404 SOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_PORT1_TX2_REG, 3, 1, 0), 402 SOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_PORT 405 SOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_PORT1_TX2_REG, 4, 1, 0), 403 SOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_PORT 406 SOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_PORT1_TX2_REG, 5, 1, 0), 404 SOC_DAPM_SINGLE("Port1_2 Switch", LM49453_P0_P 407 SOC_DAPM_SINGLE("Port1_2 Switch", LM49453_P0_PORT1_TX2_REG, 6, 1, 0), 405 SOC_DAPM_SINGLE("Port2_2 Switch", LM49453_P0_P 408 SOC_DAPM_SINGLE("Port2_2 Switch", LM49453_P0_PORT1_TX2_REG, 7, 1, 0), 406 }; 409 }; 407 410 408 static const struct snd_kcontrol_new lm49453_p 411 static const struct snd_kcontrol_new lm49453_port1_tx3_mixer[] = { 409 SOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_PO 412 SOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_PORT1_TX3_REG, 0, 1, 0), 410 SOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_PO 413 SOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_PORT1_TX3_REG, 1, 1, 0), 411 SOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_PO 414 SOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_PORT1_TX3_REG, 2, 1, 0), 412 SOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_PO 415 SOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_PORT1_TX3_REG, 3, 1, 0), 413 SOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_PORT 416 SOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_PORT1_TX3_REG, 4, 1, 0), 414 SOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_PORT 417 SOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_PORT1_TX3_REG, 5, 1, 0), 415 SOC_DAPM_SINGLE("Port1_3 Switch", LM49453_P0_P 418 SOC_DAPM_SINGLE("Port1_3 Switch", LM49453_P0_PORT1_TX3_REG, 6, 1, 0), 416 }; 419 }; 417 420 418 static const struct snd_kcontrol_new lm49453_p 421 static const struct snd_kcontrol_new lm49453_port1_tx4_mixer[] = { 419 SOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_PO 422 SOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_PORT1_TX4_REG, 0, 1, 0), 420 SOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_PO 423 SOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_PORT1_TX4_REG, 1, 1, 0), 421 SOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_PO 424 SOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_PORT1_TX4_REG, 2, 1, 0), 422 SOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_PO 425 SOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_PORT1_TX4_REG, 3, 1, 0), 423 SOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_PORT 426 SOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_PORT1_TX4_REG, 4, 1, 0), 424 SOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_PORT 427 SOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_PORT1_TX4_REG, 5, 1, 0), 425 SOC_DAPM_SINGLE("Port1_4 Switch", LM49453_P0_P 428 SOC_DAPM_SINGLE("Port1_4 Switch", LM49453_P0_PORT1_TX4_REG, 6, 1, 0), 426 }; 429 }; 427 430 428 static const struct snd_kcontrol_new lm49453_p 431 static const struct snd_kcontrol_new lm49453_port1_tx5_mixer[] = { 429 SOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_PO 432 SOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_PORT1_TX5_REG, 0, 1, 0), 430 SOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_PO 433 SOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_PORT1_TX5_REG, 1, 1, 0), 431 SOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_PO 434 SOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_PORT1_TX5_REG, 2, 1, 0), 432 SOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_PO 435 SOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_PORT1_TX5_REG, 3, 1, 0), 433 SOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_PORT 436 SOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_PORT1_TX5_REG, 4, 1, 0), 434 SOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_PORT 437 SOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_PORT1_TX5_REG, 5, 1, 0), 435 SOC_DAPM_SINGLE("Port1_5 Switch", LM49453_P0_P 438 SOC_DAPM_SINGLE("Port1_5 Switch", LM49453_P0_PORT1_TX5_REG, 6, 1, 0), 436 }; 439 }; 437 440 438 static const struct snd_kcontrol_new lm49453_p 441 static const struct snd_kcontrol_new lm49453_port1_tx6_mixer[] = { 439 SOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_PO 442 SOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_PORT1_TX6_REG, 0, 1, 0), 440 SOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_PO 443 SOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_PORT1_TX6_REG, 1, 1, 0), 441 SOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_PO 444 SOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_PORT1_TX6_REG, 2, 1, 0), 442 SOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_PO 445 SOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_PORT1_TX6_REG, 3, 1, 0), 443 SOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_PORT 446 SOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_PORT1_TX6_REG, 4, 1, 0), 444 SOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_PORT 447 SOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_PORT1_TX6_REG, 5, 1, 0), 445 SOC_DAPM_SINGLE("Port1_6 Switch", LM49453_P0_P 448 SOC_DAPM_SINGLE("Port1_6 Switch", LM49453_P0_PORT1_TX6_REG, 6, 1, 0), 446 }; 449 }; 447 450 448 static const struct snd_kcontrol_new lm49453_p 451 static const struct snd_kcontrol_new lm49453_port1_tx7_mixer[] = { 449 SOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_PO 452 SOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_PORT1_TX7_REG, 0, 1, 0), 450 SOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_PO 453 SOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_PORT1_TX7_REG, 1, 1, 0), 451 SOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_PO 454 SOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_PORT1_TX7_REG, 2, 1, 0), 452 SOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_PO 455 SOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_PORT1_TX7_REG, 3, 1, 0), 453 SOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_PORT 456 SOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_PORT1_TX7_REG, 4, 1, 0), 454 SOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_PORT 457 SOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_PORT1_TX7_REG, 5, 1, 0), 455 SOC_DAPM_SINGLE("Port1_7 Switch", LM49453_P0_P 458 SOC_DAPM_SINGLE("Port1_7 Switch", LM49453_P0_PORT1_TX7_REG, 6, 1, 0), 456 }; 459 }; 457 460 458 static const struct snd_kcontrol_new lm49453_p 461 static const struct snd_kcontrol_new lm49453_port1_tx8_mixer[] = { 459 SOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_PO 462 SOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_PORT1_TX8_REG, 0, 1, 0), 460 SOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_PO 463 SOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_PORT1_TX8_REG, 1, 1, 0), 461 SOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_PO 464 SOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_PORT1_TX8_REG, 2, 1, 0), 462 SOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_PO 465 SOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_PORT1_TX8_REG, 3, 1, 0), 463 SOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_PORT 466 SOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_PORT1_TX8_REG, 4, 1, 0), 464 SOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_PORT 467 SOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_PORT1_TX8_REG, 5, 1, 0), 465 SOC_DAPM_SINGLE("Port1_8 Switch", LM49453_P0_P 468 SOC_DAPM_SINGLE("Port1_8 Switch", LM49453_P0_PORT1_TX8_REG, 6, 1, 0), 466 }; 469 }; 467 470 468 static const struct snd_kcontrol_new lm49453_p 471 static const struct snd_kcontrol_new lm49453_port2_tx1_mixer[] = { 469 SOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_PO 472 SOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_PORT2_TX1_REG, 0, 1, 0), 470 SOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_PO 473 SOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_PORT2_TX1_REG, 1, 1, 0), 471 SOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_PO 474 SOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_PORT2_TX1_REG, 2, 1, 0), 472 SOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_PO 475 SOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_PORT2_TX1_REG, 3, 1, 0), 473 SOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_PORT 476 SOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_PORT2_TX1_REG, 4, 1, 0), 474 SOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_PORT 477 SOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_PORT2_TX1_REG, 5, 1, 0), 475 SOC_DAPM_SINGLE("Port1_1 Switch", LM49453_P0_P 478 SOC_DAPM_SINGLE("Port1_1 Switch", LM49453_P0_PORT2_TX1_REG, 6, 1, 0), 476 SOC_DAPM_SINGLE("Port2_1 Switch", LM49453_P0_P 479 SOC_DAPM_SINGLE("Port2_1 Switch", LM49453_P0_PORT2_TX1_REG, 7, 1, 0), 477 }; 480 }; 478 481 479 static const struct snd_kcontrol_new lm49453_p 482 static const struct snd_kcontrol_new lm49453_port2_tx2_mixer[] = { 480 SOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_PO 483 SOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_PORT2_TX2_REG, 0, 1, 0), 481 SOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_PO 484 SOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_PORT2_TX2_REG, 1, 1, 0), 482 SOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_PO 485 SOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_PORT2_TX2_REG, 2, 1, 0), 483 SOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_PO 486 SOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_PORT2_TX2_REG, 3, 1, 0), 484 SOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_PORT 487 SOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_PORT2_TX2_REG, 4, 1, 0), 485 SOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_PORT 488 SOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_PORT2_TX2_REG, 5, 1, 0), 486 SOC_DAPM_SINGLE("Port1_2 Switch", LM49453_P0_P 489 SOC_DAPM_SINGLE("Port1_2 Switch", LM49453_P0_PORT2_TX2_REG, 6, 1, 0), 487 SOC_DAPM_SINGLE("Port2_2 Switch", LM49453_P0_P 490 SOC_DAPM_SINGLE("Port2_2 Switch", LM49453_P0_PORT2_TX2_REG, 7, 1, 0), 488 }; 491 }; 489 492 490 /* TLV Declarations */ 493 /* TLV Declarations */ 491 static const DECLARE_TLV_DB_SCALE(adc_dac_tlv, 494 static const DECLARE_TLV_DB_SCALE(adc_dac_tlv, -7650, 150, 1); 492 static const DECLARE_TLV_DB_SCALE(mic_tlv, 0, 495 static const DECLARE_TLV_DB_SCALE(mic_tlv, 0, 200, 1); 493 static const DECLARE_TLV_DB_SCALE(port_tlv, -1 496 static const DECLARE_TLV_DB_SCALE(port_tlv, -1800, 600, 0); 494 static const DECLARE_TLV_DB_SCALE(stn_tlv, -72 497 static const DECLARE_TLV_DB_SCALE(stn_tlv, -7200, 150, 0); 495 498 496 static const struct snd_kcontrol_new lm49453_s 499 static const struct snd_kcontrol_new lm49453_sidetone_mixer_controls[] = { 497 /* Sidetone supports mono only */ 500 /* Sidetone supports mono only */ 498 SOC_DAPM_SINGLE_TLV("Sidetone ADCL Volume", LM 501 SOC_DAPM_SINGLE_TLV("Sidetone ADCL Volume", LM49453_P0_STN_VOL_ADCL_REG, 499 0, 0x3F, 0, stn_tlv), 502 0, 0x3F, 0, stn_tlv), 500 SOC_DAPM_SINGLE_TLV("Sidetone ADCR Volume", LM 503 SOC_DAPM_SINGLE_TLV("Sidetone ADCR Volume", LM49453_P0_STN_VOL_ADCR_REG, 501 0, 0x3F, 0, stn_tlv), 504 0, 0x3F, 0, stn_tlv), 502 SOC_DAPM_SINGLE_TLV("Sidetone DMIC1L Volume", 505 SOC_DAPM_SINGLE_TLV("Sidetone DMIC1L Volume", LM49453_P0_STN_VOL_DMIC1L_REG, 503 0, 0x3F, 0, stn_tlv), 506 0, 0x3F, 0, stn_tlv), 504 SOC_DAPM_SINGLE_TLV("Sidetone DMIC1R Volume", 507 SOC_DAPM_SINGLE_TLV("Sidetone DMIC1R Volume", LM49453_P0_STN_VOL_DMIC1R_REG, 505 0, 0x3F, 0, stn_tlv), 508 0, 0x3F, 0, stn_tlv), 506 SOC_DAPM_SINGLE_TLV("Sidetone DMIC2L Volume", 509 SOC_DAPM_SINGLE_TLV("Sidetone DMIC2L Volume", LM49453_P0_STN_VOL_DMIC2L_REG, 507 0, 0x3F, 0, stn_tlv), 510 0, 0x3F, 0, stn_tlv), 508 SOC_DAPM_SINGLE_TLV("Sidetone DMIC2R Volume", 511 SOC_DAPM_SINGLE_TLV("Sidetone DMIC2R Volume", LM49453_P0_STN_VOL_DMIC2R_REG, 509 0, 0x3F, 0, stn_tlv), 512 0, 0x3F, 0, stn_tlv), 510 }; 513 }; 511 514 512 static const struct snd_kcontrol_new lm49453_s 515 static const struct snd_kcontrol_new lm49453_snd_controls[] = { 513 /* mic1 and mic2 supports mono only */ 516 /* mic1 and mic2 supports mono only */ 514 SOC_SINGLE_TLV("Mic1 Volume", LM49453_ 517 SOC_SINGLE_TLV("Mic1 Volume", LM49453_P0_MICL_REG, 0, 15, 0, mic_tlv), 515 SOC_SINGLE_TLV("Mic2 Volume", LM49453_ 518 SOC_SINGLE_TLV("Mic2 Volume", LM49453_P0_MICR_REG, 0, 15, 0, mic_tlv), 516 519 517 SOC_SINGLE_TLV("ADCL Volume", LM49453_ 520 SOC_SINGLE_TLV("ADCL Volume", LM49453_P0_ADC_LEVELL_REG, 0, 63, 518 0, adc_dac_tlv), 521 0, adc_dac_tlv), 519 SOC_SINGLE_TLV("ADCR Volume", LM49453_ 522 SOC_SINGLE_TLV("ADCR Volume", LM49453_P0_ADC_LEVELR_REG, 0, 63, 520 0, adc_dac_tlv), 523 0, adc_dac_tlv), 521 524 522 SOC_DOUBLE_R_TLV("DMIC1 Volume", LM494 525 SOC_DOUBLE_R_TLV("DMIC1 Volume", LM49453_P0_DMIC1_LEVELL_REG, 523 LM49453_P0_DMIC1_LEV 526 LM49453_P0_DMIC1_LEVELR_REG, 0, 63, 0, adc_dac_tlv), 524 SOC_DOUBLE_R_TLV("DMIC2 Volume", LM494 527 SOC_DOUBLE_R_TLV("DMIC2 Volume", LM49453_P0_DMIC2_LEVELL_REG, 525 LM49453_P0_DMIC2_LEV 528 LM49453_P0_DMIC2_LEVELR_REG, 0, 63, 0, adc_dac_tlv), 526 529 527 SOC_DAPM_ENUM("Mic2Mode", lm49453_mic2 530 SOC_DAPM_ENUM("Mic2Mode", lm49453_mic2mode_enum), 528 SOC_DAPM_ENUM("DMIC12 SRC", lm49453_dm 531 SOC_DAPM_ENUM("DMIC12 SRC", lm49453_dmic12_cfg_enum), 529 SOC_DAPM_ENUM("DMIC34 SRC", lm49453_dm 532 SOC_DAPM_ENUM("DMIC34 SRC", lm49453_dmic34_cfg_enum), 530 533 531 /* Capture path filter enable */ 534 /* Capture path filter enable */ 532 SOC_SINGLE("DMIC1 HPFilter Switch", LM 535 SOC_SINGLE("DMIC1 HPFilter Switch", LM49453_P0_ADC_FX_ENABLES_REG, 533 0, 536 0, 1, 0), 534 SOC_SINGLE("DMIC2 HPFilter Switch", LM 537 SOC_SINGLE("DMIC2 HPFilter Switch", LM49453_P0_ADC_FX_ENABLES_REG, 535 1, 538 1, 1, 0), 536 SOC_SINGLE("ADC HPFilter Switch", LM49 539 SOC_SINGLE("ADC HPFilter Switch", LM49453_P0_ADC_FX_ENABLES_REG, 537 2, 1 540 2, 1, 0), 538 541 539 SOC_DOUBLE_R_TLV("DAC HP Volume", LM49 542 SOC_DOUBLE_R_TLV("DAC HP Volume", LM49453_P0_DAC_HP_LEVELL_REG, 540 LM49453_P0_DAC_HP_LE 543 LM49453_P0_DAC_HP_LEVELR_REG, 0, 63, 0, adc_dac_tlv), 541 SOC_DOUBLE_R_TLV("DAC LO Volume", LM49 544 SOC_DOUBLE_R_TLV("DAC LO Volume", LM49453_P0_DAC_LO_LEVELL_REG, 542 LM49453_P0_DAC_LO_LE 545 LM49453_P0_DAC_LO_LEVELR_REG, 0, 63, 0, adc_dac_tlv), 543 SOC_DOUBLE_R_TLV("DAC LS Volume", LM49 546 SOC_DOUBLE_R_TLV("DAC LS Volume", LM49453_P0_DAC_LS_LEVELL_REG, 544 LM49453_P0_DAC_LS_LE 547 LM49453_P0_DAC_LS_LEVELR_REG, 0, 63, 0, adc_dac_tlv), 545 SOC_DOUBLE_R_TLV("DAC HA Volume", LM49 548 SOC_DOUBLE_R_TLV("DAC HA Volume", LM49453_P0_DAC_HA_LEVELL_REG, 546 LM49453_P0_DAC_HA_LE 549 LM49453_P0_DAC_HA_LEVELR_REG, 0, 63, 0, adc_dac_tlv), 547 550 548 SOC_SINGLE_TLV("EP Volume", LM49453_P0 551 SOC_SINGLE_TLV("EP Volume", LM49453_P0_DAC_LS_LEVELL_REG, 549 0, 63, 0, adc_dac_tlv) 552 0, 63, 0, adc_dac_tlv), 550 553 551 SOC_SINGLE_TLV("PORT1_1_RX_LVL Volume" 554 SOC_SINGLE_TLV("PORT1_1_RX_LVL Volume", LM49453_P0_PORT1_RX_LVL1_REG, 552 0, 3, 0, port_tlv), 555 0, 3, 0, port_tlv), 553 SOC_SINGLE_TLV("PORT1_2_RX_LVL Volume" 556 SOC_SINGLE_TLV("PORT1_2_RX_LVL Volume", LM49453_P0_PORT1_RX_LVL1_REG, 554 2, 3, 0, port_tlv), 557 2, 3, 0, port_tlv), 555 SOC_SINGLE_TLV("PORT1_3_RX_LVL Volume" 558 SOC_SINGLE_TLV("PORT1_3_RX_LVL Volume", LM49453_P0_PORT1_RX_LVL1_REG, 556 4, 3, 0, port_tlv), 559 4, 3, 0, port_tlv), 557 SOC_SINGLE_TLV("PORT1_4_RX_LVL Volume" 560 SOC_SINGLE_TLV("PORT1_4_RX_LVL Volume", LM49453_P0_PORT1_RX_LVL1_REG, 558 6, 3, 0, port_tlv), 561 6, 3, 0, port_tlv), 559 SOC_SINGLE_TLV("PORT1_5_RX_LVL Volume" 562 SOC_SINGLE_TLV("PORT1_5_RX_LVL Volume", LM49453_P0_PORT1_RX_LVL2_REG, 560 0, 3, 0, port_tlv), 563 0, 3, 0, port_tlv), 561 SOC_SINGLE_TLV("PORT1_6_RX_LVL Volume" 564 SOC_SINGLE_TLV("PORT1_6_RX_LVL Volume", LM49453_P0_PORT1_RX_LVL2_REG, 562 2, 3, 0, port_tlv), 565 2, 3, 0, port_tlv), 563 SOC_SINGLE_TLV("PORT1_7_RX_LVL Volume" 566 SOC_SINGLE_TLV("PORT1_7_RX_LVL Volume", LM49453_P0_PORT1_RX_LVL2_REG, 564 4, 3, 0, port_tlv), 567 4, 3, 0, port_tlv), 565 SOC_SINGLE_TLV("PORT1_8_RX_LVL Volume" 568 SOC_SINGLE_TLV("PORT1_8_RX_LVL Volume", LM49453_P0_PORT1_RX_LVL2_REG, 566 6, 3, 0, port_tlv), 569 6, 3, 0, port_tlv), 567 570 568 SOC_SINGLE_TLV("PORT2_1_RX_LVL Volume" 571 SOC_SINGLE_TLV("PORT2_1_RX_LVL Volume", LM49453_P0_PORT2_RX_LVL_REG, 569 0, 3, 0, port_tlv), 572 0, 3, 0, port_tlv), 570 SOC_SINGLE_TLV("PORT2_2_RX_LVL Volume" 573 SOC_SINGLE_TLV("PORT2_2_RX_LVL Volume", LM49453_P0_PORT2_RX_LVL_REG, 571 2, 3, 0, port_tlv), 574 2, 3, 0, port_tlv), 572 575 573 SOC_SINGLE("Port1 Playback Switch", LM 576 SOC_SINGLE("Port1 Playback Switch", LM49453_P0_AUDIO_PORT1_BASIC_REG, 574 1, 1, 0), 577 1, 1, 0), 575 SOC_SINGLE("Port2 Playback Switch", LM 578 SOC_SINGLE("Port2 Playback Switch", LM49453_P0_AUDIO_PORT2_BASIC_REG, 576 1, 1, 0), 579 1, 1, 0), 577 SOC_SINGLE("Port1 Capture Switch", LM4 580 SOC_SINGLE("Port1 Capture Switch", LM49453_P0_AUDIO_PORT1_BASIC_REG, 578 2, 1, 0), 581 2, 1, 0), 579 SOC_SINGLE("Port2 Capture Switch", LM4 582 SOC_SINGLE("Port2 Capture Switch", LM49453_P0_AUDIO_PORT2_BASIC_REG, 580 2, 1, 0) 583 2, 1, 0) 581 584 582 }; 585 }; 583 586 584 /* DAPM widgets */ 587 /* DAPM widgets */ 585 static const struct snd_soc_dapm_widget lm4945 588 static const struct snd_soc_dapm_widget lm49453_dapm_widgets[] = { 586 589 587 /* All end points HP,EP, LS, Lineout a 590 /* All end points HP,EP, LS, Lineout and Haptic */ 588 SND_SOC_DAPM_OUTPUT("HPOUTL"), 591 SND_SOC_DAPM_OUTPUT("HPOUTL"), 589 SND_SOC_DAPM_OUTPUT("HPOUTR"), 592 SND_SOC_DAPM_OUTPUT("HPOUTR"), 590 SND_SOC_DAPM_OUTPUT("EPOUT"), 593 SND_SOC_DAPM_OUTPUT("EPOUT"), 591 SND_SOC_DAPM_OUTPUT("LSOUTL"), 594 SND_SOC_DAPM_OUTPUT("LSOUTL"), 592 SND_SOC_DAPM_OUTPUT("LSOUTR"), 595 SND_SOC_DAPM_OUTPUT("LSOUTR"), 593 SND_SOC_DAPM_OUTPUT("LOOUTR"), 596 SND_SOC_DAPM_OUTPUT("LOOUTR"), 594 SND_SOC_DAPM_OUTPUT("LOOUTL"), 597 SND_SOC_DAPM_OUTPUT("LOOUTL"), 595 SND_SOC_DAPM_OUTPUT("HAOUTL"), 598 SND_SOC_DAPM_OUTPUT("HAOUTL"), 596 SND_SOC_DAPM_OUTPUT("HAOUTR"), 599 SND_SOC_DAPM_OUTPUT("HAOUTR"), 597 600 598 SND_SOC_DAPM_INPUT("AMIC1"), 601 SND_SOC_DAPM_INPUT("AMIC1"), 599 SND_SOC_DAPM_INPUT("AMIC2"), 602 SND_SOC_DAPM_INPUT("AMIC2"), 600 SND_SOC_DAPM_INPUT("DMIC1DAT"), 603 SND_SOC_DAPM_INPUT("DMIC1DAT"), 601 SND_SOC_DAPM_INPUT("DMIC2DAT"), 604 SND_SOC_DAPM_INPUT("DMIC2DAT"), 602 SND_SOC_DAPM_INPUT("AUXL"), 605 SND_SOC_DAPM_INPUT("AUXL"), 603 SND_SOC_DAPM_INPUT("AUXR"), 606 SND_SOC_DAPM_INPUT("AUXR"), 604 607 605 SND_SOC_DAPM_PGA("PORT1_1_RX", SND_SOC 608 SND_SOC_DAPM_PGA("PORT1_1_RX", SND_SOC_NOPM, 0, 0, NULL, 0), 606 SND_SOC_DAPM_PGA("PORT1_2_RX", SND_SOC 609 SND_SOC_DAPM_PGA("PORT1_2_RX", SND_SOC_NOPM, 0, 0, NULL, 0), 607 SND_SOC_DAPM_PGA("PORT1_3_RX", SND_SOC 610 SND_SOC_DAPM_PGA("PORT1_3_RX", SND_SOC_NOPM, 0, 0, NULL, 0), 608 SND_SOC_DAPM_PGA("PORT1_4_RX", SND_SOC 611 SND_SOC_DAPM_PGA("PORT1_4_RX", SND_SOC_NOPM, 0, 0, NULL, 0), 609 SND_SOC_DAPM_PGA("PORT1_5_RX", SND_SOC 612 SND_SOC_DAPM_PGA("PORT1_5_RX", SND_SOC_NOPM, 0, 0, NULL, 0), 610 SND_SOC_DAPM_PGA("PORT1_6_RX", SND_SOC 613 SND_SOC_DAPM_PGA("PORT1_6_RX", SND_SOC_NOPM, 0, 0, NULL, 0), 611 SND_SOC_DAPM_PGA("PORT1_7_RX", SND_SOC 614 SND_SOC_DAPM_PGA("PORT1_7_RX", SND_SOC_NOPM, 0, 0, NULL, 0), 612 SND_SOC_DAPM_PGA("PORT1_8_RX", SND_SOC 615 SND_SOC_DAPM_PGA("PORT1_8_RX", SND_SOC_NOPM, 0, 0, NULL, 0), 613 SND_SOC_DAPM_PGA("PORT2_1_RX", SND_SOC 616 SND_SOC_DAPM_PGA("PORT2_1_RX", SND_SOC_NOPM, 0, 0, NULL, 0), 614 SND_SOC_DAPM_PGA("PORT2_2_RX", SND_SOC 617 SND_SOC_DAPM_PGA("PORT2_2_RX", SND_SOC_NOPM, 0, 0, NULL, 0), 615 618 616 SND_SOC_DAPM_SUPPLY("AMIC1Bias", LM494 619 SND_SOC_DAPM_SUPPLY("AMIC1Bias", LM49453_P0_MICL_REG, 6, 0, NULL, 0), 617 SND_SOC_DAPM_SUPPLY("AMIC2Bias", LM494 620 SND_SOC_DAPM_SUPPLY("AMIC2Bias", LM49453_P0_MICR_REG, 6, 0, NULL, 0), 618 621 619 /* playback path driver enables */ 622 /* playback path driver enables */ 620 SND_SOC_DAPM_OUT_DRV("Headset Switch", 623 SND_SOC_DAPM_OUT_DRV("Headset Switch", 621 LM49453_P0_PMC_SETUP_R 624 LM49453_P0_PMC_SETUP_REG, 0, 0, NULL, 0), 622 SND_SOC_DAPM_OUT_DRV("Earpiece Switch" 625 SND_SOC_DAPM_OUT_DRV("Earpiece Switch", 623 LM49453_P0_EP_REG, 0, 626 LM49453_P0_EP_REG, 0, 0, NULL, 0), 624 SND_SOC_DAPM_OUT_DRV("Speaker Left Swi 627 SND_SOC_DAPM_OUT_DRV("Speaker Left Switch", 625 LM49453_P0_DIS_PKVL_FB 628 LM49453_P0_DIS_PKVL_FB_REG, 0, 1, NULL, 0), 626 SND_SOC_DAPM_OUT_DRV("Speaker Right Sw 629 SND_SOC_DAPM_OUT_DRV("Speaker Right Switch", 627 LM49453_P0_DIS_PKVL_FB 630 LM49453_P0_DIS_PKVL_FB_REG, 1, 1, NULL, 0), 628 SND_SOC_DAPM_OUT_DRV("Haptic Left Swit 631 SND_SOC_DAPM_OUT_DRV("Haptic Left Switch", 629 LM49453_P0_DIS_PKVL_FB 632 LM49453_P0_DIS_PKVL_FB_REG, 2, 1, NULL, 0), 630 SND_SOC_DAPM_OUT_DRV("Haptic Right Swi 633 SND_SOC_DAPM_OUT_DRV("Haptic Right Switch", 631 LM49453_P0_DIS_PKVL_FB 634 LM49453_P0_DIS_PKVL_FB_REG, 3, 1, NULL, 0), 632 635 633 /* DAC */ 636 /* DAC */ 634 SND_SOC_DAPM_DAC("HPL DAC", "Headset", 637 SND_SOC_DAPM_DAC("HPL DAC", "Headset", SND_SOC_NOPM, 0, 0), 635 SND_SOC_DAPM_DAC("HPR DAC", "Headset", 638 SND_SOC_DAPM_DAC("HPR DAC", "Headset", SND_SOC_NOPM, 0, 0), 636 SND_SOC_DAPM_DAC("LSL DAC", "Speaker", 639 SND_SOC_DAPM_DAC("LSL DAC", "Speaker", SND_SOC_NOPM, 0, 0), 637 SND_SOC_DAPM_DAC("LSR DAC", "Speaker", 640 SND_SOC_DAPM_DAC("LSR DAC", "Speaker", SND_SOC_NOPM, 0, 0), 638 SND_SOC_DAPM_DAC("HAL DAC", "Haptic", 641 SND_SOC_DAPM_DAC("HAL DAC", "Haptic", SND_SOC_NOPM, 0, 0), 639 SND_SOC_DAPM_DAC("HAR DAC", "Haptic", 642 SND_SOC_DAPM_DAC("HAR DAC", "Haptic", SND_SOC_NOPM, 0, 0), 640 SND_SOC_DAPM_DAC("LOL DAC", "Lineout", 643 SND_SOC_DAPM_DAC("LOL DAC", "Lineout", SND_SOC_NOPM, 0, 0), 641 SND_SOC_DAPM_DAC("LOR DAC", "Lineout", 644 SND_SOC_DAPM_DAC("LOR DAC", "Lineout", SND_SOC_NOPM, 0, 0), 642 645 643 646 644 SND_SOC_DAPM_PGA("AUXL Input", 647 SND_SOC_DAPM_PGA("AUXL Input", 645 LM49453_P0_ANALOG_MIXE 648 LM49453_P0_ANALOG_MIXER_ADC_REG, 2, 0, NULL, 0), 646 SND_SOC_DAPM_PGA("AUXR Input", 649 SND_SOC_DAPM_PGA("AUXR Input", 647 LM49453_P0_ANALOG_MIXE 650 LM49453_P0_ANALOG_MIXER_ADC_REG, 3, 0, NULL, 0), 648 651 649 SND_SOC_DAPM_PGA("Sidetone", SND_SOC_N 652 SND_SOC_DAPM_PGA("Sidetone", SND_SOC_NOPM, 0, 0, NULL, 0), 650 653 651 /* ADC */ 654 /* ADC */ 652 SND_SOC_DAPM_ADC("DMIC1 Left", "Captur 655 SND_SOC_DAPM_ADC("DMIC1 Left", "Capture", SND_SOC_NOPM, 1, 0), 653 SND_SOC_DAPM_ADC("DMIC1 Right", "Captu 656 SND_SOC_DAPM_ADC("DMIC1 Right", "Capture", SND_SOC_NOPM, 1, 0), 654 SND_SOC_DAPM_ADC("DMIC2 Left", "Captur 657 SND_SOC_DAPM_ADC("DMIC2 Left", "Capture", SND_SOC_NOPM, 1, 0), 655 SND_SOC_DAPM_ADC("DMIC2 Right", "Captu 658 SND_SOC_DAPM_ADC("DMIC2 Right", "Capture", SND_SOC_NOPM, 1, 0), 656 659 657 SND_SOC_DAPM_ADC("ADC Left", "Capture" 660 SND_SOC_DAPM_ADC("ADC Left", "Capture", SND_SOC_NOPM, 1, 0), 658 SND_SOC_DAPM_ADC("ADC Right", "Capture 661 SND_SOC_DAPM_ADC("ADC Right", "Capture", SND_SOC_NOPM, 0, 0), 659 662 660 SND_SOC_DAPM_MUX("ADCL Mux", SND_SOC_N 663 SND_SOC_DAPM_MUX("ADCL Mux", SND_SOC_NOPM, 0, 0, 661 &lm49453_adcl_mux_co 664 &lm49453_adcl_mux_control), 662 SND_SOC_DAPM_MUX("ADCR Mux", SND_SOC_N 665 SND_SOC_DAPM_MUX("ADCR Mux", SND_SOC_NOPM, 0, 0, 663 &lm49453_adcr_mux_co 666 &lm49453_adcr_mux_control), 664 667 665 SND_SOC_DAPM_MUX("Mic1 Input", 668 SND_SOC_DAPM_MUX("Mic1 Input", 666 SND_SOC_NOPM, 0, 0, &l 669 SND_SOC_NOPM, 0, 0, &lm49453_adcl_mux_control), 667 670 668 SND_SOC_DAPM_MUX("Mic2 Input", 671 SND_SOC_DAPM_MUX("Mic2 Input", 669 SND_SOC_NOPM, 0, 0, &l 672 SND_SOC_NOPM, 0, 0, &lm49453_adcr_mux_control), 670 673 671 /* AIF */ 674 /* AIF */ 672 SND_SOC_DAPM_AIF_IN("PORT1_SDI", NULL, 675 SND_SOC_DAPM_AIF_IN("PORT1_SDI", NULL, 0, 673 LM49453_P0_PULL_CO 676 LM49453_P0_PULL_CONFIG1_REG, 2, 0), 674 SND_SOC_DAPM_AIF_IN("PORT2_SDI", NULL, 677 SND_SOC_DAPM_AIF_IN("PORT2_SDI", NULL, 0, 675 LM49453_P0_PULL_CO 678 LM49453_P0_PULL_CONFIG1_REG, 6, 0), 676 679 677 SND_SOC_DAPM_AIF_OUT("PORT1_SDO", NULL 680 SND_SOC_DAPM_AIF_OUT("PORT1_SDO", NULL, 0, 678 LM49453_P0_PULL_C 681 LM49453_P0_PULL_CONFIG1_REG, 3, 0), 679 SND_SOC_DAPM_AIF_OUT("PORT2_SDO", NULL 682 SND_SOC_DAPM_AIF_OUT("PORT2_SDO", NULL, 0, 680 LM49453_P0_PULL_ 683 LM49453_P0_PULL_CONFIG1_REG, 7, 0), 681 684 682 /* Port1 TX controls */ 685 /* Port1 TX controls */ 683 SND_SOC_DAPM_OUT_DRV("P1_1_TX", SND_SO 686 SND_SOC_DAPM_OUT_DRV("P1_1_TX", SND_SOC_NOPM, 0, 0, NULL, 0), 684 SND_SOC_DAPM_OUT_DRV("P1_2_TX", SND_SO 687 SND_SOC_DAPM_OUT_DRV("P1_2_TX", SND_SOC_NOPM, 0, 0, NULL, 0), 685 SND_SOC_DAPM_OUT_DRV("P1_3_TX", SND_SO 688 SND_SOC_DAPM_OUT_DRV("P1_3_TX", SND_SOC_NOPM, 0, 0, NULL, 0), 686 SND_SOC_DAPM_OUT_DRV("P1_4_TX", SND_SO 689 SND_SOC_DAPM_OUT_DRV("P1_4_TX", SND_SOC_NOPM, 0, 0, NULL, 0), 687 SND_SOC_DAPM_OUT_DRV("P1_5_TX", SND_SO 690 SND_SOC_DAPM_OUT_DRV("P1_5_TX", SND_SOC_NOPM, 0, 0, NULL, 0), 688 SND_SOC_DAPM_OUT_DRV("P1_6_TX", SND_SO 691 SND_SOC_DAPM_OUT_DRV("P1_6_TX", SND_SOC_NOPM, 0, 0, NULL, 0), 689 SND_SOC_DAPM_OUT_DRV("P1_7_TX", SND_SO 692 SND_SOC_DAPM_OUT_DRV("P1_7_TX", SND_SOC_NOPM, 0, 0, NULL, 0), 690 SND_SOC_DAPM_OUT_DRV("P1_8_TX", SND_SO 693 SND_SOC_DAPM_OUT_DRV("P1_8_TX", SND_SOC_NOPM, 0, 0, NULL, 0), 691 694 692 /* Port2 TX controls */ 695 /* Port2 TX controls */ 693 SND_SOC_DAPM_OUT_DRV("P2_1_TX", SND_SO 696 SND_SOC_DAPM_OUT_DRV("P2_1_TX", SND_SOC_NOPM, 0, 0, NULL, 0), 694 SND_SOC_DAPM_OUT_DRV("P2_2_TX", SND_SO 697 SND_SOC_DAPM_OUT_DRV("P2_2_TX", SND_SOC_NOPM, 0, 0, NULL, 0), 695 698 696 /* Sidetone Mixer */ 699 /* Sidetone Mixer */ 697 SND_SOC_DAPM_MIXER("Sidetone Mixer", S 700 SND_SOC_DAPM_MIXER("Sidetone Mixer", SND_SOC_NOPM, 0, 0, 698 lm49453_sidetone_m 701 lm49453_sidetone_mixer_controls, 699 ARRAY_SIZE(lm49453 702 ARRAY_SIZE(lm49453_sidetone_mixer_controls)), 700 703 701 /* DAC MIXERS */ 704 /* DAC MIXERS */ 702 SND_SOC_DAPM_MIXER("HPL Mixer", SND_SO 705 SND_SOC_DAPM_MIXER("HPL Mixer", SND_SOC_NOPM, 0, 0, 703 lm49453_headset_le 706 lm49453_headset_left_mixer, 704 ARRAY_SIZE(lm49453 707 ARRAY_SIZE(lm49453_headset_left_mixer)), 705 SND_SOC_DAPM_MIXER("HPR Mixer", SND_SO 708 SND_SOC_DAPM_MIXER("HPR Mixer", SND_SOC_NOPM, 0, 0, 706 lm49453_headset_ri 709 lm49453_headset_right_mixer, 707 ARRAY_SIZE(lm49453 710 ARRAY_SIZE(lm49453_headset_right_mixer)), 708 SND_SOC_DAPM_MIXER("LOL Mixer", SND_SO 711 SND_SOC_DAPM_MIXER("LOL Mixer", SND_SOC_NOPM, 0, 0, 709 lm49453_lineout_le 712 lm49453_lineout_left_mixer, 710 ARRAY_SIZE(lm49453 713 ARRAY_SIZE(lm49453_lineout_left_mixer)), 711 SND_SOC_DAPM_MIXER("LOR Mixer", SND_SO 714 SND_SOC_DAPM_MIXER("LOR Mixer", SND_SOC_NOPM, 0, 0, 712 lm49453_lineout_ri 715 lm49453_lineout_right_mixer, 713 ARRAY_SIZE(lm49453 716 ARRAY_SIZE(lm49453_lineout_right_mixer)), 714 SND_SOC_DAPM_MIXER("LSL Mixer", SND_SO 717 SND_SOC_DAPM_MIXER("LSL Mixer", SND_SOC_NOPM, 0, 0, 715 lm49453_speaker_le 718 lm49453_speaker_left_mixer, 716 ARRAY_SIZE(lm49453 719 ARRAY_SIZE(lm49453_speaker_left_mixer)), 717 SND_SOC_DAPM_MIXER("LSR Mixer", SND_SO 720 SND_SOC_DAPM_MIXER("LSR Mixer", SND_SOC_NOPM, 0, 0, 718 lm49453_speaker_ri 721 lm49453_speaker_right_mixer, 719 ARRAY_SIZE(lm49453 722 ARRAY_SIZE(lm49453_speaker_right_mixer)), 720 SND_SOC_DAPM_MIXER("HAL Mixer", SND_SO 723 SND_SOC_DAPM_MIXER("HAL Mixer", SND_SOC_NOPM, 0, 0, 721 lm49453_haptic_lef 724 lm49453_haptic_left_mixer, 722 ARRAY_SIZE(lm49453 725 ARRAY_SIZE(lm49453_haptic_left_mixer)), 723 SND_SOC_DAPM_MIXER("HAR Mixer", SND_SO 726 SND_SOC_DAPM_MIXER("HAR Mixer", SND_SOC_NOPM, 0, 0, 724 lm49453_haptic_rig 727 lm49453_haptic_right_mixer, 725 ARRAY_SIZE(lm49453 728 ARRAY_SIZE(lm49453_haptic_right_mixer)), 726 729 727 /* Capture Mixer */ 730 /* Capture Mixer */ 728 SND_SOC_DAPM_MIXER("Port1_1 Mixer", SN 731 SND_SOC_DAPM_MIXER("Port1_1 Mixer", SND_SOC_NOPM, 0, 0, 729 lm49453_port1_tx1_ 732 lm49453_port1_tx1_mixer, 730 ARRAY_SIZE(lm49453 733 ARRAY_SIZE(lm49453_port1_tx1_mixer)), 731 SND_SOC_DAPM_MIXER("Port1_2 Mixer", SN 734 SND_SOC_DAPM_MIXER("Port1_2 Mixer", SND_SOC_NOPM, 0, 0, 732 lm49453_port1_tx2_ 735 lm49453_port1_tx2_mixer, 733 ARRAY_SIZE(lm49453 736 ARRAY_SIZE(lm49453_port1_tx2_mixer)), 734 SND_SOC_DAPM_MIXER("Port1_3 Mixer", SN 737 SND_SOC_DAPM_MIXER("Port1_3 Mixer", SND_SOC_NOPM, 0, 0, 735 lm49453_port1_tx3_ 738 lm49453_port1_tx3_mixer, 736 ARRAY_SIZE(lm49453 739 ARRAY_SIZE(lm49453_port1_tx3_mixer)), 737 SND_SOC_DAPM_MIXER("Port1_4 Mixer", SN 740 SND_SOC_DAPM_MIXER("Port1_4 Mixer", SND_SOC_NOPM, 0, 0, 738 lm49453_port1_tx4_ 741 lm49453_port1_tx4_mixer, 739 ARRAY_SIZE(lm49453 742 ARRAY_SIZE(lm49453_port1_tx4_mixer)), 740 SND_SOC_DAPM_MIXER("Port1_5 Mixer", SN 743 SND_SOC_DAPM_MIXER("Port1_5 Mixer", SND_SOC_NOPM, 0, 0, 741 lm49453_port1_tx5_ 744 lm49453_port1_tx5_mixer, 742 ARRAY_SIZE(lm49453 745 ARRAY_SIZE(lm49453_port1_tx5_mixer)), 743 SND_SOC_DAPM_MIXER("Port1_6 Mixer", SN 746 SND_SOC_DAPM_MIXER("Port1_6 Mixer", SND_SOC_NOPM, 0, 0, 744 lm49453_port1_tx6_ 747 lm49453_port1_tx6_mixer, 745 ARRAY_SIZE(lm49453 748 ARRAY_SIZE(lm49453_port1_tx6_mixer)), 746 SND_SOC_DAPM_MIXER("Port1_7 Mixer", SN 749 SND_SOC_DAPM_MIXER("Port1_7 Mixer", SND_SOC_NOPM, 0, 0, 747 lm49453_port1_tx7_ 750 lm49453_port1_tx7_mixer, 748 ARRAY_SIZE(lm49453 751 ARRAY_SIZE(lm49453_port1_tx7_mixer)), 749 SND_SOC_DAPM_MIXER("Port1_8 Mixer", SN 752 SND_SOC_DAPM_MIXER("Port1_8 Mixer", SND_SOC_NOPM, 0, 0, 750 lm49453_port1_tx8_ 753 lm49453_port1_tx8_mixer, 751 ARRAY_SIZE(lm49453 754 ARRAY_SIZE(lm49453_port1_tx8_mixer)), 752 755 753 SND_SOC_DAPM_MIXER("Port2_1 Mixer", SN 756 SND_SOC_DAPM_MIXER("Port2_1 Mixer", SND_SOC_NOPM, 0, 0, 754 lm49453_port2_tx1_ 757 lm49453_port2_tx1_mixer, 755 ARRAY_SIZE(lm49453 758 ARRAY_SIZE(lm49453_port2_tx1_mixer)), 756 SND_SOC_DAPM_MIXER("Port2_2 Mixer", SN 759 SND_SOC_DAPM_MIXER("Port2_2 Mixer", SND_SOC_NOPM, 0, 0, 757 lm49453_port2_tx2_ 760 lm49453_port2_tx2_mixer, 758 ARRAY_SIZE(lm49453 761 ARRAY_SIZE(lm49453_port2_tx2_mixer)), 759 }; 762 }; 760 763 761 static const struct snd_soc_dapm_route lm49453 764 static const struct snd_soc_dapm_route lm49453_audio_map[] = { 762 /* Port SDI mapping */ 765 /* Port SDI mapping */ 763 { "PORT1_1_RX", "Port1 Playback Switch 766 { "PORT1_1_RX", "Port1 Playback Switch", "PORT1_SDI" }, 764 { "PORT1_2_RX", "Port1 Playback Switch 767 { "PORT1_2_RX", "Port1 Playback Switch", "PORT1_SDI" }, 765 { "PORT1_3_RX", "Port1 Playback Switch 768 { "PORT1_3_RX", "Port1 Playback Switch", "PORT1_SDI" }, 766 { "PORT1_4_RX", "Port1 Playback Switch 769 { "PORT1_4_RX", "Port1 Playback Switch", "PORT1_SDI" }, 767 { "PORT1_5_RX", "Port1 Playback Switch 770 { "PORT1_5_RX", "Port1 Playback Switch", "PORT1_SDI" }, 768 { "PORT1_6_RX", "Port1 Playback Switch 771 { "PORT1_6_RX", "Port1 Playback Switch", "PORT1_SDI" }, 769 { "PORT1_7_RX", "Port1 Playback Switch 772 { "PORT1_7_RX", "Port1 Playback Switch", "PORT1_SDI" }, 770 { "PORT1_8_RX", "Port1 Playback Switch 773 { "PORT1_8_RX", "Port1 Playback Switch", "PORT1_SDI" }, 771 774 772 { "PORT2_1_RX", "Port2 Playback Switch 775 { "PORT2_1_RX", "Port2 Playback Switch", "PORT2_SDI" }, 773 { "PORT2_2_RX", "Port2 Playback Switch 776 { "PORT2_2_RX", "Port2 Playback Switch", "PORT2_SDI" }, 774 777 775 /* HP mapping */ 778 /* HP mapping */ 776 { "HPL Mixer", "Port1_1 Switch", "PORT 779 { "HPL Mixer", "Port1_1 Switch", "PORT1_1_RX" }, 777 { "HPL Mixer", "Port1_2 Switch", "PORT 780 { "HPL Mixer", "Port1_2 Switch", "PORT1_2_RX" }, 778 { "HPL Mixer", "Port1_3 Switch", "PORT 781 { "HPL Mixer", "Port1_3 Switch", "PORT1_3_RX" }, 779 { "HPL Mixer", "Port1_4 Switch", "PORT 782 { "HPL Mixer", "Port1_4 Switch", "PORT1_4_RX" }, 780 { "HPL Mixer", "Port1_5 Switch", "PORT 783 { "HPL Mixer", "Port1_5 Switch", "PORT1_5_RX" }, 781 { "HPL Mixer", "Port1_6 Switch", "PORT 784 { "HPL Mixer", "Port1_6 Switch", "PORT1_6_RX" }, 782 { "HPL Mixer", "Port1_7 Switch", "PORT 785 { "HPL Mixer", "Port1_7 Switch", "PORT1_7_RX" }, 783 { "HPL Mixer", "Port1_8 Switch", "PORT 786 { "HPL Mixer", "Port1_8 Switch", "PORT1_8_RX" }, 784 787 785 { "HPL Mixer", "Port2_1 Switch", "PORT 788 { "HPL Mixer", "Port2_1 Switch", "PORT2_1_RX" }, 786 { "HPL Mixer", "Port2_2 Switch", "PORT 789 { "HPL Mixer", "Port2_2 Switch", "PORT2_2_RX" }, 787 790 788 { "HPL Mixer", "ADCL Switch", "ADC Lef 791 { "HPL Mixer", "ADCL Switch", "ADC Left" }, 789 { "HPL Mixer", "ADCR Switch", "ADC Rig 792 { "HPL Mixer", "ADCR Switch", "ADC Right" }, 790 { "HPL Mixer", "DMIC1L Switch", "DMIC1 793 { "HPL Mixer", "DMIC1L Switch", "DMIC1 Left" }, 791 { "HPL Mixer", "DMIC1R Switch", "DMIC1 794 { "HPL Mixer", "DMIC1R Switch", "DMIC1 Right" }, 792 { "HPL Mixer", "DMIC2L Switch", "DMIC2 795 { "HPL Mixer", "DMIC2L Switch", "DMIC2 Left" }, 793 { "HPL Mixer", "DMIC2R Switch", "DMIC2 796 { "HPL Mixer", "DMIC2R Switch", "DMIC2 Right" }, 794 { "HPL Mixer", "Sidetone Switch", "Sid 797 { "HPL Mixer", "Sidetone Switch", "Sidetone" }, 795 798 796 { "HPL DAC", NULL, "HPL Mixer" }, 799 { "HPL DAC", NULL, "HPL Mixer" }, 797 800 798 { "HPR Mixer", "Port1_1 Switch", "PORT 801 { "HPR Mixer", "Port1_1 Switch", "PORT1_1_RX" }, 799 { "HPR Mixer", "Port1_2 Switch", "PORT 802 { "HPR Mixer", "Port1_2 Switch", "PORT1_2_RX" }, 800 { "HPR Mixer", "Port1_3 Switch", "PORT 803 { "HPR Mixer", "Port1_3 Switch", "PORT1_3_RX" }, 801 { "HPR Mixer", "Port1_4 Switch", "PORT 804 { "HPR Mixer", "Port1_4 Switch", "PORT1_4_RX" }, 802 { "HPR Mixer", "Port1_5 Switch", "PORT 805 { "HPR Mixer", "Port1_5 Switch", "PORT1_5_RX" }, 803 { "HPR Mixer", "Port1_6 Switch", "PORT 806 { "HPR Mixer", "Port1_6 Switch", "PORT1_6_RX" }, 804 { "HPR Mixer", "Port1_7 Switch", "PORT 807 { "HPR Mixer", "Port1_7 Switch", "PORT1_7_RX" }, 805 { "HPR Mixer", "Port1_8 Switch", "PORT 808 { "HPR Mixer", "Port1_8 Switch", "PORT1_8_RX" }, 806 809 807 /* Port 2 */ 810 /* Port 2 */ 808 { "HPR Mixer", "Port2_1 Switch", "PORT 811 { "HPR Mixer", "Port2_1 Switch", "PORT2_1_RX" }, 809 { "HPR Mixer", "Port2_2 Switch", "PORT 812 { "HPR Mixer", "Port2_2 Switch", "PORT2_2_RX" }, 810 813 811 { "HPR Mixer", "ADCL Switch", "ADC Lef 814 { "HPR Mixer", "ADCL Switch", "ADC Left" }, 812 { "HPR Mixer", "ADCR Switch", "ADC Rig 815 { "HPR Mixer", "ADCR Switch", "ADC Right" }, 813 { "HPR Mixer", "DMIC1L Switch", "DMIC1 816 { "HPR Mixer", "DMIC1L Switch", "DMIC1 Left" }, 814 { "HPR Mixer", "DMIC1R Switch", "DMIC1 817 { "HPR Mixer", "DMIC1R Switch", "DMIC1 Right" }, 815 { "HPR Mixer", "DMIC2L Switch", "DMIC2 818 { "HPR Mixer", "DMIC2L Switch", "DMIC2 Left" }, 816 { "HPR Mixer", "DMIC2L Switch", "DMIC2 819 { "HPR Mixer", "DMIC2L Switch", "DMIC2 Right" }, 817 { "HPR Mixer", "Sidetone Switch", "Sid 820 { "HPR Mixer", "Sidetone Switch", "Sidetone" }, 818 821 819 { "HPR DAC", NULL, "HPR Mixer" }, 822 { "HPR DAC", NULL, "HPR Mixer" }, 820 823 821 { "HPOUTL", "Headset Switch", "HPL DAC 824 { "HPOUTL", "Headset Switch", "HPL DAC"}, 822 { "HPOUTR", "Headset Switch", "HPR DAC 825 { "HPOUTR", "Headset Switch", "HPR DAC"}, 823 826 824 /* EP map */ 827 /* EP map */ 825 { "EPOUT", "Earpiece Switch", "HPL DAC 828 { "EPOUT", "Earpiece Switch", "HPL DAC" }, 826 829 827 /* Speaker map */ 830 /* Speaker map */ 828 { "LSL Mixer", "Port1_1 Switch", "PORT 831 { "LSL Mixer", "Port1_1 Switch", "PORT1_1_RX" }, 829 { "LSL Mixer", "Port1_2 Switch", "PORT 832 { "LSL Mixer", "Port1_2 Switch", "PORT1_2_RX" }, 830 { "LSL Mixer", "Port1_3 Switch", "PORT 833 { "LSL Mixer", "Port1_3 Switch", "PORT1_3_RX" }, 831 { "LSL Mixer", "Port1_4 Switch", "PORT 834 { "LSL Mixer", "Port1_4 Switch", "PORT1_4_RX" }, 832 { "LSL Mixer", "Port1_5 Switch", "PORT 835 { "LSL Mixer", "Port1_5 Switch", "PORT1_5_RX" }, 833 { "LSL Mixer", "Port1_6 Switch", "PORT 836 { "LSL Mixer", "Port1_6 Switch", "PORT1_6_RX" }, 834 { "LSL Mixer", "Port1_7 Switch", "PORT 837 { "LSL Mixer", "Port1_7 Switch", "PORT1_7_RX" }, 835 { "LSL Mixer", "Port1_8 Switch", "PORT 838 { "LSL Mixer", "Port1_8 Switch", "PORT1_8_RX" }, 836 839 837 /* Port 2 */ 840 /* Port 2 */ 838 { "LSL Mixer", "Port2_1 Switch", "PORT 841 { "LSL Mixer", "Port2_1 Switch", "PORT2_1_RX" }, 839 { "LSL Mixer", "Port2_2 Switch", "PORT 842 { "LSL Mixer", "Port2_2 Switch", "PORT2_2_RX" }, 840 843 841 { "LSL Mixer", "ADCL Switch", "ADC Lef 844 { "LSL Mixer", "ADCL Switch", "ADC Left" }, 842 { "LSL Mixer", "ADCR Switch", "ADC Rig 845 { "LSL Mixer", "ADCR Switch", "ADC Right" }, 843 { "LSL Mixer", "DMIC1L Switch", "DMIC1 846 { "LSL Mixer", "DMIC1L Switch", "DMIC1 Left" }, 844 { "LSL Mixer", "DMIC1R Switch", "DMIC1 847 { "LSL Mixer", "DMIC1R Switch", "DMIC1 Right" }, 845 { "LSL Mixer", "DMIC2L Switch", "DMIC2 848 { "LSL Mixer", "DMIC2L Switch", "DMIC2 Left" }, 846 { "LSL Mixer", "DMIC2R Switch", "DMIC2 849 { "LSL Mixer", "DMIC2R Switch", "DMIC2 Right" }, 847 { "LSL Mixer", "Sidetone Switch", "Sid 850 { "LSL Mixer", "Sidetone Switch", "Sidetone" }, 848 851 849 { "LSL DAC", NULL, "LSL Mixer" }, 852 { "LSL DAC", NULL, "LSL Mixer" }, 850 853 851 { "LSR Mixer", "Port1_1 Switch", "PORT 854 { "LSR Mixer", "Port1_1 Switch", "PORT1_1_RX" }, 852 { "LSR Mixer", "Port1_2 Switch", "PORT 855 { "LSR Mixer", "Port1_2 Switch", "PORT1_2_RX" }, 853 { "LSR Mixer", "Port1_3 Switch", "PORT 856 { "LSR Mixer", "Port1_3 Switch", "PORT1_3_RX" }, 854 { "LSR Mixer", "Port1_4 Switch", "PORT 857 { "LSR Mixer", "Port1_4 Switch", "PORT1_4_RX" }, 855 { "LSR Mixer", "Port1_5 Switch", "PORT 858 { "LSR Mixer", "Port1_5 Switch", "PORT1_5_RX" }, 856 { "LSR Mixer", "Port1_6 Switch", "PORT 859 { "LSR Mixer", "Port1_6 Switch", "PORT1_6_RX" }, 857 { "LSR Mixer", "Port1_7 Switch", "PORT 860 { "LSR Mixer", "Port1_7 Switch", "PORT1_7_RX" }, 858 { "LSR Mixer", "Port1_8 Switch", "PORT 861 { "LSR Mixer", "Port1_8 Switch", "PORT1_8_RX" }, 859 862 860 /* Port 2 */ 863 /* Port 2 */ 861 { "LSR Mixer", "Port2_1 Switch", "PORT 864 { "LSR Mixer", "Port2_1 Switch", "PORT2_1_RX" }, 862 { "LSR Mixer", "Port2_2 Switch", "PORT 865 { "LSR Mixer", "Port2_2 Switch", "PORT2_2_RX" }, 863 866 864 { "LSR Mixer", "ADCL Switch", "ADC Lef 867 { "LSR Mixer", "ADCL Switch", "ADC Left" }, 865 { "LSR Mixer", "ADCR Switch", "ADC Rig 868 { "LSR Mixer", "ADCR Switch", "ADC Right" }, 866 { "LSR Mixer", "DMIC1L Switch", "DMIC1 869 { "LSR Mixer", "DMIC1L Switch", "DMIC1 Left" }, 867 { "LSR Mixer", "DMIC1R Switch", "DMIC1 870 { "LSR Mixer", "DMIC1R Switch", "DMIC1 Right" }, 868 { "LSR Mixer", "DMIC2L Switch", "DMIC2 871 { "LSR Mixer", "DMIC2L Switch", "DMIC2 Left" }, 869 { "LSR Mixer", "DMIC2R Switch", "DMIC2 872 { "LSR Mixer", "DMIC2R Switch", "DMIC2 Right" }, 870 { "LSR Mixer", "Sidetone Switch", "Sid 873 { "LSR Mixer", "Sidetone Switch", "Sidetone" }, 871 874 872 { "LSR DAC", NULL, "LSR Mixer" }, 875 { "LSR DAC", NULL, "LSR Mixer" }, 873 876 874 { "LSOUTL", "Speaker Left Switch", "LS 877 { "LSOUTL", "Speaker Left Switch", "LSL DAC"}, 875 { "LSOUTR", "Speaker Left Switch", "LS 878 { "LSOUTR", "Speaker Left Switch", "LSR DAC"}, 876 879 877 /* Haptic map */ 880 /* Haptic map */ 878 { "HAL Mixer", "Port1_1 Switch", "PORT 881 { "HAL Mixer", "Port1_1 Switch", "PORT1_1_RX" }, 879 { "HAL Mixer", "Port1_2 Switch", "PORT 882 { "HAL Mixer", "Port1_2 Switch", "PORT1_2_RX" }, 880 { "HAL Mixer", "Port1_3 Switch", "PORT 883 { "HAL Mixer", "Port1_3 Switch", "PORT1_3_RX" }, 881 { "HAL Mixer", "Port1_4 Switch", "PORT 884 { "HAL Mixer", "Port1_4 Switch", "PORT1_4_RX" }, 882 { "HAL Mixer", "Port1_5 Switch", "PORT 885 { "HAL Mixer", "Port1_5 Switch", "PORT1_5_RX" }, 883 { "HAL Mixer", "Port1_6 Switch", "PORT 886 { "HAL Mixer", "Port1_6 Switch", "PORT1_6_RX" }, 884 { "HAL Mixer", "Port1_7 Switch", "PORT 887 { "HAL Mixer", "Port1_7 Switch", "PORT1_7_RX" }, 885 { "HAL Mixer", "Port1_8 Switch", "PORT 888 { "HAL Mixer", "Port1_8 Switch", "PORT1_8_RX" }, 886 889 887 /* Port 2 */ 890 /* Port 2 */ 888 { "HAL Mixer", "Port2_1 Switch", "PORT 891 { "HAL Mixer", "Port2_1 Switch", "PORT2_1_RX" }, 889 { "HAL Mixer", "Port2_2 Switch", "PORT 892 { "HAL Mixer", "Port2_2 Switch", "PORT2_2_RX" }, 890 893 891 { "HAL Mixer", "ADCL Switch", "ADC Lef 894 { "HAL Mixer", "ADCL Switch", "ADC Left" }, 892 { "HAL Mixer", "ADCR Switch", "ADC Rig 895 { "HAL Mixer", "ADCR Switch", "ADC Right" }, 893 { "HAL Mixer", "DMIC1L Switch", "DMIC1 896 { "HAL Mixer", "DMIC1L Switch", "DMIC1 Left" }, 894 { "HAL Mixer", "DMIC1R Switch", "DMIC1 897 { "HAL Mixer", "DMIC1R Switch", "DMIC1 Right" }, 895 { "HAL Mixer", "DMIC2L Switch", "DMIC2 898 { "HAL Mixer", "DMIC2L Switch", "DMIC2 Left" }, 896 { "HAL Mixer", "DMIC2R Switch", "DMIC2 899 { "HAL Mixer", "DMIC2R Switch", "DMIC2 Right" }, 897 { "HAL Mixer", "Sidetone Switch", "Sid 900 { "HAL Mixer", "Sidetone Switch", "Sidetone" }, 898 901 899 { "HAL DAC", NULL, "HAL Mixer" }, 902 { "HAL DAC", NULL, "HAL Mixer" }, 900 903 901 { "HAR Mixer", "Port1_1 Switch", "PORT 904 { "HAR Mixer", "Port1_1 Switch", "PORT1_1_RX" }, 902 { "HAR Mixer", "Port1_2 Switch", "PORT 905 { "HAR Mixer", "Port1_2 Switch", "PORT1_2_RX" }, 903 { "HAR Mixer", "Port1_3 Switch", "PORT 906 { "HAR Mixer", "Port1_3 Switch", "PORT1_3_RX" }, 904 { "HAR Mixer", "Port1_4 Switch", "PORT 907 { "HAR Mixer", "Port1_4 Switch", "PORT1_4_RX" }, 905 { "HAR Mixer", "Port1_5 Switch", "PORT 908 { "HAR Mixer", "Port1_5 Switch", "PORT1_5_RX" }, 906 { "HAR Mixer", "Port1_6 Switch", "PORT 909 { "HAR Mixer", "Port1_6 Switch", "PORT1_6_RX" }, 907 { "HAR Mixer", "Port1_7 Switch", "PORT 910 { "HAR Mixer", "Port1_7 Switch", "PORT1_7_RX" }, 908 { "HAR Mixer", "Port1_8 Switch", "PORT 911 { "HAR Mixer", "Port1_8 Switch", "PORT1_8_RX" }, 909 912 910 /* Port 2 */ 913 /* Port 2 */ 911 { "HAR Mixer", "Port2_1 Switch", "PORT 914 { "HAR Mixer", "Port2_1 Switch", "PORT2_1_RX" }, 912 { "HAR Mixer", "Port2_2 Switch", "PORT 915 { "HAR Mixer", "Port2_2 Switch", "PORT2_2_RX" }, 913 916 914 { "HAR Mixer", "ADCL Switch", "ADC Lef 917 { "HAR Mixer", "ADCL Switch", "ADC Left" }, 915 { "HAR Mixer", "ADCR Switch", "ADC Rig 918 { "HAR Mixer", "ADCR Switch", "ADC Right" }, 916 { "HAR Mixer", "DMIC1L Switch", "DMIC1 919 { "HAR Mixer", "DMIC1L Switch", "DMIC1 Left" }, 917 { "HAR Mixer", "DMIC1R Switch", "DMIC1 920 { "HAR Mixer", "DMIC1R Switch", "DMIC1 Right" }, 918 { "HAR Mixer", "DMIC2L Switch", "DMIC2 921 { "HAR Mixer", "DMIC2L Switch", "DMIC2 Left" }, 919 { "HAR Mixer", "DMIC2R Switch", "DMIC2 922 { "HAR Mixer", "DMIC2R Switch", "DMIC2 Right" }, 920 { "HAR Mixer", "Sideton Switch", "Side 923 { "HAR Mixer", "Sideton Switch", "Sidetone" }, 921 924 922 { "HAR DAC", NULL, "HAR Mixer" }, 925 { "HAR DAC", NULL, "HAR Mixer" }, 923 926 924 { "HAOUTL", "Haptic Left Switch", "HAL 927 { "HAOUTL", "Haptic Left Switch", "HAL DAC" }, 925 { "HAOUTR", "Haptic Right Switch", "HA 928 { "HAOUTR", "Haptic Right Switch", "HAR DAC" }, 926 929 927 /* Lineout map */ 930 /* Lineout map */ 928 { "LOL Mixer", "Port1_1 Switch", "PORT 931 { "LOL Mixer", "Port1_1 Switch", "PORT1_1_RX" }, 929 { "LOL Mixer", "Port1_2 Switch", "PORT 932 { "LOL Mixer", "Port1_2 Switch", "PORT1_2_RX" }, 930 { "LOL Mixer", "Port1_3 Switch", "PORT 933 { "LOL Mixer", "Port1_3 Switch", "PORT1_3_RX" }, 931 { "LOL Mixer", "Port1_4 Switch", "PORT 934 { "LOL Mixer", "Port1_4 Switch", "PORT1_4_RX" }, 932 { "LOL Mixer", "Port1_5 Switch", "PORT 935 { "LOL Mixer", "Port1_5 Switch", "PORT1_5_RX" }, 933 { "LOL Mixer", "Port1_6 Switch", "PORT 936 { "LOL Mixer", "Port1_6 Switch", "PORT1_6_RX" }, 934 { "LOL Mixer", "Port1_7 Switch", "PORT 937 { "LOL Mixer", "Port1_7 Switch", "PORT1_7_RX" }, 935 { "LOL Mixer", "Port1_8 Switch", "PORT 938 { "LOL Mixer", "Port1_8 Switch", "PORT1_8_RX" }, 936 939 937 /* Port 2 */ 940 /* Port 2 */ 938 { "LOL Mixer", "Port2_1 Switch", "PORT 941 { "LOL Mixer", "Port2_1 Switch", "PORT2_1_RX" }, 939 { "LOL Mixer", "Port2_2 Switch", "PORT 942 { "LOL Mixer", "Port2_2 Switch", "PORT2_2_RX" }, 940 943 941 { "LOL Mixer", "ADCL Switch", "ADC Lef 944 { "LOL Mixer", "ADCL Switch", "ADC Left" }, 942 { "LOL Mixer", "ADCR Switch", "ADC Rig 945 { "LOL Mixer", "ADCR Switch", "ADC Right" }, 943 { "LOL Mixer", "DMIC1L Switch", "DMIC1 946 { "LOL Mixer", "DMIC1L Switch", "DMIC1 Left" }, 944 { "LOL Mixer", "DMIC1R Switch", "DMIC1 947 { "LOL Mixer", "DMIC1R Switch", "DMIC1 Right" }, 945 { "LOL Mixer", "DMIC2L Switch", "DMIC2 948 { "LOL Mixer", "DMIC2L Switch", "DMIC2 Left" }, 946 { "LOL Mixer", "DMIC2R Switch", "DMIC2 949 { "LOL Mixer", "DMIC2R Switch", "DMIC2 Right" }, 947 { "LOL Mixer", "Sidetone Switch", "Sid 950 { "LOL Mixer", "Sidetone Switch", "Sidetone" }, 948 951 949 { "LOL DAC", NULL, "LOL Mixer" }, 952 { "LOL DAC", NULL, "LOL Mixer" }, 950 953 951 { "LOR Mixer", "Port1_1 Switch", "PORT 954 { "LOR Mixer", "Port1_1 Switch", "PORT1_1_RX" }, 952 { "LOR Mixer", "Port1_2 Switch", "PORT 955 { "LOR Mixer", "Port1_2 Switch", "PORT1_2_RX" }, 953 { "LOR Mixer", "Port1_3 Switch", "PORT 956 { "LOR Mixer", "Port1_3 Switch", "PORT1_3_RX" }, 954 { "LOR Mixer", "Port1_4 Switch", "PORT 957 { "LOR Mixer", "Port1_4 Switch", "PORT1_4_RX" }, 955 { "LOR Mixer", "Port1_5 Switch", "PORT 958 { "LOR Mixer", "Port1_5 Switch", "PORT1_5_RX" }, 956 { "LOR Mixer", "Port1_6 Switch", "PORT 959 { "LOR Mixer", "Port1_6 Switch", "PORT1_6_RX" }, 957 { "LOR Mixer", "Port1_7 Switch", "PORT 960 { "LOR Mixer", "Port1_7 Switch", "PORT1_7_RX" }, 958 { "LOR Mixer", "Port1_8 Switch", "PORT 961 { "LOR Mixer", "Port1_8 Switch", "PORT1_8_RX" }, 959 962 960 /* Port 2 */ 963 /* Port 2 */ 961 { "LOR Mixer", "Port2_1 Switch", "PORT 964 { "LOR Mixer", "Port2_1 Switch", "PORT2_1_RX" }, 962 { "LOR Mixer", "Port2_2 Switch", "PORT 965 { "LOR Mixer", "Port2_2 Switch", "PORT2_2_RX" }, 963 966 964 { "LOR Mixer", "ADCL Switch", "ADC Lef 967 { "LOR Mixer", "ADCL Switch", "ADC Left" }, 965 { "LOR Mixer", "ADCR Switch", "ADC Rig 968 { "LOR Mixer", "ADCR Switch", "ADC Right" }, 966 { "LOR Mixer", "DMIC1L Switch", "DMIC1 969 { "LOR Mixer", "DMIC1L Switch", "DMIC1 Left" }, 967 { "LOR Mixer", "DMIC1R Switch", "DMIC1 970 { "LOR Mixer", "DMIC1R Switch", "DMIC1 Right" }, 968 { "LOR Mixer", "DMIC2L Switch", "DMIC2 971 { "LOR Mixer", "DMIC2L Switch", "DMIC2 Left" }, 969 { "LOR Mixer", "DMIC2R Switch", "DMIC2 972 { "LOR Mixer", "DMIC2R Switch", "DMIC2 Right" }, 970 { "LOR Mixer", "Sidetone Switch", "Sid 973 { "LOR Mixer", "Sidetone Switch", "Sidetone" }, 971 974 972 { "LOR DAC", NULL, "LOR Mixer" }, 975 { "LOR DAC", NULL, "LOR Mixer" }, 973 976 974 { "LOOUTL", NULL, "LOL DAC" }, 977 { "LOOUTL", NULL, "LOL DAC" }, 975 { "LOOUTR", NULL, "LOR DAC" }, 978 { "LOOUTR", NULL, "LOR DAC" }, 976 979 977 /* TX map */ 980 /* TX map */ 978 /* Port1 mappings */ 981 /* Port1 mappings */ 979 { "Port1_1 Mixer", "ADCL Switch", "ADC 982 { "Port1_1 Mixer", "ADCL Switch", "ADC Left" }, 980 { "Port1_1 Mixer", "ADCR Switch", "ADC 983 { "Port1_1 Mixer", "ADCR Switch", "ADC Right" }, 981 { "Port1_1 Mixer", "DMIC1L Switch", "D 984 { "Port1_1 Mixer", "DMIC1L Switch", "DMIC1 Left" }, 982 { "Port1_1 Mixer", "DMIC1R Switch", "D 985 { "Port1_1 Mixer", "DMIC1R Switch", "DMIC1 Right" }, 983 { "Port1_1 Mixer", "DMIC2L Switch", "D 986 { "Port1_1 Mixer", "DMIC2L Switch", "DMIC2 Left" }, 984 { "Port1_1 Mixer", "DMIC2R Switch", "D 987 { "Port1_1 Mixer", "DMIC2R Switch", "DMIC2 Right" }, 985 988 986 { "Port1_2 Mixer", "ADCL Switch", "ADC 989 { "Port1_2 Mixer", "ADCL Switch", "ADC Left" }, 987 { "Port1_2 Mixer", "ADCR Switch", "ADC 990 { "Port1_2 Mixer", "ADCR Switch", "ADC Right" }, 988 { "Port1_2 Mixer", "DMIC1L Switch", "D 991 { "Port1_2 Mixer", "DMIC1L Switch", "DMIC1 Left" }, 989 { "Port1_2 Mixer", "DMIC1R Switch", "D 992 { "Port1_2 Mixer", "DMIC1R Switch", "DMIC1 Right" }, 990 { "Port1_2 Mixer", "DMIC2L Switch", "D 993 { "Port1_2 Mixer", "DMIC2L Switch", "DMIC2 Left" }, 991 { "Port1_2 Mixer", "DMIC2R Switch", "D 994 { "Port1_2 Mixer", "DMIC2R Switch", "DMIC2 Right" }, 992 995 993 { "Port1_3 Mixer", "ADCL Switch", "ADC 996 { "Port1_3 Mixer", "ADCL Switch", "ADC Left" }, 994 { "Port1_3 Mixer", "ADCR Switch", "ADC 997 { "Port1_3 Mixer", "ADCR Switch", "ADC Right" }, 995 { "Port1_3 Mixer", "DMIC1L Switch", "D 998 { "Port1_3 Mixer", "DMIC1L Switch", "DMIC1 Left" }, 996 { "Port1_3 Mixer", "DMIC1R Switch", "D 999 { "Port1_3 Mixer", "DMIC1R Switch", "DMIC1 Right" }, 997 { "Port1_3 Mixer", "DMIC2L Switch", "D 1000 { "Port1_3 Mixer", "DMIC2L Switch", "DMIC2 Left" }, 998 { "Port1_3 Mixer", "DMIC2R Switch", "D 1001 { "Port1_3 Mixer", "DMIC2R Switch", "DMIC2 Right" }, 999 1002 1000 { "Port1_4 Mixer", "ADCL Switch", "AD 1003 { "Port1_4 Mixer", "ADCL Switch", "ADC Left" }, 1001 { "Port1_4 Mixer", "ADCR Switch", "AD 1004 { "Port1_4 Mixer", "ADCR Switch", "ADC Right" }, 1002 { "Port1_4 Mixer", "DMIC1L Switch", " 1005 { "Port1_4 Mixer", "DMIC1L Switch", "DMIC1 Left" }, 1003 { "Port1_4 Mixer", "DMIC1R Switch", " 1006 { "Port1_4 Mixer", "DMIC1R Switch", "DMIC1 Right" }, 1004 { "Port1_4 Mixer", "DMIC2L Switch", " 1007 { "Port1_4 Mixer", "DMIC2L Switch", "DMIC2 Left" }, 1005 { "Port1_4 Mixer", "DMIC2R Switch", " 1008 { "Port1_4 Mixer", "DMIC2R Switch", "DMIC2 Right" }, 1006 1009 1007 { "Port1_5 Mixer", "ADCL Switch", "AD 1010 { "Port1_5 Mixer", "ADCL Switch", "ADC Left" }, 1008 { "Port1_5 Mixer", "ADCR Switch", "AD 1011 { "Port1_5 Mixer", "ADCR Switch", "ADC Right" }, 1009 { "Port1_5 Mixer", "DMIC1L Switch", " 1012 { "Port1_5 Mixer", "DMIC1L Switch", "DMIC1 Left" }, 1010 { "Port1_5 Mixer", "DMIC1R Switch", " 1013 { "Port1_5 Mixer", "DMIC1R Switch", "DMIC1 Right" }, 1011 { "Port1_5 Mixer", "DMIC2L Switch", " 1014 { "Port1_5 Mixer", "DMIC2L Switch", "DMIC2 Left" }, 1012 { "Port1_5 Mixer", "DMIC2R Switch", " 1015 { "Port1_5 Mixer", "DMIC2R Switch", "DMIC2 Right" }, 1013 1016 1014 { "Port1_6 Mixer", "ADCL Switch", "AD 1017 { "Port1_6 Mixer", "ADCL Switch", "ADC Left" }, 1015 { "Port1_6 Mixer", "ADCR Switch", "AD 1018 { "Port1_6 Mixer", "ADCR Switch", "ADC Right" }, 1016 { "Port1_6 Mixer", "DMIC1L Switch", " 1019 { "Port1_6 Mixer", "DMIC1L Switch", "DMIC1 Left" }, 1017 { "Port1_6 Mixer", "DMIC1R Switch", " 1020 { "Port1_6 Mixer", "DMIC1R Switch", "DMIC1 Right" }, 1018 { "Port1_6 Mixer", "DMIC2L Switch", " 1021 { "Port1_6 Mixer", "DMIC2L Switch", "DMIC2 Left" }, 1019 { "Port1_6 Mixer", "DMIC2R Switch", " 1022 { "Port1_6 Mixer", "DMIC2R Switch", "DMIC2 Right" }, 1020 1023 1021 { "Port1_7 Mixer", "ADCL Switch", "AD 1024 { "Port1_7 Mixer", "ADCL Switch", "ADC Left" }, 1022 { "Port1_7 Mixer", "ADCR Switch", "AD 1025 { "Port1_7 Mixer", "ADCR Switch", "ADC Right" }, 1023 { "Port1_7 Mixer", "DMIC1L Switch", " 1026 { "Port1_7 Mixer", "DMIC1L Switch", "DMIC1 Left" }, 1024 { "Port1_7 Mixer", "DMIC1R Switch", " 1027 { "Port1_7 Mixer", "DMIC1R Switch", "DMIC1 Right" }, 1025 { "Port1_7 Mixer", "DMIC2L Switch", " 1028 { "Port1_7 Mixer", "DMIC2L Switch", "DMIC2 Left" }, 1026 { "Port1_7 Mixer", "DMIC2R Switch", " 1029 { "Port1_7 Mixer", "DMIC2R Switch", "DMIC2 Right" }, 1027 1030 1028 { "Port1_8 Mixer", "ADCL Switch", "AD 1031 { "Port1_8 Mixer", "ADCL Switch", "ADC Left" }, 1029 { "Port1_8 Mixer", "ADCR Switch", "AD 1032 { "Port1_8 Mixer", "ADCR Switch", "ADC Right" }, 1030 { "Port1_8 Mixer", "DMIC1L Switch", " 1033 { "Port1_8 Mixer", "DMIC1L Switch", "DMIC1 Left" }, 1031 { "Port1_8 Mixer", "DMIC1R Switch", " 1034 { "Port1_8 Mixer", "DMIC1R Switch", "DMIC1 Right" }, 1032 { "Port1_8 Mixer", "DMIC2L Switch", " 1035 { "Port1_8 Mixer", "DMIC2L Switch", "DMIC2 Left" }, 1033 { "Port1_8 Mixer", "DMIC2R Switch", " 1036 { "Port1_8 Mixer", "DMIC2R Switch", "DMIC2 Right" }, 1034 1037 1035 { "Port2_1 Mixer", "ADCL Switch", "AD 1038 { "Port2_1 Mixer", "ADCL Switch", "ADC Left" }, 1036 { "Port2_1 Mixer", "ADCR Switch", "AD 1039 { "Port2_1 Mixer", "ADCR Switch", "ADC Right" }, 1037 { "Port2_1 Mixer", "DMIC1L Switch", " 1040 { "Port2_1 Mixer", "DMIC1L Switch", "DMIC1 Left" }, 1038 { "Port2_1 Mixer", "DMIC1R Switch", " 1041 { "Port2_1 Mixer", "DMIC1R Switch", "DMIC1 Right" }, 1039 { "Port2_1 Mixer", "DMIC2L Switch", " 1042 { "Port2_1 Mixer", "DMIC2L Switch", "DMIC2 Left" }, 1040 { "Port2_1 Mixer", "DMIC2R Switch", " 1043 { "Port2_1 Mixer", "DMIC2R Switch", "DMIC2 Right" }, 1041 1044 1042 { "Port2_2 Mixer", "ADCL Switch", "AD 1045 { "Port2_2 Mixer", "ADCL Switch", "ADC Left" }, 1043 { "Port2_2 Mixer", "ADCR Switch", "AD 1046 { "Port2_2 Mixer", "ADCR Switch", "ADC Right" }, 1044 { "Port2_2 Mixer", "DMIC1L Switch", " 1047 { "Port2_2 Mixer", "DMIC1L Switch", "DMIC1 Left" }, 1045 { "Port2_2 Mixer", "DMIC1R Switch", " 1048 { "Port2_2 Mixer", "DMIC1R Switch", "DMIC1 Right" }, 1046 { "Port2_2 Mixer", "DMIC2L Switch", " 1049 { "Port2_2 Mixer", "DMIC2L Switch", "DMIC2 Left" }, 1047 { "Port2_2 Mixer", "DMIC2R Switch", " 1050 { "Port2_2 Mixer", "DMIC2R Switch", "DMIC2 Right" }, 1048 1051 1049 { "P1_1_TX", NULL, "Port1_1 Mixer" }, 1052 { "P1_1_TX", NULL, "Port1_1 Mixer" }, 1050 { "P1_2_TX", NULL, "Port1_2 Mixer" }, 1053 { "P1_2_TX", NULL, "Port1_2 Mixer" }, 1051 { "P1_3_TX", NULL, "Port1_3 Mixer" }, 1054 { "P1_3_TX", NULL, "Port1_3 Mixer" }, 1052 { "P1_4_TX", NULL, "Port1_4 Mixer" }, 1055 { "P1_4_TX", NULL, "Port1_4 Mixer" }, 1053 { "P1_5_TX", NULL, "Port1_5 Mixer" }, 1056 { "P1_5_TX", NULL, "Port1_5 Mixer" }, 1054 { "P1_6_TX", NULL, "Port1_6 Mixer" }, 1057 { "P1_6_TX", NULL, "Port1_6 Mixer" }, 1055 { "P1_7_TX", NULL, "Port1_7 Mixer" }, 1058 { "P1_7_TX", NULL, "Port1_7 Mixer" }, 1056 { "P1_8_TX", NULL, "Port1_8 Mixer" }, 1059 { "P1_8_TX", NULL, "Port1_8 Mixer" }, 1057 1060 1058 { "P2_1_TX", NULL, "Port2_1 Mixer" }, 1061 { "P2_1_TX", NULL, "Port2_1 Mixer" }, 1059 { "P2_2_TX", NULL, "Port2_2 Mixer" }, 1062 { "P2_2_TX", NULL, "Port2_2 Mixer" }, 1060 1063 1061 { "PORT1_SDO", "Port1 Capture Switch" 1064 { "PORT1_SDO", "Port1 Capture Switch", "P1_1_TX"}, 1062 { "PORT1_SDO", "Port1 Capture Switch" 1065 { "PORT1_SDO", "Port1 Capture Switch", "P1_2_TX"}, 1063 { "PORT1_SDO", "Port1 Capture Switch" 1066 { "PORT1_SDO", "Port1 Capture Switch", "P1_3_TX"}, 1064 { "PORT1_SDO", "Port1 Capture Switch" 1067 { "PORT1_SDO", "Port1 Capture Switch", "P1_4_TX"}, 1065 { "PORT1_SDO", "Port1 Capture Switch" 1068 { "PORT1_SDO", "Port1 Capture Switch", "P1_5_TX"}, 1066 { "PORT1_SDO", "Port1 Capture Switch" 1069 { "PORT1_SDO", "Port1 Capture Switch", "P1_6_TX"}, 1067 { "PORT1_SDO", "Port1 Capture Switch" 1070 { "PORT1_SDO", "Port1 Capture Switch", "P1_7_TX"}, 1068 { "PORT1_SDO", "Port1 Capture Switch" 1071 { "PORT1_SDO", "Port1 Capture Switch", "P1_8_TX"}, 1069 1072 1070 { "PORT2_SDO", "Port2 Capture Switch" 1073 { "PORT2_SDO", "Port2 Capture Switch", "P2_1_TX"}, 1071 { "PORT2_SDO", "Port2 Capture Switch" 1074 { "PORT2_SDO", "Port2 Capture Switch", "P2_2_TX"}, 1072 1075 1073 { "Mic1 Input", NULL, "AMIC1" }, 1076 { "Mic1 Input", NULL, "AMIC1" }, 1074 { "Mic2 Input", NULL, "AMIC2" }, 1077 { "Mic2 Input", NULL, "AMIC2" }, 1075 1078 1076 { "AUXL Input", NULL, "AUXL" }, 1079 { "AUXL Input", NULL, "AUXL" }, 1077 { "AUXR Input", NULL, "AUXR" }, 1080 { "AUXR Input", NULL, "AUXR" }, 1078 1081 1079 /* AUX connections */ 1082 /* AUX connections */ 1080 { "ADCL Mux", "Aux_L", "AUXL Input" } 1083 { "ADCL Mux", "Aux_L", "AUXL Input" }, 1081 { "ADCL Mux", "MIC1", "Mic1 Input" }, 1084 { "ADCL Mux", "MIC1", "Mic1 Input" }, 1082 1085 1083 { "ADCR Mux", "Aux_R", "AUXR Input" } 1086 { "ADCR Mux", "Aux_R", "AUXR Input" }, 1084 { "ADCR Mux", "MIC2", "Mic2 Input" }, 1087 { "ADCR Mux", "MIC2", "Mic2 Input" }, 1085 1088 1086 /* ADC connection */ 1089 /* ADC connection */ 1087 { "ADC Left", NULL, "ADCL Mux"}, 1090 { "ADC Left", NULL, "ADCL Mux"}, 1088 { "ADC Right", NULL, "ADCR Mux"}, 1091 { "ADC Right", NULL, "ADCR Mux"}, 1089 1092 1090 { "DMIC1 Left", NULL, "DMIC1DAT"}, 1093 { "DMIC1 Left", NULL, "DMIC1DAT"}, 1091 { "DMIC1 Right", NULL, "DMIC1DAT"}, 1094 { "DMIC1 Right", NULL, "DMIC1DAT"}, 1092 { "DMIC2 Left", NULL, "DMIC2DAT"}, 1095 { "DMIC2 Left", NULL, "DMIC2DAT"}, 1093 { "DMIC2 Right", NULL, "DMIC2DAT"}, 1096 { "DMIC2 Right", NULL, "DMIC2DAT"}, 1094 1097 1095 /* Sidetone map */ 1098 /* Sidetone map */ 1096 { "Sidetone Mixer", NULL, "ADC Left" 1099 { "Sidetone Mixer", NULL, "ADC Left" }, 1097 { "Sidetone Mixer", NULL, "ADC Right" 1100 { "Sidetone Mixer", NULL, "ADC Right" }, 1098 { "Sidetone Mixer", NULL, "DMIC1 Left 1101 { "Sidetone Mixer", NULL, "DMIC1 Left" }, 1099 { "Sidetone Mixer", NULL, "DMIC1 Righ 1102 { "Sidetone Mixer", NULL, "DMIC1 Right" }, 1100 { "Sidetone Mixer", NULL, "DMIC2 Left 1103 { "Sidetone Mixer", NULL, "DMIC2 Left" }, 1101 { "Sidetone Mixer", NULL, "DMIC2 Righ 1104 { "Sidetone Mixer", NULL, "DMIC2 Right" }, 1102 1105 1103 { "Sidetone", "Sidetone Switch", "Sid 1106 { "Sidetone", "Sidetone Switch", "Sidetone Mixer" }, 1104 }; 1107 }; 1105 1108 1106 static int lm49453_hw_params(struct snd_pcm_s 1109 static int lm49453_hw_params(struct snd_pcm_substream *substream, 1107 struct snd_pcm_h 1110 struct snd_pcm_hw_params *params, 1108 struct snd_soc_d 1111 struct snd_soc_dai *dai) 1109 { 1112 { 1110 struct snd_soc_component *component = 1113 struct snd_soc_component *component = dai->component; 1111 u16 clk_div = 0; 1114 u16 clk_div = 0; 1112 1115 1113 /* Setting DAC clock dividers based o 1116 /* Setting DAC clock dividers based on substream sample rate. */ 1114 switch (params_rate(params)) { 1117 switch (params_rate(params)) { 1115 case 8000: 1118 case 8000: 1116 case 16000: 1119 case 16000: 1117 case 32000: 1120 case 32000: 1118 case 24000: 1121 case 24000: 1119 case 48000: 1122 case 48000: 1120 clk_div = 256; 1123 clk_div = 256; 1121 break; 1124 break; 1122 case 11025: 1125 case 11025: 1123 case 22050: 1126 case 22050: 1124 case 44100: 1127 case 44100: 1125 clk_div = 216; 1128 clk_div = 216; 1126 break; 1129 break; 1127 case 96000: 1130 case 96000: 1128 clk_div = 127; 1131 clk_div = 127; 1129 break; 1132 break; 1130 default: 1133 default: 1131 return -EINVAL; 1134 return -EINVAL; 1132 } 1135 } 1133 1136 1134 snd_soc_component_write(component, LM 1137 snd_soc_component_write(component, LM49453_P0_ADC_CLK_DIV_REG, clk_div); 1135 snd_soc_component_write(component, LM 1138 snd_soc_component_write(component, LM49453_P0_DAC_HP_CLK_DIV_REG, clk_div); 1136 1139 1137 return 0; 1140 return 0; 1138 } 1141 } 1139 1142 1140 static int lm49453_set_dai_fmt(struct snd_soc 1143 static int lm49453_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) 1141 { 1144 { 1142 struct snd_soc_component *component = 1145 struct snd_soc_component *component = codec_dai->component; 1143 1146 1144 u16 aif_val; 1147 u16 aif_val; 1145 int mode = 0; 1148 int mode = 0; 1146 int clk_phase = 0; 1149 int clk_phase = 0; 1147 int clk_shift = 0; 1150 int clk_shift = 0; 1148 1151 1149 switch (fmt & SND_SOC_DAIFMT_CLOCK_PR !! 1152 switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { 1150 case SND_SOC_DAIFMT_CBC_CFC: !! 1153 case SND_SOC_DAIFMT_CBS_CFS: 1151 aif_val = 0; 1154 aif_val = 0; 1152 break; 1155 break; 1153 case SND_SOC_DAIFMT_CBC_CFP: !! 1156 case SND_SOC_DAIFMT_CBS_CFM: 1154 aif_val = LM49453_AUDIO_PORT1 1157 aif_val = LM49453_AUDIO_PORT1_BASIC_SYNC_MS; 1155 break; 1158 break; 1156 case SND_SOC_DAIFMT_CBP_CFC: !! 1159 case SND_SOC_DAIFMT_CBM_CFS: 1157 aif_val = LM49453_AUDIO_PORT1 1160 aif_val = LM49453_AUDIO_PORT1_BASIC_CLK_MS; 1158 break; 1161 break; 1159 case SND_SOC_DAIFMT_CBP_CFP: !! 1162 case SND_SOC_DAIFMT_CBM_CFM: 1160 aif_val = LM49453_AUDIO_PORT1 1163 aif_val = LM49453_AUDIO_PORT1_BASIC_CLK_MS | 1161 LM49453_AUDIO_PORT1 1164 LM49453_AUDIO_PORT1_BASIC_SYNC_MS; 1162 break; 1165 break; 1163 default: 1166 default: 1164 return -EINVAL; 1167 return -EINVAL; 1165 } 1168 } 1166 1169 1167 1170 1168 switch (fmt & SND_SOC_DAIFMT_FORMAT_M 1171 switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { 1169 case SND_SOC_DAIFMT_I2S: 1172 case SND_SOC_DAIFMT_I2S: 1170 break; 1173 break; 1171 case SND_SOC_DAIFMT_DSP_A: 1174 case SND_SOC_DAIFMT_DSP_A: 1172 mode = 1; 1175 mode = 1; 1173 clk_phase = (1 << 5); 1176 clk_phase = (1 << 5); 1174 clk_shift = 1; 1177 clk_shift = 1; 1175 break; 1178 break; 1176 case SND_SOC_DAIFMT_DSP_B: 1179 case SND_SOC_DAIFMT_DSP_B: 1177 mode = 1; 1180 mode = 1; 1178 clk_phase = (1 << 5); 1181 clk_phase = (1 << 5); 1179 clk_shift = 0; 1182 clk_shift = 0; 1180 break; 1183 break; 1181 default: 1184 default: 1182 return -EINVAL; 1185 return -EINVAL; 1183 } 1186 } 1184 1187 1185 snd_soc_component_update_bits(compone 1188 snd_soc_component_update_bits(component, LM49453_P0_AUDIO_PORT1_BASIC_REG, 1186 LM49453_AUDIO_POR 1189 LM49453_AUDIO_PORT1_BASIC_FMT_MASK|BIT(0)|BIT(5), 1187 (aif_val | mode | 1190 (aif_val | mode | clk_phase)); 1188 1191 1189 snd_soc_component_write(component, LM 1192 snd_soc_component_write(component, LM49453_P0_AUDIO_PORT1_RX_MSB_REG, clk_shift); 1190 1193 1191 return 0; 1194 return 0; 1192 } 1195 } 1193 1196 1194 static int lm49453_set_dai_sysclk(struct snd_ 1197 static int lm49453_set_dai_sysclk(struct snd_soc_dai *dai, int clk_id, 1195 unsigned in 1198 unsigned int freq, int dir) 1196 { 1199 { 1197 struct snd_soc_component *component = 1200 struct snd_soc_component *component = dai->component; 1198 u16 pll_clk = 0; 1201 u16 pll_clk = 0; 1199 1202 1200 switch (freq) { 1203 switch (freq) { 1201 case 12288000: 1204 case 12288000: 1202 case 26000000: 1205 case 26000000: 1203 case 19200000: 1206 case 19200000: 1204 /* pll clk slection */ 1207 /* pll clk slection */ 1205 pll_clk = 0; 1208 pll_clk = 0; 1206 break; 1209 break; 1207 case 48000: 1210 case 48000: 1208 case 32576: 1211 case 32576: >> 1212 /* fll clk slection */ >> 1213 pll_clk = BIT(4); 1209 return 0; 1214 return 0; 1210 default: 1215 default: 1211 return -EINVAL; 1216 return -EINVAL; 1212 } 1217 } 1213 1218 1214 snd_soc_component_update_bits(compone 1219 snd_soc_component_update_bits(component, LM49453_P0_PMC_SETUP_REG, BIT(4), pll_clk); 1215 1220 1216 return 0; 1221 return 0; 1217 } 1222 } 1218 1223 1219 static int lm49453_hp_mute(struct snd_soc_dai !! 1224 static int lm49453_hp_mute(struct snd_soc_dai *dai, int mute) 1220 { 1225 { 1221 snd_soc_component_update_bits(dai->co 1226 snd_soc_component_update_bits(dai->component, LM49453_P0_DAC_DSP_REG, BIT(1)|BIT(0), 1222 (mute ? (BIT(1)|B 1227 (mute ? (BIT(1)|BIT(0)) : 0)); 1223 return 0; 1228 return 0; 1224 } 1229 } 1225 1230 1226 static int lm49453_lo_mute(struct snd_soc_dai !! 1231 static int lm49453_lo_mute(struct snd_soc_dai *dai, int mute) 1227 { 1232 { 1228 snd_soc_component_update_bits(dai->co 1233 snd_soc_component_update_bits(dai->component, LM49453_P0_DAC_DSP_REG, BIT(3)|BIT(2), 1229 (mute ? (BIT(3)|B 1234 (mute ? (BIT(3)|BIT(2)) : 0)); 1230 return 0; 1235 return 0; 1231 } 1236 } 1232 1237 1233 static int lm49453_ls_mute(struct snd_soc_dai !! 1238 static int lm49453_ls_mute(struct snd_soc_dai *dai, int mute) 1234 { 1239 { 1235 snd_soc_component_update_bits(dai->co 1240 snd_soc_component_update_bits(dai->component, LM49453_P0_DAC_DSP_REG, BIT(5)|BIT(4), 1236 (mute ? (BIT(5)|B 1241 (mute ? (BIT(5)|BIT(4)) : 0)); 1237 return 0; 1242 return 0; 1238 } 1243 } 1239 1244 1240 static int lm49453_ep_mute(struct snd_soc_dai !! 1245 static int lm49453_ep_mute(struct snd_soc_dai *dai, int mute) 1241 { 1246 { 1242 snd_soc_component_update_bits(dai->co 1247 snd_soc_component_update_bits(dai->component, LM49453_P0_DAC_DSP_REG, BIT(4), 1243 (mute ? BIT(4) : 1248 (mute ? BIT(4) : 0)); 1244 return 0; 1249 return 0; 1245 } 1250 } 1246 1251 1247 static int lm49453_ha_mute(struct snd_soc_dai !! 1252 static int lm49453_ha_mute(struct snd_soc_dai *dai, int mute) 1248 { 1253 { 1249 snd_soc_component_update_bits(dai->co 1254 snd_soc_component_update_bits(dai->component, LM49453_P0_DAC_DSP_REG, BIT(7)|BIT(6), 1250 (mute ? (BIT(7)|B 1255 (mute ? (BIT(7)|BIT(6)) : 0)); 1251 return 0; 1256 return 0; 1252 } 1257 } 1253 1258 1254 static int lm49453_set_bias_level(struct snd_ 1259 static int lm49453_set_bias_level(struct snd_soc_component *component, 1255 enum snd_so 1260 enum snd_soc_bias_level level) 1256 { 1261 { 1257 struct lm49453_priv *lm49453 = snd_so 1262 struct lm49453_priv *lm49453 = snd_soc_component_get_drvdata(component); 1258 1263 1259 switch (level) { 1264 switch (level) { 1260 case SND_SOC_BIAS_ON: 1265 case SND_SOC_BIAS_ON: 1261 case SND_SOC_BIAS_PREPARE: 1266 case SND_SOC_BIAS_PREPARE: 1262 break; 1267 break; 1263 1268 1264 case SND_SOC_BIAS_STANDBY: 1269 case SND_SOC_BIAS_STANDBY: 1265 if (snd_soc_component_get_bia 1270 if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) 1266 regcache_sync(lm49453 1271 regcache_sync(lm49453->regmap); 1267 1272 1268 snd_soc_component_update_bits 1273 snd_soc_component_update_bits(component, LM49453_P0_PMC_SETUP_REG, 1269 LM49453_P 1274 LM49453_PMC_SETUP_CHIP_EN, LM49453_CHIP_EN); 1270 break; 1275 break; 1271 1276 1272 case SND_SOC_BIAS_OFF: 1277 case SND_SOC_BIAS_OFF: 1273 snd_soc_component_update_bits 1278 snd_soc_component_update_bits(component, LM49453_P0_PMC_SETUP_REG, 1274 LM49453_P 1279 LM49453_PMC_SETUP_CHIP_EN, 0); 1275 break; 1280 break; 1276 } 1281 } 1277 1282 1278 return 0; 1283 return 0; 1279 } 1284 } 1280 1285 1281 /* Formates supported by LM49453 driver. */ 1286 /* Formates supported by LM49453 driver. */ 1282 #define LM49453_FORMATS (SNDRV_PCM_FMTBIT_S16 1287 #define LM49453_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ 1283 SNDRV_PCM_FMTBIT_S24 1288 SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) 1284 1289 1285 static const struct snd_soc_dai_ops lm49453_h 1290 static const struct snd_soc_dai_ops lm49453_headset_dai_ops = { 1286 .hw_params = lm49453_hw_params, 1291 .hw_params = lm49453_hw_params, 1287 .set_sysclk = lm49453_set_dai_sys 1292 .set_sysclk = lm49453_set_dai_sysclk, 1288 .set_fmt = lm49453_set_dai_fmt 1293 .set_fmt = lm49453_set_dai_fmt, 1289 .mute_stream = lm49453_hp_mute, !! 1294 .digital_mute = lm49453_hp_mute, 1290 .no_capture_mute = 1, << 1291 }; 1295 }; 1292 1296 1293 static const struct snd_soc_dai_ops lm49453_s 1297 static const struct snd_soc_dai_ops lm49453_speaker_dai_ops = { 1294 .hw_params = lm49453_hw_params, 1298 .hw_params = lm49453_hw_params, 1295 .set_sysclk = lm49453_set_dai_sys 1299 .set_sysclk = lm49453_set_dai_sysclk, 1296 .set_fmt = lm49453_set_dai_fmt 1300 .set_fmt = lm49453_set_dai_fmt, 1297 .mute_stream = lm49453_ls_mute, !! 1301 .digital_mute = lm49453_ls_mute, 1298 .no_capture_mute = 1, << 1299 }; 1302 }; 1300 1303 1301 static const struct snd_soc_dai_ops lm49453_h 1304 static const struct snd_soc_dai_ops lm49453_haptic_dai_ops = { 1302 .hw_params = lm49453_hw_params, 1305 .hw_params = lm49453_hw_params, 1303 .set_sysclk = lm49453_set_dai_sys 1306 .set_sysclk = lm49453_set_dai_sysclk, 1304 .set_fmt = lm49453_set_dai_fmt 1307 .set_fmt = lm49453_set_dai_fmt, 1305 .mute_stream = lm49453_ha_mute, !! 1308 .digital_mute = lm49453_ha_mute, 1306 .no_capture_mute = 1, << 1307 }; 1309 }; 1308 1310 1309 static const struct snd_soc_dai_ops lm49453_e 1311 static const struct snd_soc_dai_ops lm49453_ep_dai_ops = { 1310 .hw_params = lm49453_hw_params, 1312 .hw_params = lm49453_hw_params, 1311 .set_sysclk = lm49453_set_dai_sys 1313 .set_sysclk = lm49453_set_dai_sysclk, 1312 .set_fmt = lm49453_set_dai_fmt 1314 .set_fmt = lm49453_set_dai_fmt, 1313 .mute_stream = lm49453_ep_mute, !! 1315 .digital_mute = lm49453_ep_mute, 1314 .no_capture_mute = 1, << 1315 }; 1316 }; 1316 1317 1317 static const struct snd_soc_dai_ops lm49453_l 1318 static const struct snd_soc_dai_ops lm49453_lineout_dai_ops = { 1318 .hw_params = lm49453_hw_params, 1319 .hw_params = lm49453_hw_params, 1319 .set_sysclk = lm49453_set_dai_sys 1320 .set_sysclk = lm49453_set_dai_sysclk, 1320 .set_fmt = lm49453_set_dai_fmt 1321 .set_fmt = lm49453_set_dai_fmt, 1321 .mute_stream = lm49453_lo_mute, !! 1322 .digital_mute = lm49453_lo_mute, 1322 .no_capture_mute = 1, << 1323 }; 1323 }; 1324 1324 1325 /* LM49453 dai structure. */ 1325 /* LM49453 dai structure. */ 1326 static struct snd_soc_dai_driver lm49453_dai[ 1326 static struct snd_soc_dai_driver lm49453_dai[] = { 1327 { 1327 { 1328 .name = "LM49453 Headset", 1328 .name = "LM49453 Headset", 1329 .playback = { 1329 .playback = { 1330 .stream_name = "Heads 1330 .stream_name = "Headset", 1331 .channels_min = 2, 1331 .channels_min = 2, 1332 .channels_max = 2, 1332 .channels_max = 2, 1333 .rates = SNDRV_PCM_RA 1333 .rates = SNDRV_PCM_RATE_8000_192000, 1334 .formats = LM49453_FO 1334 .formats = LM49453_FORMATS, 1335 }, 1335 }, 1336 .capture = { 1336 .capture = { 1337 .stream_name = "Captu 1337 .stream_name = "Capture", 1338 .channels_min = 1, 1338 .channels_min = 1, 1339 .channels_max = 5, 1339 .channels_max = 5, 1340 .rates = SNDRV_PCM_RA 1340 .rates = SNDRV_PCM_RATE_8000_192000, 1341 .formats = LM49453_FO 1341 .formats = LM49453_FORMATS, 1342 }, 1342 }, 1343 .ops = &lm49453_headset_dai_o 1343 .ops = &lm49453_headset_dai_ops, 1344 .symmetric_rate = 1, !! 1344 .symmetric_rates = 1, 1345 }, 1345 }, 1346 { 1346 { 1347 .name = "LM49453 Speaker", 1347 .name = "LM49453 Speaker", 1348 .playback = { 1348 .playback = { 1349 .stream_name = "Speak 1349 .stream_name = "Speaker", 1350 .channels_min = 2, 1350 .channels_min = 2, 1351 .channels_max = 2, 1351 .channels_max = 2, 1352 .rates = SNDRV_PCM_RA 1352 .rates = SNDRV_PCM_RATE_8000_192000, 1353 .formats = LM49453_FO 1353 .formats = LM49453_FORMATS, 1354 }, 1354 }, 1355 .ops = &lm49453_speaker_dai_o 1355 .ops = &lm49453_speaker_dai_ops, 1356 }, 1356 }, 1357 { 1357 { 1358 .name = "LM49453 Haptic", 1358 .name = "LM49453 Haptic", 1359 .playback = { 1359 .playback = { 1360 .stream_name = "Hapti 1360 .stream_name = "Haptic", 1361 .channels_min = 2, 1361 .channels_min = 2, 1362 .channels_max = 2, 1362 .channels_max = 2, 1363 .rates = SNDRV_PCM_RA 1363 .rates = SNDRV_PCM_RATE_8000_192000, 1364 .formats = LM49453_FO 1364 .formats = LM49453_FORMATS, 1365 }, 1365 }, 1366 .ops = &lm49453_haptic_dai_op 1366 .ops = &lm49453_haptic_dai_ops, 1367 }, 1367 }, 1368 { 1368 { 1369 .name = "LM49453 Earpiece", 1369 .name = "LM49453 Earpiece", 1370 .playback = { 1370 .playback = { 1371 .stream_name = "Earpi 1371 .stream_name = "Earpiece", 1372 .channels_min = 1, 1372 .channels_min = 1, 1373 .channels_max = 1, 1373 .channels_max = 1, 1374 .rates = SNDRV_PCM_RA 1374 .rates = SNDRV_PCM_RATE_8000_192000, 1375 .formats = LM49453_FO 1375 .formats = LM49453_FORMATS, 1376 }, 1376 }, 1377 .ops = &lm49453_ep_dai_ops, 1377 .ops = &lm49453_ep_dai_ops, 1378 }, 1378 }, 1379 { 1379 { 1380 .name = "LM49453 line out", 1380 .name = "LM49453 line out", 1381 .playback = { 1381 .playback = { 1382 .stream_name = "Lineo 1382 .stream_name = "Lineout", 1383 .channels_min = 2, 1383 .channels_min = 2, 1384 .channels_max = 2, 1384 .channels_max = 2, 1385 .rates = SNDRV_PCM_RA 1385 .rates = SNDRV_PCM_RATE_8000_192000, 1386 .formats = LM49453_FO 1386 .formats = LM49453_FORMATS, 1387 }, 1387 }, 1388 .ops = &lm49453_lineout_dai_o 1388 .ops = &lm49453_lineout_dai_ops, 1389 }, 1389 }, 1390 }; 1390 }; 1391 1391 1392 static const struct snd_soc_component_driver 1392 static const struct snd_soc_component_driver soc_component_dev_lm49453 = { 1393 .set_bias_level = lm49453_set 1393 .set_bias_level = lm49453_set_bias_level, 1394 .controls = lm49453_snd 1394 .controls = lm49453_snd_controls, 1395 .num_controls = ARRAY_SIZE( 1395 .num_controls = ARRAY_SIZE(lm49453_snd_controls), 1396 .dapm_widgets = lm49453_dap 1396 .dapm_widgets = lm49453_dapm_widgets, 1397 .num_dapm_widgets = ARRAY_SIZE( 1397 .num_dapm_widgets = ARRAY_SIZE(lm49453_dapm_widgets), 1398 .dapm_routes = lm49453_aud 1398 .dapm_routes = lm49453_audio_map, 1399 .num_dapm_routes = ARRAY_SIZE( 1399 .num_dapm_routes = ARRAY_SIZE(lm49453_audio_map), 1400 .use_pmdown_time = 1, 1400 .use_pmdown_time = 1, 1401 .endianness = 1, 1401 .endianness = 1, >> 1402 .non_legacy_dai_naming = 1, 1402 }; 1403 }; 1403 1404 1404 static const struct regmap_config lm49453_reg 1405 static const struct regmap_config lm49453_regmap_config = { 1405 .reg_bits = 8, 1406 .reg_bits = 8, 1406 .val_bits = 8, 1407 .val_bits = 8, 1407 1408 1408 .max_register = LM49453_MAX_REGISTER, 1409 .max_register = LM49453_MAX_REGISTER, 1409 .reg_defaults = lm49453_reg_defs, 1410 .reg_defaults = lm49453_reg_defs, 1410 .num_reg_defaults = ARRAY_SIZE(lm4945 1411 .num_reg_defaults = ARRAY_SIZE(lm49453_reg_defs), 1411 .cache_type = REGCACHE_RBTREE, 1412 .cache_type = REGCACHE_RBTREE, 1412 }; 1413 }; 1413 1414 1414 static int lm49453_i2c_probe(struct i2c_clien !! 1415 static int lm49453_i2c_probe(struct i2c_client *i2c, >> 1416 const struct i2c_device_id *id) 1415 { 1417 { 1416 struct lm49453_priv *lm49453; 1418 struct lm49453_priv *lm49453; 1417 int ret = 0; 1419 int ret = 0; 1418 1420 1419 lm49453 = devm_kzalloc(&i2c->dev, siz 1421 lm49453 = devm_kzalloc(&i2c->dev, sizeof(struct lm49453_priv), 1420 GFP_KERNEL); 1422 GFP_KERNEL); 1421 1423 1422 if (lm49453 == NULL) 1424 if (lm49453 == NULL) 1423 return -ENOMEM; 1425 return -ENOMEM; 1424 1426 1425 i2c_set_clientdata(i2c, lm49453); 1427 i2c_set_clientdata(i2c, lm49453); 1426 1428 1427 lm49453->regmap = devm_regmap_init_i2 1429 lm49453->regmap = devm_regmap_init_i2c(i2c, &lm49453_regmap_config); 1428 if (IS_ERR(lm49453->regmap)) { 1430 if (IS_ERR(lm49453->regmap)) { 1429 ret = PTR_ERR(lm49453->regmap 1431 ret = PTR_ERR(lm49453->regmap); 1430 dev_err(&i2c->dev, "Failed to 1432 dev_err(&i2c->dev, "Failed to allocate register map: %d\n", 1431 ret); 1433 ret); 1432 return ret; 1434 return ret; 1433 } 1435 } 1434 1436 1435 ret = devm_snd_soc_register_componen 1437 ret = devm_snd_soc_register_component(&i2c->dev, 1436 &soc_co 1438 &soc_component_dev_lm49453, 1437 lm49453 1439 lm49453_dai, ARRAY_SIZE(lm49453_dai)); 1438 if (ret < 0) 1440 if (ret < 0) 1439 dev_err(&i2c->dev, "Failed to 1441 dev_err(&i2c->dev, "Failed to register component: %d\n", ret); 1440 1442 1441 return ret; 1443 return ret; 1442 } 1444 } 1443 1445 >> 1446 static int lm49453_i2c_remove(struct i2c_client *client) >> 1447 { >> 1448 return 0; >> 1449 } >> 1450 1444 static const struct i2c_device_id lm49453_i2c 1451 static const struct i2c_device_id lm49453_i2c_id[] = { 1445 { "lm49453" }, !! 1452 { "lm49453", 0 }, 1446 { } 1453 { } 1447 }; 1454 }; 1448 MODULE_DEVICE_TABLE(i2c, lm49453_i2c_id); 1455 MODULE_DEVICE_TABLE(i2c, lm49453_i2c_id); 1449 1456 1450 static struct i2c_driver lm49453_i2c_driver = 1457 static struct i2c_driver lm49453_i2c_driver = { 1451 .driver = { 1458 .driver = { 1452 .name = "lm49453", 1459 .name = "lm49453", 1453 }, 1460 }, 1454 .probe = lm49453_i2c_probe, 1461 .probe = lm49453_i2c_probe, >> 1462 .remove = lm49453_i2c_remove, 1455 .id_table = lm49453_i2c_id, 1463 .id_table = lm49453_i2c_id, 1456 }; 1464 }; 1457 1465 1458 module_i2c_driver(lm49453_i2c_driver); 1466 module_i2c_driver(lm49453_i2c_driver); 1459 1467 1460 MODULE_DESCRIPTION("ASoC LM49453 driver"); 1468 MODULE_DESCRIPTION("ASoC LM49453 driver"); 1461 MODULE_AUTHOR("M R Swami Reddy <MR.Swami.Redd 1469 MODULE_AUTHOR("M R Swami Reddy <MR.Swami.Reddy@ti.com>"); 1462 MODULE_LICENSE("GPL v2"); 1470 MODULE_LICENSE("GPL v2"); 1463 1471
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.