diff options
author | Takashi Iwai <tiwai@suse.de> | 2006-08-30 10:49:54 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-09-23 04:45:08 -0400 |
commit | 723b2b0d36fa7cea81a962af2d40d88520d5a5f1 (patch) | |
tree | 0020b109e0792aba552c99cff7b6576b81a5c2b6 /sound/pci/ice1712 | |
parent | d0ae48471570c680333cbe28c143bbab887a4ec2 (diff) |
[ALSA] Clean up and add TLV support to AK4xxx i2c driver
- Clean up the code in AK4xxx-ADDA i2c code.
- Fix capture gain controls for AK5365
- Changed the static table for DAC/ADC mixer labels to use
structs
- Implemented TLV entries for each AK codec
The volumes in AK4524, AK4528 and AK5365 are corrected with
a table to be suitable for dB conversion.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci/ice1712')
-rw-r--r-- | sound/pci/ice1712/revo.c | 47 |
1 files changed, 29 insertions, 18 deletions
diff --git a/sound/pci/ice1712/revo.c b/sound/pci/ice1712/revo.c index 1134a57f9e65..c9eefa9bbfff 100644 --- a/sound/pci/ice1712/revo.c +++ b/sound/pci/ice1712/revo.c | |||
@@ -87,19 +87,34 @@ static void revo_set_rate_val(struct snd_akm4xxx *ak, unsigned int rate) | |||
87 | * initialize the chips on M-Audio Revolution cards | 87 | * initialize the chips on M-Audio Revolution cards |
88 | */ | 88 | */ |
89 | 89 | ||
90 | static unsigned int revo71_num_stereo_front[] = {2}; | 90 | #define AK_DAC(xname,xch) { .name = xname, .num_channels = xch } |
91 | static char *revo71_channel_names_front[] = {"PCM Playback Volume"}; | ||
92 | 91 | ||
93 | static unsigned int revo71_num_stereo_surround[] = {1, 1, 2, 2}; | 92 | static struct snd_akm4xxx_dac_channel revo71_front[] = { |
94 | static char *revo71_channel_names_surround[] = {"PCM Center Playback Volume", "PCM LFE Playback Volume", | 93 | AK_DAC("PCM Playback Volume", 2) |
95 | "PCM Side Playback Volume", "PCM Rear Playback Volume"}; | 94 | }; |
95 | |||
96 | static struct snd_akm4xxx_dac_channel revo71_surround[] = { | ||
97 | AK_DAC("PCM Center Playback Volume", 1), | ||
98 | AK_DAC("PCM LFE Playback Volume", 1), | ||
99 | AK_DAC("PCM Side Playback Volume", 2), | ||
100 | AK_DAC("PCM Rear Playback Volume", 2), | ||
101 | }; | ||
96 | 102 | ||
97 | static unsigned int revo51_num_stereo[] = {2, 1, 1, 2}; | 103 | static struct snd_akm4xxx_dac_channel revo51_dac[] = { |
98 | static char *revo51_channel_names[] = {"PCM Playback Volume", "PCM Center Playback Volume", | 104 | AK_DAC("PCM Playback Volume", 2), |
99 | "PCM LFE Playback Volume", "PCM Rear Playback Volume"}; | 105 | AK_DAC("PCM Center Playback Volume", 1), |
106 | AK_DAC("PCM LFE Playback Volume", 1), | ||
107 | AK_DAC("PCM Rear Playback Volume", 2), | ||
108 | }; | ||
100 | 109 | ||
101 | static unsigned int revo51_adc_num_stereo[] = {2}; | 110 | static struct snd_akm4xxx_adc_channel revo51_adc[] = { |
102 | static char *revo51_adc_channel_names[] = {"PCM Capture Volume","PCM Capture Switch"}; | 111 | { |
112 | .name = "PCM Capture Volume", | ||
113 | .gain_name = "PCM Capture Gain Volume", | ||
114 | .switch_name = "PCM Capture Switch", | ||
115 | .num_channels = 2 | ||
116 | }, | ||
117 | }; | ||
103 | 118 | ||
104 | static struct snd_akm4xxx akm_revo_front __devinitdata = { | 119 | static struct snd_akm4xxx akm_revo_front __devinitdata = { |
105 | .type = SND_AK4381, | 120 | .type = SND_AK4381, |
@@ -107,8 +122,7 @@ static struct snd_akm4xxx akm_revo_front __devinitdata = { | |||
107 | .ops = { | 122 | .ops = { |
108 | .set_rate_val = revo_set_rate_val | 123 | .set_rate_val = revo_set_rate_val |
109 | }, | 124 | }, |
110 | .num_stereo = revo71_num_stereo_front, | 125 | .dac_info = revo71_front, |
111 | .channel_names = revo71_channel_names_front | ||
112 | }; | 126 | }; |
113 | 127 | ||
114 | static struct snd_ak4xxx_private akm_revo_front_priv __devinitdata = { | 128 | static struct snd_ak4xxx_private akm_revo_front_priv __devinitdata = { |
@@ -130,8 +144,7 @@ static struct snd_akm4xxx akm_revo_surround __devinitdata = { | |||
130 | .ops = { | 144 | .ops = { |
131 | .set_rate_val = revo_set_rate_val | 145 | .set_rate_val = revo_set_rate_val |
132 | }, | 146 | }, |
133 | .num_stereo = revo71_num_stereo_surround, | 147 | .dac_info = revo71_surround, |
134 | .channel_names = revo71_channel_names_surround | ||
135 | }; | 148 | }; |
136 | 149 | ||
137 | static struct snd_ak4xxx_private akm_revo_surround_priv __devinitdata = { | 150 | static struct snd_ak4xxx_private akm_revo_surround_priv __devinitdata = { |
@@ -152,8 +165,7 @@ static struct snd_akm4xxx akm_revo51 __devinitdata = { | |||
152 | .ops = { | 165 | .ops = { |
153 | .set_rate_val = revo_set_rate_val | 166 | .set_rate_val = revo_set_rate_val |
154 | }, | 167 | }, |
155 | .num_stereo = revo51_num_stereo, | 168 | .dac_info = revo51_dac, |
156 | .channel_names = revo51_channel_names | ||
157 | }; | 169 | }; |
158 | 170 | ||
159 | static struct snd_ak4xxx_private akm_revo51_priv __devinitdata = { | 171 | static struct snd_ak4xxx_private akm_revo51_priv __devinitdata = { |
@@ -171,8 +183,7 @@ static struct snd_ak4xxx_private akm_revo51_priv __devinitdata = { | |||
171 | static struct snd_akm4xxx akm_revo51_adc __devinitdata = { | 183 | static struct snd_akm4xxx akm_revo51_adc __devinitdata = { |
172 | .type = SND_AK5365, | 184 | .type = SND_AK5365, |
173 | .num_adcs = 2, | 185 | .num_adcs = 2, |
174 | .num_stereo = revo51_adc_num_stereo, | 186 | .adc_info = revo51_adc, |
175 | .channel_names = revo51_adc_channel_names | ||
176 | }; | 187 | }; |
177 | 188 | ||
178 | static struct snd_ak4xxx_private akm_revo51_adc_priv __devinitdata = { | 189 | static struct snd_ak4xxx_private akm_revo51_adc_priv __devinitdata = { |