aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/tlv320aic32x4.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/tlv320aic32x4.c')
-rw-r--r--sound/soc/codecs/tlv320aic32x4.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c
index 36a9cb90a585..c541213b1edf 100644
--- a/sound/soc/codecs/tlv320aic32x4.c
+++ b/sound/soc/codecs/tlv320aic32x4.c
@@ -68,18 +68,24 @@ struct aic32x4_priv {
68 int rstn_gpio; 68 int rstn_gpio;
69}; 69};
70 70
71/* 0dB min, 1dB steps */
72static DECLARE_TLV_DB_SCALE(tlv_step_1, 0, 100, 0);
73/* 0dB min, 0.5dB steps */ 71/* 0dB min, 0.5dB steps */
74static DECLARE_TLV_DB_SCALE(tlv_step_0_5, 0, 50, 0); 72static DECLARE_TLV_DB_SCALE(tlv_step_0_5, 0, 50, 0);
73/* -63.5dB min, 0.5dB steps */
74static DECLARE_TLV_DB_SCALE(tlv_pcm, -6350, 50, 0);
75/* -6dB min, 1dB steps */
76static DECLARE_TLV_DB_SCALE(tlv_driver_gain, -600, 100, 0);
77/* -12dB min, 0.5dB steps */
78static DECLARE_TLV_DB_SCALE(tlv_adc_vol, -1200, 50, 0);
75 79
76static const struct snd_kcontrol_new aic32x4_snd_controls[] = { 80static const struct snd_kcontrol_new aic32x4_snd_controls[] = {
77 SOC_DOUBLE_R_TLV("PCM Playback Volume", AIC32X4_LDACVOL, 81 SOC_DOUBLE_R_S_TLV("PCM Playback Volume", AIC32X4_LDACVOL,
78 AIC32X4_RDACVOL, 0, 0x30, 0, tlv_step_0_5), 82 AIC32X4_RDACVOL, 0, -0x7f, 0x30, 7, 0, tlv_pcm),
79 SOC_DOUBLE_R_TLV("HP Driver Gain Volume", AIC32X4_HPLGAIN, 83 SOC_DOUBLE_R_S_TLV("HP Driver Gain Volume", AIC32X4_HPLGAIN,
80 AIC32X4_HPRGAIN, 0, 0x1D, 0, tlv_step_1), 84 AIC32X4_HPRGAIN, 0, -0x6, 0x1d, 5, 0,
81 SOC_DOUBLE_R_TLV("LO Driver Gain Volume", AIC32X4_LOLGAIN, 85 tlv_driver_gain),
82 AIC32X4_LORGAIN, 0, 0x1D, 0, tlv_step_1), 86 SOC_DOUBLE_R_S_TLV("LO Driver Gain Volume", AIC32X4_LOLGAIN,
87 AIC32X4_LORGAIN, 0, -0x6, 0x1d, 5, 0,
88 tlv_driver_gain),
83 SOC_DOUBLE_R("HP DAC Playback Switch", AIC32X4_HPLGAIN, 89 SOC_DOUBLE_R("HP DAC Playback Switch", AIC32X4_HPLGAIN,
84 AIC32X4_HPRGAIN, 6, 0x01, 1), 90 AIC32X4_HPRGAIN, 6, 0x01, 1),
85 SOC_DOUBLE_R("LO DAC Playback Switch", AIC32X4_LOLGAIN, 91 SOC_DOUBLE_R("LO DAC Playback Switch", AIC32X4_LOLGAIN,
@@ -90,8 +96,8 @@ static const struct snd_kcontrol_new aic32x4_snd_controls[] = {
90 SOC_SINGLE("ADCFGA Left Mute Switch", AIC32X4_ADCFGA, 7, 1, 0), 96 SOC_SINGLE("ADCFGA Left Mute Switch", AIC32X4_ADCFGA, 7, 1, 0),
91 SOC_SINGLE("ADCFGA Right Mute Switch", AIC32X4_ADCFGA, 3, 1, 0), 97 SOC_SINGLE("ADCFGA Right Mute Switch", AIC32X4_ADCFGA, 3, 1, 0),
92 98
93 SOC_DOUBLE_R_TLV("ADC Level Volume", AIC32X4_LADCVOL, 99 SOC_DOUBLE_R_S_TLV("ADC Level Volume", AIC32X4_LADCVOL,
94 AIC32X4_RADCVOL, 0, 0x28, 0, tlv_step_0_5), 100 AIC32X4_RADCVOL, 0, -0x18, 0x28, 6, 0, tlv_adc_vol),
95 SOC_DOUBLE_R_TLV("PGA Level Volume", AIC32X4_LMICPGAVOL, 101 SOC_DOUBLE_R_TLV("PGA Level Volume", AIC32X4_LMICPGAVOL,
96 AIC32X4_RMICPGAVOL, 0, 0x5f, 0, tlv_step_0_5), 102 AIC32X4_RMICPGAVOL, 0, 0x5f, 0, tlv_step_0_5),
97 103