diff options
author | Dylan Reid <dgreid@chromium.org> | 2013-02-15 11:55:10 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-03-03 22:11:11 -0500 |
commit | c751a1f49b3fbdce0fbbb2c9b56544a7e6833fff (patch) | |
tree | 57cae00b4a0f419f0b10d3c2b76b3d326003ddb7 /sound/soc/codecs/max98088.c | |
parent | 6dbe51c251a327e012439c4772097a13df43c5b8 (diff) |
ASoC: max98088: Add TLV data for volume controls.
Specify volumes as defined in the MAX98088/9 data sheet. Allows ALSA
lib snd_mixer_selem_get_playback_dB_range and related functions to
work.
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/max98088.c')
-rw-r--r-- | sound/soc/codecs/max98088.c | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/sound/soc/codecs/max98088.c b/sound/soc/codecs/max98088.c index a4c16fd70f77..3a7b7fd14e3e 100644 --- a/sound/soc/codecs/max98088.c +++ b/sound/soc/codecs/max98088.c | |||
@@ -739,14 +739,32 @@ static const unsigned int max98088_micboost_tlv[] = { | |||
739 | 2, 2, TLV_DB_SCALE_ITEM(3000, 0, 0), | 739 | 2, 2, TLV_DB_SCALE_ITEM(3000, 0, 0), |
740 | }; | 740 | }; |
741 | 741 | ||
742 | static const unsigned int max98088_hp_tlv[] = { | ||
743 | TLV_DB_RANGE_HEAD(5), | ||
744 | 0, 6, TLV_DB_SCALE_ITEM(-6700, 400, 0), | ||
745 | 7, 14, TLV_DB_SCALE_ITEM(-4000, 300, 0), | ||
746 | 15, 21, TLV_DB_SCALE_ITEM(-1700, 200, 0), | ||
747 | 22, 27, TLV_DB_SCALE_ITEM(-400, 100, 0), | ||
748 | 28, 31, TLV_DB_SCALE_ITEM(150, 50, 0), | ||
749 | }; | ||
750 | |||
751 | static const unsigned int max98088_spk_tlv[] = { | ||
752 | TLV_DB_RANGE_HEAD(5), | ||
753 | 0, 6, TLV_DB_SCALE_ITEM(-6200, 400, 0), | ||
754 | 7, 14, TLV_DB_SCALE_ITEM(-3500, 300, 0), | ||
755 | 15, 21, TLV_DB_SCALE_ITEM(-1200, 200, 0), | ||
756 | 22, 27, TLV_DB_SCALE_ITEM(100, 100, 0), | ||
757 | 28, 31, TLV_DB_SCALE_ITEM(650, 50, 0), | ||
758 | }; | ||
759 | |||
742 | static const struct snd_kcontrol_new max98088_snd_controls[] = { | 760 | static const struct snd_kcontrol_new max98088_snd_controls[] = { |
743 | 761 | ||
744 | SOC_DOUBLE_R("Headphone Volume", M98088_REG_39_LVL_HP_L, | 762 | SOC_DOUBLE_R_TLV("Headphone Volume", M98088_REG_39_LVL_HP_L, |
745 | M98088_REG_3A_LVL_HP_R, 0, 31, 0), | 763 | M98088_REG_3A_LVL_HP_R, 0, 31, 0, max98088_hp_tlv), |
746 | SOC_DOUBLE_R("Speaker Volume", M98088_REG_3D_LVL_SPK_L, | 764 | SOC_DOUBLE_R_TLV("Speaker Volume", M98088_REG_3D_LVL_SPK_L, |
747 | M98088_REG_3E_LVL_SPK_R, 0, 31, 0), | 765 | M98088_REG_3E_LVL_SPK_R, 0, 31, 0, max98088_spk_tlv), |
748 | SOC_DOUBLE_R("Receiver Volume", M98088_REG_3B_LVL_REC_L, | 766 | SOC_DOUBLE_R_TLV("Receiver Volume", M98088_REG_3B_LVL_REC_L, |
749 | M98088_REG_3C_LVL_REC_R, 0, 31, 0), | 767 | M98088_REG_3C_LVL_REC_R, 0, 31, 0, max98088_spk_tlv), |
750 | 768 | ||
751 | SOC_DOUBLE_R("Headphone Switch", M98088_REG_39_LVL_HP_L, | 769 | SOC_DOUBLE_R("Headphone Switch", M98088_REG_39_LVL_HP_L, |
752 | M98088_REG_3A_LVL_HP_R, 7, 1, 1), | 770 | M98088_REG_3A_LVL_HP_R, 7, 1, 1), |