aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ice1712/revo.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/ice1712/revo.c')
-rw-r--r--sound/pci/ice1712/revo.c68
1 files changed, 52 insertions, 16 deletions
diff --git a/sound/pci/ice1712/revo.c b/sound/pci/ice1712/revo.c
index fec9440cb310..bf98ea34feb0 100644
--- a/sound/pci/ice1712/revo.c
+++ b/sound/pci/ice1712/revo.c
@@ -87,16 +87,33 @@ 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
90static unsigned int revo71_num_stereo_front[] = {2}; 90#define AK_DAC(xname,xch) { .name = xname, .num_channels = xch }
91static char *revo71_channel_names_front[] = {"PCM Playback Volume"};
92 91
93static unsigned int revo71_num_stereo_surround[] = {1, 1, 2, 2}; 92static struct snd_akm4xxx_dac_channel revo71_front[] = {
94static 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
96static 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
97static unsigned int revo51_num_stereo[] = {2, 1, 1, 2}; 103static struct snd_akm4xxx_dac_channel revo51_dac[] = {
98static 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};
109
110static struct snd_akm4xxx_adc_channel revo51_adc[] = {
111 {
112 .name = "PCM Capture Volume",
113 .switch_name = "PCM Capture Switch",
114 .num_channels = 2
115 },
116};
100 117
101static struct snd_akm4xxx akm_revo_front __devinitdata = { 118static struct snd_akm4xxx akm_revo_front __devinitdata = {
102 .type = SND_AK4381, 119 .type = SND_AK4381,
@@ -104,8 +121,7 @@ static struct snd_akm4xxx akm_revo_front __devinitdata = {
104 .ops = { 121 .ops = {
105 .set_rate_val = revo_set_rate_val 122 .set_rate_val = revo_set_rate_val
106 }, 123 },
107 .num_stereo = revo71_num_stereo_front, 124 .dac_info = revo71_front,
108 .channel_names = revo71_channel_names_front
109}; 125};
110 126
111static struct snd_ak4xxx_private akm_revo_front_priv __devinitdata = { 127static struct snd_ak4xxx_private akm_revo_front_priv __devinitdata = {
@@ -127,8 +143,7 @@ static struct snd_akm4xxx akm_revo_surround __devinitdata = {
127 .ops = { 143 .ops = {
128 .set_rate_val = revo_set_rate_val 144 .set_rate_val = revo_set_rate_val
129 }, 145 },
130 .num_stereo = revo71_num_stereo_surround, 146 .dac_info = revo71_surround,
131 .channel_names = revo71_channel_names_surround
132}; 147};
133 148
134static struct snd_ak4xxx_private akm_revo_surround_priv __devinitdata = { 149static struct snd_ak4xxx_private akm_revo_surround_priv __devinitdata = {
@@ -149,8 +164,7 @@ static struct snd_akm4xxx akm_revo51 __devinitdata = {
149 .ops = { 164 .ops = {
150 .set_rate_val = revo_set_rate_val 165 .set_rate_val = revo_set_rate_val
151 }, 166 },
152 .num_stereo = revo51_num_stereo, 167 .dac_info = revo51_dac,
153 .channel_names = revo51_channel_names
154}; 168};
155 169
156static struct snd_ak4xxx_private akm_revo51_priv __devinitdata = { 170static struct snd_ak4xxx_private akm_revo51_priv __devinitdata = {
@@ -159,7 +173,25 @@ static struct snd_ak4xxx_private akm_revo51_priv __devinitdata = {
159 .data_mask = VT1724_REVO_CDOUT, 173 .data_mask = VT1724_REVO_CDOUT,
160 .clk_mask = VT1724_REVO_CCLK, 174 .clk_mask = VT1724_REVO_CCLK,
161 .cs_mask = VT1724_REVO_CS0 | VT1724_REVO_CS1 | VT1724_REVO_CS2, 175 .cs_mask = VT1724_REVO_CS0 | VT1724_REVO_CS1 | VT1724_REVO_CS2,
162 .cs_addr = 0, 176 .cs_addr = VT1724_REVO_CS1 | VT1724_REVO_CS2,
177 .cs_none = VT1724_REVO_CS0 | VT1724_REVO_CS1 | VT1724_REVO_CS2,
178 .add_flags = VT1724_REVO_CCLK, /* high at init */
179 .mask_flags = 0,
180};
181
182static struct snd_akm4xxx akm_revo51_adc __devinitdata = {
183 .type = SND_AK5365,
184 .num_adcs = 2,
185 .adc_info = revo51_adc,
186};
187
188static struct snd_ak4xxx_private akm_revo51_adc_priv __devinitdata = {
189 .caddr = 2,
190 .cif = 0,
191 .data_mask = VT1724_REVO_CDOUT,
192 .clk_mask = VT1724_REVO_CCLK,
193 .cs_mask = VT1724_REVO_CS0 | VT1724_REVO_CS1 | VT1724_REVO_CS2,
194 .cs_addr = VT1724_REVO_CS0 | VT1724_REVO_CS2,
163 .cs_none = VT1724_REVO_CS0 | VT1724_REVO_CS1 | VT1724_REVO_CS2, 195 .cs_none = VT1724_REVO_CS0 | VT1724_REVO_CS1 | VT1724_REVO_CS2,
164 .add_flags = VT1724_REVO_CCLK, /* high at init */ 196 .add_flags = VT1724_REVO_CCLK, /* high at init */
165 .mask_flags = 0, 197 .mask_flags = 0,
@@ -202,9 +234,13 @@ static int __devinit revo_init(struct snd_ice1712 *ice)
202 snd_ice1712_gpio_write_bits(ice, VT1724_REVO_MUTE, VT1724_REVO_MUTE); 234 snd_ice1712_gpio_write_bits(ice, VT1724_REVO_MUTE, VT1724_REVO_MUTE);
203 break; 235 break;
204 case VT1724_SUBDEVICE_REVOLUTION51: 236 case VT1724_SUBDEVICE_REVOLUTION51:
205 ice->akm_codecs = 1; 237 ice->akm_codecs = 2;
206 if ((err = snd_ice1712_akm4xxx_init(ak, &akm_revo51, &akm_revo51_priv, ice)) < 0) 238 if ((err = snd_ice1712_akm4xxx_init(ak, &akm_revo51, &akm_revo51_priv, ice)) < 0)
207 return err; 239 return err;
240 err = snd_ice1712_akm4xxx_init(ak + 1, &akm_revo51_adc,
241 &akm_revo51_adc_priv, ice);
242 if (err < 0)
243 return err;
208 /* unmute all codecs - needed! */ 244 /* unmute all codecs - needed! */
209 snd_ice1712_gpio_write_bits(ice, VT1724_REVO_MUTE, VT1724_REVO_MUTE); 245 snd_ice1712_gpio_write_bits(ice, VT1724_REVO_MUTE, VT1724_REVO_MUTE);
210 break; 246 break;