diff options
author | Brian Austin <brian.austin@cirrus.com> | 2013-10-25 11:01:16 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-10-25 11:37:58 -0400 |
commit | 153723f6f1d13e7b9541b425ebdbaead4cc85346 (patch) | |
tree | 0f720d5f399a043668c0f095567e29d4f32cb79a /sound/soc | |
parent | 6dd17757927ba9d23c604fee6fe72b4755c7ea7f (diff) |
ASoC: cs42l52: convert pdata config to regmap_update_bits
Moving platform data to bus probe and convert to regmap_update_bits.
This will work nicer when converted to device tree instead of having it
split into multiple probes
Signed-off-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/codecs/cs42l52.c | 69 |
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); |