diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-05-29 22:54:18 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-05-29 22:54:18 -0400 |
commit | d21685ec258f803d3badae5eae821383a34815a9 (patch) | |
tree | 7ab60a2a5d557a4f345b01a79ca2f877c06d9b92 /sound/soc/codecs/max98088.c | |
parent | 74ab24af4fe165de5af01d0507250dd099f096b0 (diff) | |
parent | ea02c63d57d7ec099f66ddb2942b4022e865cd5f (diff) |
Merge branch 'for-2.6.40' into for-2.6.41
Diffstat (limited to 'sound/soc/codecs/max98088.c')
-rw-r--r-- | sound/soc/codecs/max98088.c | 62 |
1 files changed, 45 insertions, 17 deletions
diff --git a/sound/soc/codecs/max98088.c b/sound/soc/codecs/max98088.c index 93255ff48b4f..ac65a2d36408 100644 --- a/sound/soc/codecs/max98088.c +++ b/sound/soc/codecs/max98088.c | |||
@@ -656,8 +656,6 @@ static const struct soc_enum max98088_exmode_enum = | |||
656 | ARRAY_SIZE(max98088_exmode_texts), | 656 | ARRAY_SIZE(max98088_exmode_texts), |
657 | max98088_exmode_texts, | 657 | max98088_exmode_texts, |
658 | max98088_exmode_values); | 658 | max98088_exmode_values); |
659 | static const struct snd_kcontrol_new max98088_exmode_controls = | ||
660 | SOC_DAPM_VALUE_ENUM("Route", max98088_exmode_enum); | ||
661 | 659 | ||
662 | static const char *max98088_ex_thresh[] = { /* volts PP */ | 660 | static const char *max98088_ex_thresh[] = { /* volts PP */ |
663 | "0.6", "1.2", "1.8", "2.4", "3.0", "3.6", "4.2", "4.8"}; | 661 | "0.6", "1.2", "1.8", "2.4", "3.0", "3.6", "4.2", "4.8"}; |
@@ -783,6 +781,7 @@ static const struct snd_kcontrol_new max98088_snd_controls[] = { | |||
783 | SOC_SINGLE("EQ1 Switch", M98088_REG_49_CFG_LEVEL, 0, 1, 0), | 781 | SOC_SINGLE("EQ1 Switch", M98088_REG_49_CFG_LEVEL, 0, 1, 0), |
784 | SOC_SINGLE("EQ2 Switch", M98088_REG_49_CFG_LEVEL, 1, 1, 0), | 782 | SOC_SINGLE("EQ2 Switch", M98088_REG_49_CFG_LEVEL, 1, 1, 0), |
785 | 783 | ||
784 | SOC_ENUM("EX Limiter Mode", max98088_exmode_enum), | ||
786 | SOC_ENUM("EX Limiter Threshold", max98088_ex_thresh_enum), | 785 | SOC_ENUM("EX Limiter Threshold", max98088_ex_thresh_enum), |
787 | 786 | ||
788 | SOC_ENUM("DAI1 Filter Mode", max98088_filter_mode_enum), | 787 | SOC_ENUM("DAI1 Filter Mode", max98088_filter_mode_enum), |
@@ -808,10 +807,10 @@ static const struct snd_kcontrol_new max98088_snd_controls[] = { | |||
808 | 807 | ||
809 | /* Left speaker mixer switch */ | 808 | /* Left speaker mixer switch */ |
810 | static const struct snd_kcontrol_new max98088_left_speaker_mixer_controls[] = { | 809 | static const struct snd_kcontrol_new max98088_left_speaker_mixer_controls[] = { |
811 | SOC_DAPM_SINGLE("Left DAC1 Switch", M98088_REG_2B_MIX_SPK_LEFT, 7, 1, 0), | 810 | SOC_DAPM_SINGLE("Left DAC1 Switch", M98088_REG_2B_MIX_SPK_LEFT, 0, 1, 0), |
812 | SOC_DAPM_SINGLE("Right DAC1 Switch", M98088_REG_2B_MIX_SPK_LEFT, 0, 1, 0), | 811 | SOC_DAPM_SINGLE("Right DAC1 Switch", M98088_REG_2B_MIX_SPK_LEFT, 7, 1, 0), |
813 | SOC_DAPM_SINGLE("Left DAC2 Switch", M98088_REG_2B_MIX_SPK_LEFT, 7, 1, 0), | 812 | SOC_DAPM_SINGLE("Left DAC2 Switch", M98088_REG_2B_MIX_SPK_LEFT, 0, 1, 0), |
814 | SOC_DAPM_SINGLE("Right DAC2 Switch", M98088_REG_2B_MIX_SPK_LEFT, 0, 1, 0), | 813 | SOC_DAPM_SINGLE("Right DAC2 Switch", M98088_REG_2B_MIX_SPK_LEFT, 7, 1, 0), |
815 | SOC_DAPM_SINGLE("MIC1 Switch", M98088_REG_2B_MIX_SPK_LEFT, 5, 1, 0), | 814 | SOC_DAPM_SINGLE("MIC1 Switch", M98088_REG_2B_MIX_SPK_LEFT, 5, 1, 0), |
816 | SOC_DAPM_SINGLE("MIC2 Switch", M98088_REG_2B_MIX_SPK_LEFT, 6, 1, 0), | 815 | SOC_DAPM_SINGLE("MIC2 Switch", M98088_REG_2B_MIX_SPK_LEFT, 6, 1, 0), |
817 | SOC_DAPM_SINGLE("INA1 Switch", M98088_REG_2B_MIX_SPK_LEFT, 1, 1, 0), | 816 | SOC_DAPM_SINGLE("INA1 Switch", M98088_REG_2B_MIX_SPK_LEFT, 1, 1, 0), |
@@ -836,10 +835,10 @@ static const struct snd_kcontrol_new max98088_right_speaker_mixer_controls[] = { | |||
836 | 835 | ||
837 | /* Left headphone mixer switch */ | 836 | /* Left headphone mixer switch */ |
838 | static const struct snd_kcontrol_new max98088_left_hp_mixer_controls[] = { | 837 | static const struct snd_kcontrol_new max98088_left_hp_mixer_controls[] = { |
839 | SOC_DAPM_SINGLE("Left DAC1 Switch", M98088_REG_25_MIX_HP_LEFT, 7, 1, 0), | 838 | SOC_DAPM_SINGLE("Left DAC1 Switch", M98088_REG_25_MIX_HP_LEFT, 0, 1, 0), |
840 | SOC_DAPM_SINGLE("Right DAC1 Switch", M98088_REG_25_MIX_HP_LEFT, 0, 1, 0), | 839 | SOC_DAPM_SINGLE("Right DAC1 Switch", M98088_REG_25_MIX_HP_LEFT, 7, 1, 0), |
841 | SOC_DAPM_SINGLE("Left DAC2 Switch", M98088_REG_25_MIX_HP_LEFT, 7, 1, 0), | 840 | SOC_DAPM_SINGLE("Left DAC2 Switch", M98088_REG_25_MIX_HP_LEFT, 0, 1, 0), |
842 | SOC_DAPM_SINGLE("Right DAC2 Switch", M98088_REG_25_MIX_HP_LEFT, 0, 1, 0), | 841 | SOC_DAPM_SINGLE("Right DAC2 Switch", M98088_REG_25_MIX_HP_LEFT, 7, 1, 0), |
843 | SOC_DAPM_SINGLE("MIC1 Switch", M98088_REG_25_MIX_HP_LEFT, 5, 1, 0), | 842 | SOC_DAPM_SINGLE("MIC1 Switch", M98088_REG_25_MIX_HP_LEFT, 5, 1, 0), |
844 | SOC_DAPM_SINGLE("MIC2 Switch", M98088_REG_25_MIX_HP_LEFT, 6, 1, 0), | 843 | SOC_DAPM_SINGLE("MIC2 Switch", M98088_REG_25_MIX_HP_LEFT, 6, 1, 0), |
845 | SOC_DAPM_SINGLE("INA1 Switch", M98088_REG_25_MIX_HP_LEFT, 1, 1, 0), | 844 | SOC_DAPM_SINGLE("INA1 Switch", M98088_REG_25_MIX_HP_LEFT, 1, 1, 0), |
@@ -864,10 +863,10 @@ static const struct snd_kcontrol_new max98088_right_hp_mixer_controls[] = { | |||
864 | 863 | ||
865 | /* Left earpiece/receiver mixer switch */ | 864 | /* Left earpiece/receiver mixer switch */ |
866 | static const struct snd_kcontrol_new max98088_left_rec_mixer_controls[] = { | 865 | static const struct snd_kcontrol_new max98088_left_rec_mixer_controls[] = { |
867 | SOC_DAPM_SINGLE("Left DAC1 Switch", M98088_REG_28_MIX_REC_LEFT, 7, 1, 0), | 866 | SOC_DAPM_SINGLE("Left DAC1 Switch", M98088_REG_28_MIX_REC_LEFT, 0, 1, 0), |
868 | SOC_DAPM_SINGLE("Right DAC1 Switch", M98088_REG_28_MIX_REC_LEFT, 0, 1, 0), | 867 | SOC_DAPM_SINGLE("Right DAC1 Switch", M98088_REG_28_MIX_REC_LEFT, 7, 1, 0), |
869 | SOC_DAPM_SINGLE("Left DAC2 Switch", M98088_REG_28_MIX_REC_LEFT, 7, 1, 0), | 868 | SOC_DAPM_SINGLE("Left DAC2 Switch", M98088_REG_28_MIX_REC_LEFT, 0, 1, 0), |
870 | SOC_DAPM_SINGLE("Right DAC2 Switch", M98088_REG_28_MIX_REC_LEFT, 0, 1, 0), | 869 | SOC_DAPM_SINGLE("Right DAC2 Switch", M98088_REG_28_MIX_REC_LEFT, 7, 1, 0), |
871 | SOC_DAPM_SINGLE("MIC1 Switch", M98088_REG_28_MIX_REC_LEFT, 5, 1, 0), | 870 | SOC_DAPM_SINGLE("MIC1 Switch", M98088_REG_28_MIX_REC_LEFT, 5, 1, 0), |
872 | SOC_DAPM_SINGLE("MIC2 Switch", M98088_REG_28_MIX_REC_LEFT, 6, 1, 0), | 871 | SOC_DAPM_SINGLE("MIC2 Switch", M98088_REG_28_MIX_REC_LEFT, 6, 1, 0), |
873 | SOC_DAPM_SINGLE("INA1 Switch", M98088_REG_28_MIX_REC_LEFT, 1, 1, 0), | 872 | SOC_DAPM_SINGLE("INA1 Switch", M98088_REG_28_MIX_REC_LEFT, 1, 1, 0), |
@@ -1094,9 +1093,6 @@ static const struct snd_soc_dapm_widget max98088_dapm_widgets[] = { | |||
1094 | 1093 | ||
1095 | SND_SOC_DAPM_MICBIAS("MICBIAS", M98088_REG_4C_PWR_EN_IN, 3, 0), | 1094 | SND_SOC_DAPM_MICBIAS("MICBIAS", M98088_REG_4C_PWR_EN_IN, 3, 0), |
1096 | 1095 | ||
1097 | SND_SOC_DAPM_MUX("EX Limiter Mode", SND_SOC_NOPM, 0, 0, | ||
1098 | &max98088_exmode_controls), | ||
1099 | |||
1100 | SND_SOC_DAPM_OUTPUT("HPL"), | 1096 | SND_SOC_DAPM_OUTPUT("HPL"), |
1101 | SND_SOC_DAPM_OUTPUT("HPR"), | 1097 | SND_SOC_DAPM_OUTPUT("HPR"), |
1102 | SND_SOC_DAPM_OUTPUT("SPKL"), | 1098 | SND_SOC_DAPM_OUTPUT("SPKL"), |
@@ -1568,6 +1564,36 @@ static int max98088_dai2_set_fmt(struct snd_soc_dai *codec_dai, | |||
1568 | return 0; | 1564 | return 0; |
1569 | } | 1565 | } |
1570 | 1566 | ||
1567 | static int max98088_dai1_digital_mute(struct snd_soc_dai *codec_dai, int mute) | ||
1568 | { | ||
1569 | struct snd_soc_codec *codec = codec_dai->codec; | ||
1570 | int reg; | ||
1571 | |||
1572 | if (mute) | ||
1573 | reg = M98088_DAI_MUTE; | ||
1574 | else | ||
1575 | reg = 0; | ||
1576 | |||
1577 | snd_soc_update_bits(codec, M98088_REG_2F_LVL_DAI1_PLAY, | ||
1578 | M98088_DAI_MUTE_MASK, reg); | ||
1579 | return 0; | ||
1580 | } | ||
1581 | |||
1582 | static int max98088_dai2_digital_mute(struct snd_soc_dai *codec_dai, int mute) | ||
1583 | { | ||
1584 | struct snd_soc_codec *codec = codec_dai->codec; | ||
1585 | int reg; | ||
1586 | |||
1587 | if (mute) | ||
1588 | reg = M98088_DAI_MUTE; | ||
1589 | else | ||
1590 | reg = 0; | ||
1591 | |||
1592 | snd_soc_update_bits(codec, M98088_REG_31_LVL_DAI2_PLAY, | ||
1593 | M98088_DAI_MUTE_MASK, reg); | ||
1594 | return 0; | ||
1595 | } | ||
1596 | |||
1571 | static void max98088_sync_cache(struct snd_soc_codec *codec) | 1597 | static void max98088_sync_cache(struct snd_soc_codec *codec) |
1572 | { | 1598 | { |
1573 | u16 *reg_cache = codec->reg_cache; | 1599 | u16 *reg_cache = codec->reg_cache; |
@@ -1629,12 +1655,14 @@ static struct snd_soc_dai_ops max98088_dai1_ops = { | |||
1629 | .set_sysclk = max98088_dai_set_sysclk, | 1655 | .set_sysclk = max98088_dai_set_sysclk, |
1630 | .set_fmt = max98088_dai1_set_fmt, | 1656 | .set_fmt = max98088_dai1_set_fmt, |
1631 | .hw_params = max98088_dai1_hw_params, | 1657 | .hw_params = max98088_dai1_hw_params, |
1658 | .digital_mute = max98088_dai1_digital_mute, | ||
1632 | }; | 1659 | }; |
1633 | 1660 | ||
1634 | static struct snd_soc_dai_ops max98088_dai2_ops = { | 1661 | static struct snd_soc_dai_ops max98088_dai2_ops = { |
1635 | .set_sysclk = max98088_dai_set_sysclk, | 1662 | .set_sysclk = max98088_dai_set_sysclk, |
1636 | .set_fmt = max98088_dai2_set_fmt, | 1663 | .set_fmt = max98088_dai2_set_fmt, |
1637 | .hw_params = max98088_dai2_hw_params, | 1664 | .hw_params = max98088_dai2_hw_params, |
1665 | .digital_mute = max98088_dai2_digital_mute, | ||
1638 | }; | 1666 | }; |
1639 | 1667 | ||
1640 | static struct snd_soc_dai_driver max98088_dai[] = { | 1668 | static struct snd_soc_dai_driver max98088_dai[] = { |