diff options
Diffstat (limited to 'sound/soc/codecs/tlv320dac33.c')
-rw-r--r-- | sound/soc/codecs/tlv320dac33.c | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/sound/soc/codecs/tlv320dac33.c b/sound/soc/codecs/tlv320dac33.c index 4f358393d6d6..6bfc8a17331b 100644 --- a/sound/soc/codecs/tlv320dac33.c +++ b/sound/soc/codecs/tlv320dac33.c | |||
@@ -122,7 +122,6 @@ struct tlv320dac33_priv { | |||
122 | unsigned int uthr; | 122 | unsigned int uthr; |
123 | 123 | ||
124 | enum dac33_state state; | 124 | enum dac33_state state; |
125 | enum snd_soc_control_type control_type; | ||
126 | void *control_data; | 125 | void *control_data; |
127 | }; | 126 | }; |
128 | 127 | ||
@@ -461,7 +460,7 @@ static int dac33_set_fifo_mode(struct snd_kcontrol *kcontrol, | |||
461 | if (dac33->fifo_mode == ucontrol->value.integer.value[0]) | 460 | if (dac33->fifo_mode == ucontrol->value.integer.value[0]) |
462 | return 0; | 461 | return 0; |
463 | /* Do not allow changes while stream is running*/ | 462 | /* Do not allow changes while stream is running*/ |
464 | if (codec->active) | 463 | if (snd_soc_codec_is_active(codec)) |
465 | return -EPERM; | 464 | return -EPERM; |
466 | 465 | ||
467 | if (ucontrol->value.integer.value[0] < 0 || | 466 | if (ucontrol->value.integer.value[0] < 0 || |
@@ -478,9 +477,7 @@ static const char *dac33_fifo_mode_texts[] = { | |||
478 | "Bypass", "Mode 1", "Mode 7" | 477 | "Bypass", "Mode 1", "Mode 7" |
479 | }; | 478 | }; |
480 | 479 | ||
481 | static const struct soc_enum dac33_fifo_mode_enum = | 480 | static SOC_ENUM_SINGLE_EXT_DECL(dac33_fifo_mode_enum, dac33_fifo_mode_texts); |
482 | SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(dac33_fifo_mode_texts), | ||
483 | dac33_fifo_mode_texts); | ||
484 | 481 | ||
485 | /* L/R Line Output Gain */ | 482 | /* L/R Line Output Gain */ |
486 | static const char *lr_lineout_gain_texts[] = { | 483 | static const char *lr_lineout_gain_texts[] = { |
@@ -488,15 +485,13 @@ static const char *lr_lineout_gain_texts[] = { | |||
488 | "Line 0dB DAC 12dB", "Line 6dB DAC 18dB", | 485 | "Line 0dB DAC 12dB", "Line 6dB DAC 18dB", |
489 | }; | 486 | }; |
490 | 487 | ||
491 | static const struct soc_enum l_lineout_gain_enum = | 488 | static SOC_ENUM_SINGLE_DECL(l_lineout_gain_enum, |
492 | SOC_ENUM_SINGLE(DAC33_LDAC_PWR_CTRL, 0, | 489 | DAC33_LDAC_PWR_CTRL, 0, |
493 | ARRAY_SIZE(lr_lineout_gain_texts), | 490 | lr_lineout_gain_texts); |
494 | lr_lineout_gain_texts); | ||
495 | 491 | ||
496 | static const struct soc_enum r_lineout_gain_enum = | 492 | static SOC_ENUM_SINGLE_DECL(r_lineout_gain_enum, |
497 | SOC_ENUM_SINGLE(DAC33_RDAC_PWR_CTRL, 0, | 493 | DAC33_RDAC_PWR_CTRL, 0, |
498 | ARRAY_SIZE(lr_lineout_gain_texts), | 494 | lr_lineout_gain_texts); |
499 | lr_lineout_gain_texts); | ||
500 | 495 | ||
501 | /* | 496 | /* |
502 | * DACL/R digital volume control: | 497 | * DACL/R digital volume control: |
@@ -534,18 +529,16 @@ static const struct snd_kcontrol_new dac33_dapm_abypassr_control = | |||
534 | /* LOP L/R invert selection */ | 529 | /* LOP L/R invert selection */ |
535 | static const char *dac33_lr_lom_texts[] = {"DAC", "LOP"}; | 530 | static const char *dac33_lr_lom_texts[] = {"DAC", "LOP"}; |
536 | 531 | ||
537 | static const struct soc_enum dac33_left_lom_enum = | 532 | static SOC_ENUM_SINGLE_DECL(dac33_left_lom_enum, |
538 | SOC_ENUM_SINGLE(DAC33_OUT_AMP_CTRL, 3, | 533 | DAC33_OUT_AMP_CTRL, 3, |
539 | ARRAY_SIZE(dac33_lr_lom_texts), | 534 | dac33_lr_lom_texts); |
540 | dac33_lr_lom_texts); | ||
541 | 535 | ||
542 | static const struct snd_kcontrol_new dac33_dapm_left_lom_control = | 536 | static const struct snd_kcontrol_new dac33_dapm_left_lom_control = |
543 | SOC_DAPM_ENUM("Route", dac33_left_lom_enum); | 537 | SOC_DAPM_ENUM("Route", dac33_left_lom_enum); |
544 | 538 | ||
545 | static const struct soc_enum dac33_right_lom_enum = | 539 | static SOC_ENUM_SINGLE_DECL(dac33_right_lom_enum, |
546 | SOC_ENUM_SINGLE(DAC33_OUT_AMP_CTRL, 2, | 540 | DAC33_OUT_AMP_CTRL, 2, |
547 | ARRAY_SIZE(dac33_lr_lom_texts), | 541 | dac33_lr_lom_texts); |
548 | dac33_lr_lom_texts); | ||
549 | 542 | ||
550 | static const struct snd_kcontrol_new dac33_dapm_right_lom_control = | 543 | static const struct snd_kcontrol_new dac33_dapm_right_lom_control = |
551 | SOC_DAPM_ENUM("Route", dac33_right_lom_enum); | 544 | SOC_DAPM_ENUM("Route", dac33_right_lom_enum); |