aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/codecs/cs42l52.c69
1 files changed, 34 insertions, 35 deletions
diff --git a/sound/soc/codecs/cs42l52.c b/sound/soc/codecs/cs42l52.c
index 8367f3c571eb..56c5611fa752 100644
--- a/sound/soc/codecs/cs42l52.c
+++ b/sound/soc/codecs/cs42l52.c
@@ -1117,40 +1117,6 @@ static int cs42l52_probe(struct snd_soc_codec *codec)
1117 cs42l52->sysclk = CS42L52_DEFAULT_CLK; 1117 cs42l52->sysclk = CS42L52_DEFAULT_CLK;
1118 cs42l52->config.format = CS42L52_DEFAULT_FORMAT; 1118 cs42l52->config.format = CS42L52_DEFAULT_FORMAT;
1119 1119
1120 /* Set Platform MICx CFG */
1121 snd_soc_update_bits(codec, CS42L52_MICA_CTL,
1122 CS42L52_MIC_CTL_TYPE_MASK,
1123 cs42l52->pdata.mica_cfg <<
1124 CS42L52_MIC_CTL_TYPE_SHIFT);
1125
1126 snd_soc_update_bits(codec, CS42L52_MICB_CTL,
1127 CS42L52_MIC_CTL_TYPE_MASK,
1128 cs42l52->pdata.micb_cfg <<
1129 CS42L52_MIC_CTL_TYPE_SHIFT);
1130
1131 /* if Single Ended, Get Mic_Select */
1132 if (cs42l52->pdata.mica_cfg)
1133 snd_soc_update_bits(codec, CS42L52_MICA_CTL,
1134 CS42L52_MIC_CTL_MIC_SEL_MASK,
1135 cs42l52->pdata.mica_sel <<
1136 CS42L52_MIC_CTL_MIC_SEL_SHIFT);
1137 if (cs42l52->pdata.micb_cfg)
1138 snd_soc_update_bits(codec, CS42L52_MICB_CTL,
1139 CS42L52_MIC_CTL_MIC_SEL_MASK,
1140 cs42l52->pdata.micb_sel <<
1141 CS42L52_MIC_CTL_MIC_SEL_SHIFT);
1142
1143 /* Set Platform Charge Pump Freq */
1144 snd_soc_update_bits(codec, CS42L52_CHARGE_PUMP,
1145 CS42L52_CHARGE_PUMP_MASK,
1146 cs42l52->pdata.chgfreq <<
1147 CS42L52_CHARGE_PUMP_SHIFT);
1148
1149 /* Set Platform Bias Level */
1150 snd_soc_update_bits(codec, CS42L52_IFACE_CTL2,
1151 CS42L52_IFACE_CTL2_BIAS_LVL,
1152 cs42l52->pdata.micbias_lvl);
1153
1154 return ret; 1120 return ret;
1155} 1121}
1156 1122
@@ -1257,7 +1223,40 @@ static int cs42l52_i2c_probe(struct i2c_client *i2c_client,
1257 return ret; 1223 return ret;
1258 } 1224 }
1259 1225
1260 regcache_cache_only(cs42l52->regmap, true); 1226 /* Set Platform Data */
1227 if (cs42l52->pdata.mica_cfg)
1228 regmap_update_bits(cs42l52->regmap, CS42L52_MICA_CTL,
1229 CS42L52_MIC_CTL_TYPE_MASK,
1230 cs42l52->pdata.mica_cfg <<
1231 CS42L52_MIC_CTL_TYPE_SHIFT);
1232
1233 if (cs42l52->pdata.micb_cfg)
1234 regmap_update_bits(cs42l52->regmap, CS42L52_MICB_CTL,
1235 CS42L52_MIC_CTL_TYPE_MASK,
1236 cs42l52->pdata.micb_cfg <<
1237 CS42L52_MIC_CTL_TYPE_SHIFT);
1238
1239 if (cs42l52->pdata.mica_sel)
1240 regmap_update_bits(cs42l52->regmap, CS42L52_MICA_CTL,
1241 CS42L52_MIC_CTL_MIC_SEL_MASK,
1242 cs42l52->pdata.mica_sel <<
1243 CS42L52_MIC_CTL_MIC_SEL_SHIFT);
1244 if (cs42l52->pdata.micb_sel)
1245 regmap_update_bits(cs42l52->regmap, CS42L52_MICB_CTL,
1246 CS42L52_MIC_CTL_MIC_SEL_MASK,
1247 cs42l52->pdata.micb_sel <<
1248 CS42L52_MIC_CTL_MIC_SEL_SHIFT);
1249
1250 if (cs42l52->pdata.chgfreq)
1251 regmap_update_bits(cs42l52->regmap, CS42L52_CHARGE_PUMP,
1252 CS42L52_CHARGE_PUMP_MASK,
1253 cs42l52->pdata.chgfreq <<
1254 CS42L52_CHARGE_PUMP_SHIFT);
1255
1256 if (cs42l52->pdata.micbias_lvl)
1257 regmap_update_bits(cs42l52->regmap, CS42L52_IFACE_CTL2,
1258 CS42L52_IFACE_CTL2_BIAS_LVL,
1259 cs42l52->pdata.micbias_lvl);
1261 1260
1262 ret = snd_soc_register_codec(&i2c_client->dev, 1261 ret = snd_soc_register_codec(&i2c_client->dev,
1263 &soc_codec_dev_cs42l52, &cs42l52_dai, 1); 1262 &soc_codec_dev_cs42l52, &cs42l52_dai, 1);