Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * ALSA driver for ICEnsemble ICE1712 (Envy24) |
| 3 | * |
| 4 | * Lowlevel functions for M-Audio Revolution 7.1 |
| 5 | * |
| 6 | * Copyright (c) 2003 Takashi Iwai <tiwai@suse.de> |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by |
| 10 | * the Free Software Foundation; either version 2 of the License, or |
| 11 | * (at your option) any later version. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | * GNU General Public License for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program; if not, write to the Free Software |
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 21 | * |
| 22 | */ |
| 23 | |
| 24 | #include <sound/driver.h> |
| 25 | #include <asm/io.h> |
| 26 | #include <linux/delay.h> |
| 27 | #include <linux/interrupt.h> |
| 28 | #include <linux/init.h> |
| 29 | #include <linux/slab.h> |
| 30 | #include <sound/core.h> |
| 31 | |
| 32 | #include "ice1712.h" |
| 33 | #include "envy24ht.h" |
| 34 | #include "revo.h" |
| 35 | |
Takashi Iwai | ab0c7d7 | 2005-11-17 15:00:18 +0100 | [diff] [blame] | 36 | static void revo_i2s_mclk_changed(struct snd_ice1712 *ice) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | { |
| 38 | /* assert PRST# to converters; MT05 bit 7 */ |
| 39 | outb(inb(ICEMT1724(ice, AC97_CMD)) | 0x80, ICEMT1724(ice, AC97_CMD)); |
| 40 | mdelay(5); |
| 41 | /* deassert PRST# */ |
| 42 | outb(inb(ICEMT1724(ice, AC97_CMD)) & ~0x80, ICEMT1724(ice, AC97_CMD)); |
| 43 | } |
| 44 | |
| 45 | /* |
| 46 | * change the rate of envy24HT, AK4355 and AK4381 |
| 47 | */ |
Takashi Iwai | ab0c7d7 | 2005-11-17 15:00:18 +0100 | [diff] [blame] | 48 | static void revo_set_rate_val(struct snd_akm4xxx *ak, unsigned int rate) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 49 | { |
| 50 | unsigned char old, tmp, dfs; |
| 51 | int reg, shift; |
| 52 | |
| 53 | if (rate == 0) /* no hint - S/PDIF input is master, simply return */ |
| 54 | return; |
| 55 | |
| 56 | /* adjust DFS on codecs */ |
| 57 | if (rate > 96000) |
| 58 | dfs = 2; |
| 59 | else if (rate > 48000) |
| 60 | dfs = 1; |
| 61 | else |
| 62 | dfs = 0; |
| 63 | |
Takashi Iwai | 59acf76 | 2005-12-05 19:22:34 +0100 | [diff] [blame] | 64 | if (ak->type == SND_AK4355 || ak->type == SND_AK4358) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 65 | reg = 2; |
| 66 | shift = 4; |
| 67 | } else { |
| 68 | reg = 1; |
| 69 | shift = 3; |
| 70 | } |
| 71 | tmp = snd_akm4xxx_get(ak, 0, reg); |
| 72 | old = (tmp >> shift) & 0x03; |
| 73 | if (old == dfs) |
| 74 | return; |
| 75 | |
| 76 | /* reset DFS */ |
| 77 | snd_akm4xxx_reset(ak, 1); |
| 78 | tmp = snd_akm4xxx_get(ak, 0, reg); |
| 79 | tmp &= ~(0x03 << shift); |
| 80 | tmp |= dfs << shift; |
| 81 | // snd_akm4xxx_write(ak, 0, reg, tmp); |
| 82 | snd_akm4xxx_set(ak, 0, reg, tmp); /* the value is written in reset(0) */ |
| 83 | snd_akm4xxx_reset(ak, 0); |
| 84 | } |
| 85 | |
| 86 | /* |
Jochen Voss | feaa6a7 | 2006-10-04 18:08:43 +0200 | [diff] [blame] | 87 | * I2C access to the PT2258 volume controller on GPIO 6/7 (Revolution 5.1) |
| 88 | */ |
| 89 | |
| 90 | static void revo_i2c_start(struct snd_i2c_bus *bus) |
| 91 | { |
| 92 | struct snd_ice1712 *ice = bus->private_data; |
| 93 | snd_ice1712_save_gpio_status(ice); |
| 94 | } |
| 95 | |
| 96 | static void revo_i2c_stop(struct snd_i2c_bus *bus) |
| 97 | { |
| 98 | struct snd_ice1712 *ice = bus->private_data; |
| 99 | snd_ice1712_restore_gpio_status(ice); |
| 100 | } |
| 101 | |
| 102 | static void revo_i2c_direction(struct snd_i2c_bus *bus, int clock, int data) |
| 103 | { |
| 104 | struct snd_ice1712 *ice = bus->private_data; |
| 105 | unsigned int mask, val; |
| 106 | |
| 107 | val = 0; |
| 108 | if (clock) |
| 109 | val |= VT1724_REVO_I2C_CLOCK; /* write SCL */ |
| 110 | if (data) |
| 111 | val |= VT1724_REVO_I2C_DATA; /* write SDA */ |
| 112 | mask = VT1724_REVO_I2C_CLOCK | VT1724_REVO_I2C_DATA; |
| 113 | ice->gpio.direction &= ~mask; |
| 114 | ice->gpio.direction |= val; |
| 115 | snd_ice1712_gpio_set_dir(ice, ice->gpio.direction); |
| 116 | snd_ice1712_gpio_set_mask(ice, ~mask); |
| 117 | } |
| 118 | |
| 119 | static void revo_i2c_setlines(struct snd_i2c_bus *bus, int clk, int data) |
| 120 | { |
| 121 | struct snd_ice1712 *ice = bus->private_data; |
| 122 | unsigned int val = 0; |
| 123 | |
| 124 | if (clk) |
| 125 | val |= VT1724_REVO_I2C_CLOCK; |
| 126 | if (data) |
| 127 | val |= VT1724_REVO_I2C_DATA; |
| 128 | snd_ice1712_gpio_write_bits(ice, |
| 129 | VT1724_REVO_I2C_DATA | |
| 130 | VT1724_REVO_I2C_CLOCK, val); |
| 131 | udelay(5); |
| 132 | } |
| 133 | |
| 134 | static int revo_i2c_getdata(struct snd_i2c_bus *bus, int ack) |
| 135 | { |
| 136 | struct snd_ice1712 *ice = bus->private_data; |
| 137 | int bit; |
| 138 | |
| 139 | if (ack) |
| 140 | udelay(5); |
| 141 | bit = snd_ice1712_gpio_read_bits(ice, VT1724_REVO_I2C_DATA) ? 1 : 0; |
| 142 | return bit; |
| 143 | } |
| 144 | |
| 145 | static struct snd_i2c_bit_ops revo51_bit_ops = { |
| 146 | .start = revo_i2c_start, |
| 147 | .stop = revo_i2c_stop, |
| 148 | .direction = revo_i2c_direction, |
| 149 | .setlines = revo_i2c_setlines, |
| 150 | .getdata = revo_i2c_getdata, |
| 151 | }; |
| 152 | |
| 153 | static int revo51_i2c_init(struct snd_ice1712 *ice, |
| 154 | struct snd_pt2258 *pt) |
| 155 | { |
| 156 | int err; |
| 157 | |
| 158 | /* create the I2C bus */ |
| 159 | err = snd_i2c_bus_create(ice->card, "ICE1724 GPIO6", NULL, &ice->i2c); |
| 160 | if (err < 0) |
| 161 | return err; |
| 162 | |
| 163 | ice->i2c->private_data = ice; |
| 164 | ice->i2c->hw_ops.bit = &revo51_bit_ops; |
| 165 | |
| 166 | /* create the I2C device */ |
| 167 | err = snd_i2c_device_create(ice->i2c, "PT2258", 0x40, |
| 168 | &ice->spec.revo51.dev); |
| 169 | if (err < 0) |
| 170 | return err; |
| 171 | |
| 172 | pt->card = ice->card; |
| 173 | pt->i2c_bus = ice->i2c; |
| 174 | pt->i2c_dev = ice->spec.revo51.dev; |
| 175 | ice->spec.revo51.pt2258 = pt; |
| 176 | |
| 177 | snd_pt2258_reset(pt); |
| 178 | |
| 179 | return 0; |
| 180 | } |
| 181 | |
| 182 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 183 | * initialize the chips on M-Audio Revolution cards |
| 184 | */ |
| 185 | |
Takashi Iwai | 723b2b0 | 2006-08-30 16:49:54 +0200 | [diff] [blame] | 186 | #define AK_DAC(xname,xch) { .name = xname, .num_channels = xch } |
Jani Alinikula | c83c0c4 | 2006-06-27 15:00:55 +0200 | [diff] [blame] | 187 | |
Takashi Iwai | 723b2b0 | 2006-08-30 16:49:54 +0200 | [diff] [blame] | 188 | static struct snd_akm4xxx_dac_channel revo71_front[] = { |
| 189 | AK_DAC("PCM Playback Volume", 2) |
| 190 | }; |
Jani Alinikula | c83c0c4 | 2006-06-27 15:00:55 +0200 | [diff] [blame] | 191 | |
Takashi Iwai | 723b2b0 | 2006-08-30 16:49:54 +0200 | [diff] [blame] | 192 | static struct snd_akm4xxx_dac_channel revo71_surround[] = { |
| 193 | AK_DAC("PCM Center Playback Volume", 1), |
| 194 | AK_DAC("PCM LFE Playback Volume", 1), |
| 195 | AK_DAC("PCM Side Playback Volume", 2), |
| 196 | AK_DAC("PCM Rear Playback Volume", 2), |
| 197 | }; |
Jani Alinikula | c83c0c4 | 2006-06-27 15:00:55 +0200 | [diff] [blame] | 198 | |
Takashi Iwai | 723b2b0 | 2006-08-30 16:49:54 +0200 | [diff] [blame] | 199 | static struct snd_akm4xxx_dac_channel revo51_dac[] = { |
| 200 | AK_DAC("PCM Playback Volume", 2), |
| 201 | AK_DAC("PCM Center Playback Volume", 1), |
| 202 | AK_DAC("PCM LFE Playback Volume", 1), |
| 203 | AK_DAC("PCM Rear Playback Volume", 2), |
| 204 | }; |
| 205 | |
Jochen Voss | a58e7cb | 2006-10-04 18:04:10 +0200 | [diff] [blame] | 206 | static const char *revo51_adc_input_names[] = { |
| 207 | "Mic", |
| 208 | "Line", |
| 209 | "CD", |
| 210 | NULL |
| 211 | }; |
| 212 | |
Takashi Iwai | 723b2b0 | 2006-08-30 16:49:54 +0200 | [diff] [blame] | 213 | static struct snd_akm4xxx_adc_channel revo51_adc[] = { |
| 214 | { |
| 215 | .name = "PCM Capture Volume", |
Takashi Iwai | 723b2b0 | 2006-08-30 16:49:54 +0200 | [diff] [blame] | 216 | .switch_name = "PCM Capture Switch", |
Jochen Voss | a58e7cb | 2006-10-04 18:04:10 +0200 | [diff] [blame] | 217 | .num_channels = 2, |
| 218 | .input_names = revo51_adc_input_names |
Takashi Iwai | 723b2b0 | 2006-08-30 16:49:54 +0200 | [diff] [blame] | 219 | }, |
| 220 | }; |
Jochen Voss | 96d9e93 | 2006-08-08 21:13:42 +0200 | [diff] [blame] | 221 | |
Takashi Iwai | ab0c7d7 | 2005-11-17 15:00:18 +0100 | [diff] [blame] | 222 | static struct snd_akm4xxx akm_revo_front __devinitdata = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 223 | .type = SND_AK4381, |
| 224 | .num_dacs = 2, |
| 225 | .ops = { |
| 226 | .set_rate_val = revo_set_rate_val |
Jani Alinikula | c83c0c4 | 2006-06-27 15:00:55 +0200 | [diff] [blame] | 227 | }, |
Takashi Iwai | 723b2b0 | 2006-08-30 16:49:54 +0200 | [diff] [blame] | 228 | .dac_info = revo71_front, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 229 | }; |
| 230 | |
| 231 | static struct snd_ak4xxx_private akm_revo_front_priv __devinitdata = { |
| 232 | .caddr = 1, |
| 233 | .cif = 0, |
| 234 | .data_mask = VT1724_REVO_CDOUT, |
| 235 | .clk_mask = VT1724_REVO_CCLK, |
| 236 | .cs_mask = VT1724_REVO_CS0 | VT1724_REVO_CS1 | VT1724_REVO_CS2, |
| 237 | .cs_addr = VT1724_REVO_CS0 | VT1724_REVO_CS2, |
| 238 | .cs_none = VT1724_REVO_CS0 | VT1724_REVO_CS1 | VT1724_REVO_CS2, |
| 239 | .add_flags = VT1724_REVO_CCLK, /* high at init */ |
| 240 | .mask_flags = 0, |
| 241 | }; |
| 242 | |
Takashi Iwai | ab0c7d7 | 2005-11-17 15:00:18 +0100 | [diff] [blame] | 243 | static struct snd_akm4xxx akm_revo_surround __devinitdata = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 244 | .type = SND_AK4355, |
| 245 | .idx_offset = 1, |
| 246 | .num_dacs = 6, |
| 247 | .ops = { |
| 248 | .set_rate_val = revo_set_rate_val |
Jani Alinikula | c83c0c4 | 2006-06-27 15:00:55 +0200 | [diff] [blame] | 249 | }, |
Takashi Iwai | 723b2b0 | 2006-08-30 16:49:54 +0200 | [diff] [blame] | 250 | .dac_info = revo71_surround, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 251 | }; |
| 252 | |
| 253 | static struct snd_ak4xxx_private akm_revo_surround_priv __devinitdata = { |
| 254 | .caddr = 3, |
| 255 | .cif = 0, |
| 256 | .data_mask = VT1724_REVO_CDOUT, |
| 257 | .clk_mask = VT1724_REVO_CCLK, |
| 258 | .cs_mask = VT1724_REVO_CS0 | VT1724_REVO_CS1 | VT1724_REVO_CS2, |
| 259 | .cs_addr = VT1724_REVO_CS0 | VT1724_REVO_CS1, |
| 260 | .cs_none = VT1724_REVO_CS0 | VT1724_REVO_CS1 | VT1724_REVO_CS2, |
| 261 | .add_flags = VT1724_REVO_CCLK, /* high at init */ |
| 262 | .mask_flags = 0, |
| 263 | }; |
| 264 | |
Takashi Iwai | 59acf76 | 2005-12-05 19:22:34 +0100 | [diff] [blame] | 265 | static struct snd_akm4xxx akm_revo51 __devinitdata = { |
| 266 | .type = SND_AK4358, |
| 267 | .num_dacs = 6, |
| 268 | .ops = { |
| 269 | .set_rate_val = revo_set_rate_val |
Jani Alinikula | c83c0c4 | 2006-06-27 15:00:55 +0200 | [diff] [blame] | 270 | }, |
Takashi Iwai | 723b2b0 | 2006-08-30 16:49:54 +0200 | [diff] [blame] | 271 | .dac_info = revo51_dac, |
Takashi Iwai | 59acf76 | 2005-12-05 19:22:34 +0100 | [diff] [blame] | 272 | }; |
| 273 | |
| 274 | static struct snd_ak4xxx_private akm_revo51_priv __devinitdata = { |
| 275 | .caddr = 2, |
| 276 | .cif = 0, |
| 277 | .data_mask = VT1724_REVO_CDOUT, |
| 278 | .clk_mask = VT1724_REVO_CCLK, |
Jochen Voss | feaa6a7 | 2006-10-04 18:08:43 +0200 | [diff] [blame] | 279 | .cs_mask = VT1724_REVO_CS0 | VT1724_REVO_CS1, |
| 280 | .cs_addr = VT1724_REVO_CS1, |
| 281 | .cs_none = VT1724_REVO_CS0 | VT1724_REVO_CS1, |
Jochen Voss | 96d9e93 | 2006-08-08 21:13:42 +0200 | [diff] [blame] | 282 | .add_flags = VT1724_REVO_CCLK, /* high at init */ |
| 283 | .mask_flags = 0, |
| 284 | }; |
| 285 | |
| 286 | static struct snd_akm4xxx akm_revo51_adc __devinitdata = { |
| 287 | .type = SND_AK5365, |
| 288 | .num_adcs = 2, |
Takashi Iwai | 723b2b0 | 2006-08-30 16:49:54 +0200 | [diff] [blame] | 289 | .adc_info = revo51_adc, |
Jochen Voss | 96d9e93 | 2006-08-08 21:13:42 +0200 | [diff] [blame] | 290 | }; |
| 291 | |
| 292 | static struct snd_ak4xxx_private akm_revo51_adc_priv __devinitdata = { |
| 293 | .caddr = 2, |
| 294 | .cif = 0, |
| 295 | .data_mask = VT1724_REVO_CDOUT, |
| 296 | .clk_mask = VT1724_REVO_CCLK, |
Jochen Voss | feaa6a7 | 2006-10-04 18:08:43 +0200 | [diff] [blame] | 297 | .cs_mask = VT1724_REVO_CS0 | VT1724_REVO_CS1, |
| 298 | .cs_addr = VT1724_REVO_CS0, |
| 299 | .cs_none = VT1724_REVO_CS0 | VT1724_REVO_CS1, |
Takashi Iwai | 59acf76 | 2005-12-05 19:22:34 +0100 | [diff] [blame] | 300 | .add_flags = VT1724_REVO_CCLK, /* high at init */ |
| 301 | .mask_flags = 0, |
| 302 | }; |
| 303 | |
Jochen Voss | feaa6a7 | 2006-10-04 18:08:43 +0200 | [diff] [blame] | 304 | static struct snd_pt2258 ptc_revo51_volume; |
| 305 | |
Takashi Iwai | ab0c7d7 | 2005-11-17 15:00:18 +0100 | [diff] [blame] | 306 | static int __devinit revo_init(struct snd_ice1712 *ice) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 307 | { |
Takashi Iwai | ab0c7d7 | 2005-11-17 15:00:18 +0100 | [diff] [blame] | 308 | struct snd_akm4xxx *ak; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 309 | int err; |
| 310 | |
| 311 | /* determine I2C, DACs and ADCs */ |
| 312 | switch (ice->eeprom.subvendor) { |
| 313 | case VT1724_SUBDEVICE_REVOLUTION71: |
| 314 | ice->num_total_dacs = 8; |
| 315 | ice->num_total_adcs = 2; |
Takashi Iwai | 59acf76 | 2005-12-05 19:22:34 +0100 | [diff] [blame] | 316 | ice->gpio.i2s_mclk_changed = revo_i2s_mclk_changed; |
| 317 | break; |
| 318 | case VT1724_SUBDEVICE_REVOLUTION51: |
| 319 | ice->num_total_dacs = 6; |
| 320 | ice->num_total_adcs = 2; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 321 | break; |
| 322 | default: |
| 323 | snd_BUG(); |
| 324 | return -EINVAL; |
| 325 | } |
| 326 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 327 | /* second stage of initialization, analog parts and others */ |
Takashi Iwai | ab0c7d7 | 2005-11-17 15:00:18 +0100 | [diff] [blame] | 328 | ak = ice->akm = kcalloc(2, sizeof(struct snd_akm4xxx), GFP_KERNEL); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 329 | if (! ak) |
| 330 | return -ENOMEM; |
| 331 | ice->akm_codecs = 2; |
| 332 | switch (ice->eeprom.subvendor) { |
| 333 | case VT1724_SUBDEVICE_REVOLUTION71: |
Takashi Iwai | 59acf76 | 2005-12-05 19:22:34 +0100 | [diff] [blame] | 334 | ice->akm_codecs = 2; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 335 | if ((err = snd_ice1712_akm4xxx_init(ak, &akm_revo_front, &akm_revo_front_priv, ice)) < 0) |
| 336 | return err; |
| 337 | if ((err = snd_ice1712_akm4xxx_init(ak + 1, &akm_revo_surround, &akm_revo_surround_priv, ice)) < 0) |
| 338 | return err; |
| 339 | /* unmute all codecs */ |
| 340 | snd_ice1712_gpio_write_bits(ice, VT1724_REVO_MUTE, VT1724_REVO_MUTE); |
| 341 | break; |
Takashi Iwai | 59acf76 | 2005-12-05 19:22:34 +0100 | [diff] [blame] | 342 | case VT1724_SUBDEVICE_REVOLUTION51: |
Jochen Voss | 96d9e93 | 2006-08-08 21:13:42 +0200 | [diff] [blame] | 343 | ice->akm_codecs = 2; |
Jochen Voss | feaa6a7 | 2006-10-04 18:08:43 +0200 | [diff] [blame] | 344 | err = snd_ice1712_akm4xxx_init(ak, &akm_revo51, |
| 345 | &akm_revo51_priv, ice); |
| 346 | if (err < 0) |
Takashi Iwai | 59acf76 | 2005-12-05 19:22:34 +0100 | [diff] [blame] | 347 | return err; |
Jochen Voss | feaa6a7 | 2006-10-04 18:08:43 +0200 | [diff] [blame] | 348 | err = snd_ice1712_akm4xxx_init(ak+1, &akm_revo51_adc, |
Jochen Voss | 96d9e93 | 2006-08-08 21:13:42 +0200 | [diff] [blame] | 349 | &akm_revo51_adc_priv, ice); |
| 350 | if (err < 0) |
| 351 | return err; |
Jochen Voss | feaa6a7 | 2006-10-04 18:08:43 +0200 | [diff] [blame] | 352 | err = revo51_i2c_init(ice, &ptc_revo51_volume); |
| 353 | if (err < 0) |
| 354 | return err; |
| 355 | /* unmute all codecs */ |
| 356 | snd_ice1712_gpio_write_bits(ice, VT1724_REVO_MUTE, |
| 357 | VT1724_REVO_MUTE); |
Takashi Iwai | 59acf76 | 2005-12-05 19:22:34 +0100 | [diff] [blame] | 358 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 359 | } |
| 360 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 361 | return 0; |
| 362 | } |
| 363 | |
| 364 | |
Takashi Iwai | ab0c7d7 | 2005-11-17 15:00:18 +0100 | [diff] [blame] | 365 | static int __devinit revo_add_controls(struct snd_ice1712 *ice) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 366 | { |
| 367 | int err; |
| 368 | |
| 369 | switch (ice->eeprom.subvendor) { |
| 370 | case VT1724_SUBDEVICE_REVOLUTION71: |
Jochen Voss | feaa6a7 | 2006-10-04 18:08:43 +0200 | [diff] [blame] | 371 | err = snd_ice1712_akm4xxx_build_controls(ice); |
| 372 | if (err < 0) |
| 373 | return err; |
| 374 | break; |
Takashi Iwai | 59acf76 | 2005-12-05 19:22:34 +0100 | [diff] [blame] | 375 | case VT1724_SUBDEVICE_REVOLUTION51: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 376 | err = snd_ice1712_akm4xxx_build_controls(ice); |
| 377 | if (err < 0) |
| 378 | return err; |
Jochen Voss | feaa6a7 | 2006-10-04 18:08:43 +0200 | [diff] [blame] | 379 | err = snd_pt2258_build_controls(ice->spec.revo51.pt2258); |
| 380 | if (err < 0) |
| 381 | return err; |
| 382 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 383 | } |
| 384 | return 0; |
| 385 | } |
| 386 | |
| 387 | /* entry point */ |
| 388 | struct snd_ice1712_card_info snd_vt1724_revo_cards[] __devinitdata = { |
| 389 | { |
| 390 | .subvendor = VT1724_SUBDEVICE_REVOLUTION71, |
| 391 | .name = "M Audio Revolution-7.1", |
| 392 | .model = "revo71", |
| 393 | .chip_init = revo_init, |
| 394 | .build_controls = revo_add_controls, |
| 395 | }, |
Takashi Iwai | 59acf76 | 2005-12-05 19:22:34 +0100 | [diff] [blame] | 396 | { |
| 397 | .subvendor = VT1724_SUBDEVICE_REVOLUTION51, |
| 398 | .name = "M Audio Revolution-5.1", |
| 399 | .model = "revo51", |
| 400 | .chip_init = revo_init, |
| 401 | .build_controls = revo_add_controls, |
| 402 | }, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 403 | { } /* terminator */ |
| 404 | }; |