aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/cs42l73.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/cs42l73.c')
-rw-r--r--sound/soc/codecs/cs42l73.c55
1 files changed, 26 insertions, 29 deletions
diff --git a/sound/soc/codecs/cs42l73.c b/sound/soc/codecs/cs42l73.c
index 549d5d6a3fef..06f429184821 100644
--- a/sound/soc/codecs/cs42l73.c
+++ b/sound/soc/codecs/cs42l73.c
@@ -278,13 +278,13 @@ static const DECLARE_TLV_DB_SCALE(attn_tlv, -6300, 100, 1);
278static const char * const cs42l73_pgaa_text[] = { "Line A", "Mic 1" }; 278static const char * const cs42l73_pgaa_text[] = { "Line A", "Mic 1" };
279static const char * const cs42l73_pgab_text[] = { "Line B", "Mic 2" }; 279static const char * const cs42l73_pgab_text[] = { "Line B", "Mic 2" };
280 280
281static const struct soc_enum pgaa_enum = 281static SOC_ENUM_SINGLE_DECL(pgaa_enum,
282 SOC_ENUM_SINGLE(CS42L73_ADCIPC, 3, 282 CS42L73_ADCIPC, 3,
283 ARRAY_SIZE(cs42l73_pgaa_text), cs42l73_pgaa_text); 283 cs42l73_pgaa_text);
284 284
285static const struct soc_enum pgab_enum = 285static SOC_ENUM_SINGLE_DECL(pgab_enum,
286 SOC_ENUM_SINGLE(CS42L73_ADCIPC, 7, 286 CS42L73_ADCIPC, 7,
287 ARRAY_SIZE(cs42l73_pgab_text), cs42l73_pgab_text); 287 cs42l73_pgab_text);
288 288
289static const struct snd_kcontrol_new pgaa_mux = 289static const struct snd_kcontrol_new pgaa_mux =
290 SOC_DAPM_ENUM("Left Analog Input Capture Mux", pgaa_enum); 290 SOC_DAPM_ENUM("Left Analog Input Capture Mux", pgaa_enum);
@@ -309,9 +309,9 @@ static const struct snd_kcontrol_new input_right_mixer[] = {
309static const char * const cs42l73_ng_delay_text[] = { 309static const char * const cs42l73_ng_delay_text[] = {
310 "50ms", "100ms", "150ms", "200ms" }; 310 "50ms", "100ms", "150ms", "200ms" };
311 311
312static const struct soc_enum ng_delay_enum = 312static SOC_ENUM_SINGLE_DECL(ng_delay_enum,
313 SOC_ENUM_SINGLE(CS42L73_NGCAB, 0, 313 CS42L73_NGCAB, 0,
314 ARRAY_SIZE(cs42l73_ng_delay_text), cs42l73_ng_delay_text); 314 cs42l73_ng_delay_text);
315 315
316static const char * const cs42l73_mono_mix_texts[] = { 316static const char * const cs42l73_mono_mix_texts[] = {
317 "Left", "Right", "Mono Mix"}; 317 "Left", "Right", "Mono Mix"};
@@ -357,19 +357,19 @@ static const struct snd_kcontrol_new esl_xsp_mixer =
357static const char * const cs42l73_ip_swap_text[] = { 357static const char * const cs42l73_ip_swap_text[] = {
358 "Stereo", "Mono A", "Mono B", "Swap A-B"}; 358 "Stereo", "Mono A", "Mono B", "Swap A-B"};
359 359
360static const struct soc_enum ip_swap_enum = 360static SOC_ENUM_SINGLE_DECL(ip_swap_enum,
361 SOC_ENUM_SINGLE(CS42L73_MIOPC, 6, 361 CS42L73_MIOPC, 6,
362 ARRAY_SIZE(cs42l73_ip_swap_text), cs42l73_ip_swap_text); 362 cs42l73_ip_swap_text);
363 363
364static const char * const cs42l73_spo_mixer_text[] = {"Mono", "Stereo"}; 364static const char * const cs42l73_spo_mixer_text[] = {"Mono", "Stereo"};
365 365
366static const struct soc_enum vsp_output_mux_enum = 366static SOC_ENUM_SINGLE_DECL(vsp_output_mux_enum,
367 SOC_ENUM_SINGLE(CS42L73_MIXERCTL, 5, 367 CS42L73_MIXERCTL, 5,
368 ARRAY_SIZE(cs42l73_spo_mixer_text), cs42l73_spo_mixer_text); 368 cs42l73_spo_mixer_text);
369 369
370static const struct soc_enum xsp_output_mux_enum = 370static SOC_ENUM_SINGLE_DECL(xsp_output_mux_enum,
371 SOC_ENUM_SINGLE(CS42L73_MIXERCTL, 4, 371 CS42L73_MIXERCTL, 4,
372 ARRAY_SIZE(cs42l73_spo_mixer_text), cs42l73_spo_mixer_text); 372 cs42l73_spo_mixer_text);
373 373
374static const struct snd_kcontrol_new vsp_output_mux = 374static const struct snd_kcontrol_new vsp_output_mux =
375 SOC_DAPM_ENUM("Route", vsp_output_mux_enum); 375 SOC_DAPM_ENUM("Route", vsp_output_mux_enum);
@@ -1108,7 +1108,7 @@ static int cs42l73_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
1108 return 0; 1108 return 0;
1109} 1109}
1110 1110
1111static u32 cs42l73_asrc_rates[] = { 1111static const unsigned int cs42l73_asrc_rates[] = {
1112 8000, 11025, 12000, 16000, 22050, 1112 8000, 11025, 12000, 16000, 22050,
1113 24000, 32000, 44100, 48000 1113 24000, 32000, 44100, 48000
1114}; 1114};
@@ -1241,7 +1241,7 @@ static int cs42l73_set_tristate(struct snd_soc_dai *dai, int tristate)
1241 0x7F, tristate << 7); 1241 0x7F, tristate << 7);
1242} 1242}
1243 1243
1244static struct snd_pcm_hw_constraint_list constraints_12_24 = { 1244static const struct snd_pcm_hw_constraint_list constraints_12_24 = {
1245 .count = ARRAY_SIZE(cs42l73_asrc_rates), 1245 .count = ARRAY_SIZE(cs42l73_asrc_rates),
1246 .list = cs42l73_asrc_rates, 1246 .list = cs42l73_asrc_rates,
1247}; 1247};
@@ -1255,9 +1255,6 @@ static int cs42l73_pcm_startup(struct snd_pcm_substream *substream,
1255 return 0; 1255 return 0;
1256} 1256}
1257 1257
1258/* SNDRV_PCM_RATE_KNOT -> 12000, 24000 Hz, limit with constraint list */
1259#define CS42L73_RATES (SNDRV_PCM_RATE_8000_48000 | SNDRV_PCM_RATE_KNOT)
1260
1261 1258
1262#define CS42L73_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ 1259#define CS42L73_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
1263 SNDRV_PCM_FMTBIT_S24_LE) 1260 SNDRV_PCM_FMTBIT_S24_LE)
@@ -1278,14 +1275,14 @@ static struct snd_soc_dai_driver cs42l73_dai[] = {
1278 .stream_name = "XSP Playback", 1275 .stream_name = "XSP Playback",
1279 .channels_min = 1, 1276 .channels_min = 1,
1280 .channels_max = 2, 1277 .channels_max = 2,
1281 .rates = CS42L73_RATES, 1278 .rates = SNDRV_PCM_RATE_KNOT,
1282 .formats = CS42L73_FORMATS, 1279 .formats = CS42L73_FORMATS,
1283 }, 1280 },
1284 .capture = { 1281 .capture = {
1285 .stream_name = "XSP Capture", 1282 .stream_name = "XSP Capture",
1286 .channels_min = 1, 1283 .channels_min = 1,
1287 .channels_max = 2, 1284 .channels_max = 2,
1288 .rates = CS42L73_RATES, 1285 .rates = SNDRV_PCM_RATE_KNOT,
1289 .formats = CS42L73_FORMATS, 1286 .formats = CS42L73_FORMATS,
1290 }, 1287 },
1291 .ops = &cs42l73_ops, 1288 .ops = &cs42l73_ops,
@@ -1298,14 +1295,14 @@ static struct snd_soc_dai_driver cs42l73_dai[] = {
1298 .stream_name = "ASP Playback", 1295 .stream_name = "ASP Playback",
1299 .channels_min = 2, 1296 .channels_min = 2,
1300 .channels_max = 2, 1297 .channels_max = 2,
1301 .rates = CS42L73_RATES, 1298 .rates = SNDRV_PCM_RATE_KNOT,
1302 .formats = CS42L73_FORMATS, 1299 .formats = CS42L73_FORMATS,
1303 }, 1300 },
1304 .capture = { 1301 .capture = {
1305 .stream_name = "ASP Capture", 1302 .stream_name = "ASP Capture",
1306 .channels_min = 2, 1303 .channels_min = 2,
1307 .channels_max = 2, 1304 .channels_max = 2,
1308 .rates = CS42L73_RATES, 1305 .rates = SNDRV_PCM_RATE_KNOT,
1309 .formats = CS42L73_FORMATS, 1306 .formats = CS42L73_FORMATS,
1310 }, 1307 },
1311 .ops = &cs42l73_ops, 1308 .ops = &cs42l73_ops,
@@ -1318,14 +1315,14 @@ static struct snd_soc_dai_driver cs42l73_dai[] = {
1318 .stream_name = "VSP Playback", 1315 .stream_name = "VSP Playback",
1319 .channels_min = 1, 1316 .channels_min = 1,
1320 .channels_max = 2, 1317 .channels_max = 2,
1321 .rates = CS42L73_RATES, 1318 .rates = SNDRV_PCM_RATE_KNOT,
1322 .formats = CS42L73_FORMATS, 1319 .formats = CS42L73_FORMATS,
1323 }, 1320 },
1324 .capture = { 1321 .capture = {
1325 .stream_name = "VSP Capture", 1322 .stream_name = "VSP Capture",
1326 .channels_min = 1, 1323 .channels_min = 1,
1327 .channels_max = 2, 1324 .channels_max = 2,
1328 .rates = CS42L73_RATES, 1325 .rates = SNDRV_PCM_RATE_KNOT,
1329 .formats = CS42L73_FORMATS, 1326 .formats = CS42L73_FORMATS,
1330 }, 1327 },
1331 .ops = &cs42l73_ops, 1328 .ops = &cs42l73_ops,