aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/cs42l73.c
diff options
context:
space:
mode:
authorBrian Austin <brian.austin@cirrus.com>2013-10-17 12:03:34 -0400
committerMark Brown <broonie@linaro.org>2013-10-17 19:37:29 -0400
commitf9ca060680e7c26a88d990ad9370572274b0d54b (patch)
tree6ed33bd02e7f60e259645ed2facdeb460ff0569e /sound/soc/codecs/cs42l73.c
parent3d8c8bc0250f7cb11f887691b7473b51adcd2bcb (diff)
ASoC: cs42l73: Namespace defines for cs42l73 codec
Cleanup to namespace the defines for the cs42l73 driver Signed-off-by: Brian Austin <brian.austin@cirrus.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/codecs/cs42l73.c')
-rw-r--r--sound/soc/codecs/cs42l73.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/sound/soc/codecs/cs42l73.c b/sound/soc/codecs/cs42l73.c
index db9d39604d68..89efc3c6aefc 100644
--- a/sound/soc/codecs/cs42l73.c
+++ b/sound/soc/codecs/cs42l73.c
@@ -1047,11 +1047,11 @@ static int cs42l73_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
1047 1047
1048 switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { 1048 switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
1049 case SND_SOC_DAIFMT_CBM_CFM: 1049 case SND_SOC_DAIFMT_CBM_CFM:
1050 mmcc |= MS_MASTER; 1050 mmcc |= CS42L73_MS_MASTER;
1051 break; 1051 break;
1052 1052
1053 case SND_SOC_DAIFMT_CBS_CFS: 1053 case SND_SOC_DAIFMT_CBS_CFS:
1054 mmcc &= ~MS_MASTER; 1054 mmcc &= ~CS42L73_MS_MASTER;
1055 break; 1055 break;
1056 1056
1057 default: 1057 default:
@@ -1063,11 +1063,11 @@ static int cs42l73_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
1063 1063
1064 switch (format) { 1064 switch (format) {
1065 case SND_SOC_DAIFMT_I2S: 1065 case SND_SOC_DAIFMT_I2S:
1066 spc &= ~SPDIF_PCM; 1066 spc &= ~CS42L73_SPDIF_PCM;
1067 break; 1067 break;
1068 case SND_SOC_DAIFMT_DSP_A: 1068 case SND_SOC_DAIFMT_DSP_A:
1069 case SND_SOC_DAIFMT_DSP_B: 1069 case SND_SOC_DAIFMT_DSP_B:
1070 if (mmcc & MS_MASTER) { 1070 if (mmcc & CS42L73_MS_MASTER) {
1071 dev_err(codec->dev, 1071 dev_err(codec->dev,
1072 "PCM format in slave mode only\n"); 1072 "PCM format in slave mode only\n");
1073 return -EINVAL; 1073 return -EINVAL;
@@ -1077,25 +1077,25 @@ static int cs42l73_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
1077 "PCM format is not supported on ASP port\n"); 1077 "PCM format is not supported on ASP port\n");
1078 return -EINVAL; 1078 return -EINVAL;
1079 } 1079 }
1080 spc |= SPDIF_PCM; 1080 spc |= CS42L73_SPDIF_PCM;
1081 break; 1081 break;
1082 default: 1082 default:
1083 return -EINVAL; 1083 return -EINVAL;
1084 } 1084 }
1085 1085
1086 if (spc & SPDIF_PCM) { 1086 if (spc & CS42L73_SPDIF_PCM) {
1087 /* Clear PCM mode, clear PCM_BIT_ORDER bit for MSB->LSB */ 1087 /* Clear PCM mode, clear PCM_BIT_ORDER bit for MSB->LSB */
1088 spc &= ~(PCM_MODE_MASK | PCM_BIT_ORDER); 1088 spc &= ~(CS42L73_PCM_MODE_MASK | CS42L73_PCM_BIT_ORDER);
1089 switch (format) { 1089 switch (format) {
1090 case SND_SOC_DAIFMT_DSP_B: 1090 case SND_SOC_DAIFMT_DSP_B:
1091 if (inv == SND_SOC_DAIFMT_IB_IF) 1091 if (inv == SND_SOC_DAIFMT_IB_IF)
1092 spc |= PCM_MODE0; 1092 spc |= CS42L73_PCM_MODE0;
1093 if (inv == SND_SOC_DAIFMT_IB_NF) 1093 if (inv == SND_SOC_DAIFMT_IB_NF)
1094 spc |= PCM_MODE1; 1094 spc |= CS42L73_PCM_MODE1;
1095 break; 1095 break;
1096 case SND_SOC_DAIFMT_DSP_A: 1096 case SND_SOC_DAIFMT_DSP_A:
1097 if (inv == SND_SOC_DAIFMT_IB_IF) 1097 if (inv == SND_SOC_DAIFMT_IB_IF)
1098 spc |= PCM_MODE1; 1098 spc |= CS42L73_PCM_MODE1;
1099 break; 1099 break;
1100 default: 1100 default:
1101 return -EINVAL; 1101 return -EINVAL;
@@ -1155,7 +1155,7 @@ static int cs42l73_pcm_hw_params(struct snd_pcm_substream *substream,
1155 int mclk_coeff; 1155 int mclk_coeff;
1156 int srate = params_rate(params); 1156 int srate = params_rate(params);
1157 1157
1158 if (priv->config[id].mmcc & MS_MASTER) { 1158 if (priv->config[id].mmcc & CS42L73_MS_MASTER) {
1159 /* CS42L73 Master */ 1159 /* CS42L73 Master */
1160 /* MCLK -> srate */ 1160 /* MCLK -> srate */
1161 mclk_coeff = 1161 mclk_coeff =
@@ -1174,13 +1174,13 @@ static int cs42l73_pcm_hw_params(struct snd_pcm_substream *substream,
1174 priv->config[id].spc &= 0xFC; 1174 priv->config[id].spc &= 0xFC;
1175 /* Use SCLK=64*Fs if internal MCLK >= 6.4MHz */ 1175 /* Use SCLK=64*Fs if internal MCLK >= 6.4MHz */
1176 if (priv->mclk >= 6400000) 1176 if (priv->mclk >= 6400000)
1177 priv->config[id].spc |= MCK_SCLK_64FS; 1177 priv->config[id].spc |= CS42L73_MCK_SCLK_64FS;
1178 else 1178 else
1179 priv->config[id].spc |= MCK_SCLK_MCLK; 1179 priv->config[id].spc |= CS42L73_MCK_SCLK_MCLK;
1180 } else { 1180 } else {
1181 /* CS42L73 Slave */ 1181 /* CS42L73 Slave */
1182 priv->config[id].spc &= 0xFC; 1182 priv->config[id].spc &= 0xFC;
1183 priv->config[id].spc |= MCK_SCLK_64FS; 1183 priv->config[id].spc |= CS42L73_MCK_SCLK_64FS;
1184 } 1184 }
1185 /* Update ASRCs */ 1185 /* Update ASRCs */
1186 priv->config[id].srate = srate; 1186 priv->config[id].srate = srate;
@@ -1200,8 +1200,8 @@ static int cs42l73_set_bias_level(struct snd_soc_codec *codec,
1200 1200
1201 switch (level) { 1201 switch (level) {
1202 case SND_SOC_BIAS_ON: 1202 case SND_SOC_BIAS_ON:
1203 snd_soc_update_bits(codec, CS42L73_DMMCC, MCLKDIS, 0); 1203 snd_soc_update_bits(codec, CS42L73_DMMCC, CS42L73_MCLKDIS, 0);
1204 snd_soc_update_bits(codec, CS42L73_PWRCTL1, PDN, 0); 1204 snd_soc_update_bits(codec, CS42L73_PWRCTL1, CS42L73_PDN, 0);
1205 break; 1205 break;
1206 1206
1207 case SND_SOC_BIAS_PREPARE: 1207 case SND_SOC_BIAS_PREPARE:
@@ -1212,11 +1212,11 @@ static int cs42l73_set_bias_level(struct snd_soc_codec *codec,
1212 regcache_cache_only(cs42l73->regmap, false); 1212 regcache_cache_only(cs42l73->regmap, false);
1213 regcache_sync(cs42l73->regmap); 1213 regcache_sync(cs42l73->regmap);
1214 } 1214 }
1215 snd_soc_update_bits(codec, CS42L73_PWRCTL1, PDN, 1); 1215 snd_soc_update_bits(codec, CS42L73_PWRCTL1, CS42L73_PDN, 1);
1216 break; 1216 break;
1217 1217
1218 case SND_SOC_BIAS_OFF: 1218 case SND_SOC_BIAS_OFF:
1219 snd_soc_update_bits(codec, CS42L73_PWRCTL1, PDN, 1); 1219 snd_soc_update_bits(codec, CS42L73_PWRCTL1, CS42L73_PDN, 1);
1220 if (cs42l73->shutdwn_delay > 0) { 1220 if (cs42l73->shutdwn_delay > 0) {
1221 mdelay(cs42l73->shutdwn_delay); 1221 mdelay(cs42l73->shutdwn_delay);
1222 cs42l73->shutdwn_delay = 0; 1222 cs42l73->shutdwn_delay = 0;
@@ -1225,7 +1225,7 @@ static int cs42l73_set_bias_level(struct snd_soc_codec *codec,
1225 * down. 1225 * down.
1226 */ 1226 */
1227 } 1227 }
1228 snd_soc_update_bits(codec, CS42L73_DMMCC, MCLKDIS, 1); 1228 snd_soc_update_bits(codec, CS42L73_DMMCC, CS42L73_MCLKDIS, 1);
1229 break; 1229 break;
1230 } 1230 }
1231 codec->dapm.bias_level = level; 1231 codec->dapm.bias_level = level;