revo.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632
  1. /*
  2. * ALSA driver for ICEnsemble ICE1712 (Envy24)
  3. *
  4. * Lowlevel functions for M-Audio Audiophile 192, Revolution 7.1 and 5.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. #include <linux/delay.h>
  24. #include <linux/interrupt.h>
  25. #include <linux/init.h>
  26. #include <linux/slab.h>
  27. #include <sound/core.h>
  28. #include "ice1712.h"
  29. #include "envy24ht.h"
  30. #include "revo.h"
  31. /* a non-standard I2C device for revo51 */
  32. struct revo51_spec {
  33. struct snd_i2c_device *dev;
  34. struct snd_pt2258 *pt2258;
  35. };
  36. static void revo_i2s_mclk_changed(struct snd_ice1712 *ice)
  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. * change the rate of Envy24HT, AK4355 and AK4381
  46. */
  47. static void revo_set_rate_val(struct snd_akm4xxx *ak, unsigned int rate)
  48. {
  49. unsigned char old, tmp, dfs;
  50. int reg, shift;
  51. if (rate == 0) /* no hint - S/PDIF input is master, simply return */
  52. return;
  53. /* adjust DFS on codecs */
  54. if (rate > 96000)
  55. dfs = 2;
  56. else if (rate > 48000)
  57. dfs = 1;
  58. else
  59. dfs = 0;
  60. if (ak->type == SND_AK4355 || ak->type == SND_AK4358) {
  61. reg = 2;
  62. shift = 4;
  63. } else {
  64. reg = 1;
  65. shift = 3;
  66. }
  67. tmp = snd_akm4xxx_get(ak, 0, reg);
  68. old = (tmp >> shift) & 0x03;
  69. if (old == dfs)
  70. return;
  71. /* reset DFS */
  72. snd_akm4xxx_reset(ak, 1);
  73. tmp = snd_akm4xxx_get(ak, 0, reg);
  74. tmp &= ~(0x03 << shift);
  75. tmp |= dfs << shift;
  76. /* snd_akm4xxx_write(ak, 0, reg, tmp); */
  77. snd_akm4xxx_set(ak, 0, reg, tmp); /* value is written in reset(0) */
  78. snd_akm4xxx_reset(ak, 0);
  79. }
  80. /*
  81. * I2C access to the PT2258 volume controller on GPIO 6/7 (Revolution 5.1)
  82. */
  83. static void revo_i2c_start(struct snd_i2c_bus *bus)
  84. {
  85. struct snd_ice1712 *ice = bus->private_data;
  86. snd_ice1712_save_gpio_status(ice);
  87. }
  88. static void revo_i2c_stop(struct snd_i2c_bus *bus)
  89. {
  90. struct snd_ice1712 *ice = bus->private_data;
  91. snd_ice1712_restore_gpio_status(ice);
  92. }
  93. static void revo_i2c_direction(struct snd_i2c_bus *bus, int clock, int data)
  94. {
  95. struct snd_ice1712 *ice = bus->private_data;
  96. unsigned int mask, val;
  97. val = 0;
  98. if (clock)
  99. val |= VT1724_REVO_I2C_CLOCK; /* write SCL */
  100. if (data)
  101. val |= VT1724_REVO_I2C_DATA; /* write SDA */
  102. mask = VT1724_REVO_I2C_CLOCK | VT1724_REVO_I2C_DATA;
  103. ice->gpio.direction &= ~mask;
  104. ice->gpio.direction |= val;
  105. snd_ice1712_gpio_set_dir(ice, ice->gpio.direction);
  106. snd_ice1712_gpio_set_mask(ice, ~mask);
  107. }
  108. static void revo_i2c_setlines(struct snd_i2c_bus *bus, int clk, int data)
  109. {
  110. struct snd_ice1712 *ice = bus->private_data;
  111. unsigned int val = 0;
  112. if (clk)
  113. val |= VT1724_REVO_I2C_CLOCK;
  114. if (data)
  115. val |= VT1724_REVO_I2C_DATA;
  116. snd_ice1712_gpio_write_bits(ice,
  117. VT1724_REVO_I2C_DATA |
  118. VT1724_REVO_I2C_CLOCK, val);
  119. udelay(5);
  120. }
  121. static int revo_i2c_getdata(struct snd_i2c_bus *bus, int ack)
  122. {
  123. struct snd_ice1712 *ice = bus->private_data;
  124. int bit;
  125. if (ack)
  126. udelay(5);
  127. bit = snd_ice1712_gpio_read_bits(ice, VT1724_REVO_I2C_DATA) ? 1 : 0;
  128. return bit;
  129. }
  130. static struct snd_i2c_bit_ops revo51_bit_ops = {
  131. .start = revo_i2c_start,
  132. .stop = revo_i2c_stop,
  133. .direction = revo_i2c_direction,
  134. .setlines = revo_i2c_setlines,
  135. .getdata = revo_i2c_getdata,
  136. };
  137. static int revo51_i2c_init(struct snd_ice1712 *ice,
  138. struct snd_pt2258 *pt)
  139. {
  140. struct revo51_spec *spec;
  141. int err;
  142. spec = kzalloc(sizeof(*spec), GFP_KERNEL);
  143. if (!spec)
  144. return -ENOMEM;
  145. ice->spec = spec;
  146. /* create the I2C bus */
  147. err = snd_i2c_bus_create(ice->card, "ICE1724 GPIO6", NULL, &ice->i2c);
  148. if (err < 0)
  149. return err;
  150. ice->i2c->private_data = ice;
  151. ice->i2c->hw_ops.bit = &revo51_bit_ops;
  152. /* create the I2C device */
  153. err = snd_i2c_device_create(ice->i2c, "PT2258", 0x40, &spec->dev);
  154. if (err < 0)
  155. return err;
  156. pt->card = ice->card;
  157. pt->i2c_bus = ice->i2c;
  158. pt->i2c_dev = spec->dev;
  159. spec->pt2258 = pt;
  160. snd_pt2258_reset(pt);
  161. return 0;
  162. }
  163. /*
  164. * initialize the chips on M-Audio Revolution cards
  165. */
  166. #define AK_DAC(xname,xch) { .name = xname, .num_channels = xch }
  167. static const struct snd_akm4xxx_dac_channel revo71_front[] = {
  168. {
  169. .name = "PCM Playback Volume",
  170. .num_channels = 2,
  171. /* front channels DAC supports muting */
  172. .switch_name = "PCM Playback Switch",
  173. },
  174. };
  175. static const struct snd_akm4xxx_dac_channel revo71_surround[] = {
  176. AK_DAC("PCM Center Playback Volume", 1),
  177. AK_DAC("PCM LFE Playback Volume", 1),
  178. AK_DAC("PCM Side Playback Volume", 2),
  179. AK_DAC("PCM Rear Playback Volume", 2),
  180. };
  181. static const struct snd_akm4xxx_dac_channel revo51_dac[] = {
  182. AK_DAC("PCM Playback Volume", 2),
  183. AK_DAC("PCM Center Playback Volume", 1),
  184. AK_DAC("PCM LFE Playback Volume", 1),
  185. AK_DAC("PCM Rear Playback Volume", 2),
  186. AK_DAC("PCM Headphone Volume", 2),
  187. };
  188. static const char *revo51_adc_input_names[] = {
  189. "Mic",
  190. "Line",
  191. "CD",
  192. NULL
  193. };
  194. static const struct snd_akm4xxx_adc_channel revo51_adc[] = {
  195. {
  196. .name = "PCM Capture Volume",
  197. .switch_name = "PCM Capture Switch",
  198. .num_channels = 2,
  199. .input_names = revo51_adc_input_names
  200. },
  201. };
  202. static struct snd_akm4xxx akm_revo_front = {
  203. .type = SND_AK4381,
  204. .num_dacs = 2,
  205. .ops = {
  206. .set_rate_val = revo_set_rate_val
  207. },
  208. .dac_info = revo71_front,
  209. };
  210. static struct snd_ak4xxx_private akm_revo_front_priv = {
  211. .caddr = 1,
  212. .cif = 0,
  213. .data_mask = VT1724_REVO_CDOUT,
  214. .clk_mask = VT1724_REVO_CCLK,
  215. .cs_mask = VT1724_REVO_CS0 | VT1724_REVO_CS1 | VT1724_REVO_CS2,
  216. .cs_addr = VT1724_REVO_CS0 | VT1724_REVO_CS2,
  217. .cs_none = VT1724_REVO_CS0 | VT1724_REVO_CS1 | VT1724_REVO_CS2,
  218. .add_flags = VT1724_REVO_CCLK, /* high at init */
  219. .mask_flags = 0,
  220. };
  221. static struct snd_akm4xxx akm_revo_surround = {
  222. .type = SND_AK4355,
  223. .idx_offset = 1,
  224. .num_dacs = 6,
  225. .ops = {
  226. .set_rate_val = revo_set_rate_val
  227. },
  228. .dac_info = revo71_surround,
  229. };
  230. static struct snd_ak4xxx_private akm_revo_surround_priv = {
  231. .caddr = 3,
  232. .cif = 0,
  233. .data_mask = VT1724_REVO_CDOUT,
  234. .clk_mask = VT1724_REVO_CCLK,
  235. .cs_mask = VT1724_REVO_CS0 | VT1724_REVO_CS1 | VT1724_REVO_CS2,
  236. .cs_addr = VT1724_REVO_CS0 | VT1724_REVO_CS1,
  237. .cs_none = VT1724_REVO_CS0 | VT1724_REVO_CS1 | VT1724_REVO_CS2,
  238. .add_flags = VT1724_REVO_CCLK, /* high at init */
  239. .mask_flags = 0,
  240. };
  241. static struct snd_akm4xxx akm_revo51 = {
  242. .type = SND_AK4358,
  243. .num_dacs = 8,
  244. .ops = {
  245. .set_rate_val = revo_set_rate_val
  246. },
  247. .dac_info = revo51_dac,
  248. };
  249. static struct snd_ak4xxx_private akm_revo51_priv = {
  250. .caddr = 2,
  251. .cif = 0,
  252. .data_mask = VT1724_REVO_CDOUT,
  253. .clk_mask = VT1724_REVO_CCLK,
  254. .cs_mask = VT1724_REVO_CS0 | VT1724_REVO_CS1,
  255. .cs_addr = VT1724_REVO_CS1,
  256. .cs_none = VT1724_REVO_CS0 | VT1724_REVO_CS1,
  257. .add_flags = VT1724_REVO_CCLK, /* high at init */
  258. .mask_flags = 0,
  259. };
  260. static struct snd_akm4xxx akm_revo51_adc = {
  261. .type = SND_AK5365,
  262. .num_adcs = 2,
  263. .adc_info = revo51_adc,
  264. };
  265. static struct snd_ak4xxx_private akm_revo51_adc_priv = {
  266. .caddr = 2,
  267. .cif = 0,
  268. .data_mask = VT1724_REVO_CDOUT,
  269. .clk_mask = VT1724_REVO_CCLK,
  270. .cs_mask = VT1724_REVO_CS0 | VT1724_REVO_CS1,
  271. .cs_addr = VT1724_REVO_CS0,
  272. .cs_none = VT1724_REVO_CS0 | VT1724_REVO_CS1,
  273. .add_flags = VT1724_REVO_CCLK, /* high at init */
  274. .mask_flags = 0,
  275. };
  276. static struct snd_pt2258 ptc_revo51_volume;
  277. /* AK4358 for AP192 DAC, AK5385A for ADC */
  278. static void ap192_set_rate_val(struct snd_akm4xxx *ak, unsigned int rate)
  279. {
  280. struct snd_ice1712 *ice = ak->private_data[0];
  281. int dfs;
  282. revo_set_rate_val(ak, rate);
  283. /* reset CKS */
  284. snd_ice1712_gpio_write_bits(ice, 1 << 8, rate > 96000 ? 1 << 8 : 0);
  285. /* reset DFS pins of AK5385A for ADC, too */
  286. if (rate > 96000)
  287. dfs = 2;
  288. else if (rate > 48000)
  289. dfs = 1;
  290. else
  291. dfs = 0;
  292. snd_ice1712_gpio_write_bits(ice, 3 << 9, dfs << 9);
  293. /* reset ADC */
  294. snd_ice1712_gpio_write_bits(ice, 1 << 11, 0);
  295. snd_ice1712_gpio_write_bits(ice, 1 << 11, 1 << 11);
  296. }
  297. static const struct snd_akm4xxx_dac_channel ap192_dac[] = {
  298. AK_DAC("PCM Playback Volume", 2)
  299. };
  300. static struct snd_akm4xxx akm_ap192 = {
  301. .type = SND_AK4358,
  302. .num_dacs = 2,
  303. .ops = {
  304. .set_rate_val = ap192_set_rate_val
  305. },
  306. .dac_info = ap192_dac,
  307. };
  308. static struct snd_ak4xxx_private akm_ap192_priv = {
  309. .caddr = 2,
  310. .cif = 0,
  311. .data_mask = VT1724_REVO_CDOUT,
  312. .clk_mask = VT1724_REVO_CCLK,
  313. .cs_mask = VT1724_REVO_CS0 | VT1724_REVO_CS1,
  314. .cs_addr = VT1724_REVO_CS1,
  315. .cs_none = VT1724_REVO_CS0 | VT1724_REVO_CS1,
  316. .add_flags = VT1724_REVO_CCLK, /* high at init */
  317. .mask_flags = 0,
  318. };
  319. /* AK4114 support on Audiophile 192 */
  320. /* CDTO (pin 32) -- GPIO2 pin 52
  321. * CDTI (pin 33) -- GPIO3 pin 53 (shared with AK4358)
  322. * CCLK (pin 34) -- GPIO1 pin 51 (shared with AK4358)
  323. * CSN (pin 35) -- GPIO7 pin 59
  324. */
  325. #define AK4114_ADDR 0x02
  326. static void write_data(struct snd_ice1712 *ice, unsigned int gpio,
  327. unsigned int data, int idx)
  328. {
  329. for (; idx >= 0; idx--) {
  330. /* drop clock */
  331. gpio &= ~VT1724_REVO_CCLK;
  332. snd_ice1712_gpio_write(ice, gpio);
  333. udelay(1);
  334. /* set data */
  335. if (data & (1 << idx))
  336. gpio |= VT1724_REVO_CDOUT;
  337. else
  338. gpio &= ~VT1724_REVO_CDOUT;
  339. snd_ice1712_gpio_write(ice, gpio);
  340. udelay(1);
  341. /* raise clock */
  342. gpio |= VT1724_REVO_CCLK;
  343. snd_ice1712_gpio_write(ice, gpio);
  344. udelay(1);
  345. }
  346. }
  347. static unsigned char read_data(struct snd_ice1712 *ice, unsigned int gpio,
  348. int idx)
  349. {
  350. unsigned char data = 0;
  351. for (; idx >= 0; idx--) {
  352. /* drop clock */
  353. gpio &= ~VT1724_REVO_CCLK;
  354. snd_ice1712_gpio_write(ice, gpio);
  355. udelay(1);
  356. /* read data */
  357. if (snd_ice1712_gpio_read(ice) & VT1724_REVO_CDIN)
  358. data |= (1 << idx);
  359. udelay(1);
  360. /* raise clock */
  361. gpio |= VT1724_REVO_CCLK;
  362. snd_ice1712_gpio_write(ice, gpio);
  363. udelay(1);
  364. }
  365. return data;
  366. }
  367. static unsigned int ap192_4wire_start(struct snd_ice1712 *ice)
  368. {
  369. unsigned int tmp;
  370. snd_ice1712_save_gpio_status(ice);
  371. tmp = snd_ice1712_gpio_read(ice);
  372. tmp |= VT1724_REVO_CCLK; /* high at init */
  373. tmp |= VT1724_REVO_CS0;
  374. tmp &= ~VT1724_REVO_CS1;
  375. snd_ice1712_gpio_write(ice, tmp);
  376. udelay(1);
  377. return tmp;
  378. }
  379. static void ap192_4wire_finish(struct snd_ice1712 *ice, unsigned int tmp)
  380. {
  381. tmp |= VT1724_REVO_CS1;
  382. tmp |= VT1724_REVO_CS0;
  383. snd_ice1712_gpio_write(ice, tmp);
  384. udelay(1);
  385. snd_ice1712_restore_gpio_status(ice);
  386. }
  387. static void ap192_ak4114_write(void *private_data, unsigned char addr,
  388. unsigned char data)
  389. {
  390. struct snd_ice1712 *ice = private_data;
  391. unsigned int tmp, addrdata;
  392. tmp = ap192_4wire_start(ice);
  393. addrdata = (AK4114_ADDR << 6) | 0x20 | (addr & 0x1f);
  394. addrdata = (addrdata << 8) | data;
  395. write_data(ice, tmp, addrdata, 15);
  396. ap192_4wire_finish(ice, tmp);
  397. }
  398. static unsigned char ap192_ak4114_read(void *private_data, unsigned char addr)
  399. {
  400. struct snd_ice1712 *ice = private_data;
  401. unsigned int tmp;
  402. unsigned char data;
  403. tmp = ap192_4wire_start(ice);
  404. write_data(ice, tmp, (AK4114_ADDR << 6) | (addr & 0x1f), 7);
  405. data = read_data(ice, tmp, 7);
  406. ap192_4wire_finish(ice, tmp);
  407. return data;
  408. }
  409. static int ap192_ak4114_init(struct snd_ice1712 *ice)
  410. {
  411. static const unsigned char ak4114_init_vals[] = {
  412. AK4114_RST | AK4114_PWN | AK4114_OCKS0 | AK4114_OCKS1,
  413. AK4114_DIF_I24I2S,
  414. AK4114_TX1E,
  415. AK4114_EFH_1024 | AK4114_DIT | AK4114_IPS(1),
  416. 0,
  417. 0
  418. };
  419. static const unsigned char ak4114_init_txcsb[] = {
  420. 0x41, 0x02, 0x2c, 0x00, 0x00
  421. };
  422. struct ak4114 *ak;
  423. int err;
  424. err = snd_ak4114_create(ice->card,
  425. ap192_ak4114_read,
  426. ap192_ak4114_write,
  427. ak4114_init_vals, ak4114_init_txcsb,
  428. ice, &ak);
  429. /* AK4114 in Revo cannot detect external rate correctly.
  430. * No reason to stop capture stream due to incorrect checks */
  431. ak->check_flags = AK4114_CHECK_NO_RATE;
  432. return 0; /* error ignored; it's no fatal error */
  433. }
  434. static int revo_init(struct snd_ice1712 *ice)
  435. {
  436. struct snd_akm4xxx *ak;
  437. int err;
  438. /* determine I2C, DACs and ADCs */
  439. switch (ice->eeprom.subvendor) {
  440. case VT1724_SUBDEVICE_REVOLUTION71:
  441. ice->num_total_dacs = 8;
  442. ice->num_total_adcs = 2;
  443. ice->gpio.i2s_mclk_changed = revo_i2s_mclk_changed;
  444. break;
  445. case VT1724_SUBDEVICE_REVOLUTION51:
  446. ice->num_total_dacs = 8;
  447. ice->num_total_adcs = 2;
  448. break;
  449. case VT1724_SUBDEVICE_AUDIOPHILE192:
  450. ice->num_total_dacs = 2;
  451. ice->num_total_adcs = 2;
  452. break;
  453. default:
  454. snd_BUG();
  455. return -EINVAL;
  456. }
  457. /* second stage of initialization, analog parts and others */
  458. ak = ice->akm = kcalloc(2, sizeof(struct snd_akm4xxx), GFP_KERNEL);
  459. if (! ak)
  460. return -ENOMEM;
  461. switch (ice->eeprom.subvendor) {
  462. case VT1724_SUBDEVICE_REVOLUTION71:
  463. ice->akm_codecs = 2;
  464. err = snd_ice1712_akm4xxx_init(ak, &akm_revo_front,
  465. &akm_revo_front_priv, ice);
  466. if (err < 0)
  467. return err;
  468. err = snd_ice1712_akm4xxx_init(ak+1, &akm_revo_surround,
  469. &akm_revo_surround_priv, ice);
  470. if (err < 0)
  471. return err;
  472. /* unmute all codecs */
  473. snd_ice1712_gpio_write_bits(ice, VT1724_REVO_MUTE,
  474. VT1724_REVO_MUTE);
  475. break;
  476. case VT1724_SUBDEVICE_REVOLUTION51:
  477. ice->akm_codecs = 2;
  478. err = snd_ice1712_akm4xxx_init(ak, &akm_revo51,
  479. &akm_revo51_priv, ice);
  480. if (err < 0)
  481. return err;
  482. err = snd_ice1712_akm4xxx_init(ak+1, &akm_revo51_adc,
  483. &akm_revo51_adc_priv, ice);
  484. if (err < 0)
  485. return err;
  486. err = revo51_i2c_init(ice, &ptc_revo51_volume);
  487. if (err < 0)
  488. return err;
  489. /* unmute all codecs */
  490. snd_ice1712_gpio_write_bits(ice, VT1724_REVO_MUTE,
  491. VT1724_REVO_MUTE);
  492. break;
  493. case VT1724_SUBDEVICE_AUDIOPHILE192:
  494. ice->akm_codecs = 1;
  495. err = snd_ice1712_akm4xxx_init(ak, &akm_ap192, &akm_ap192_priv,
  496. ice);
  497. if (err < 0)
  498. return err;
  499. /* unmute all codecs */
  500. snd_ice1712_gpio_write_bits(ice, VT1724_REVO_MUTE,
  501. VT1724_REVO_MUTE);
  502. break;
  503. }
  504. return 0;
  505. }
  506. static int revo_add_controls(struct snd_ice1712 *ice)
  507. {
  508. struct revo51_spec *spec;
  509. int err;
  510. switch (ice->eeprom.subvendor) {
  511. case VT1724_SUBDEVICE_REVOLUTION71:
  512. err = snd_ice1712_akm4xxx_build_controls(ice);
  513. if (err < 0)
  514. return err;
  515. break;
  516. case VT1724_SUBDEVICE_REVOLUTION51:
  517. err = snd_ice1712_akm4xxx_build_controls(ice);
  518. if (err < 0)
  519. return err;
  520. spec = ice->spec;
  521. err = snd_pt2258_build_controls(spec->pt2258);
  522. if (err < 0)
  523. return err;
  524. break;
  525. case VT1724_SUBDEVICE_AUDIOPHILE192:
  526. err = snd_ice1712_akm4xxx_build_controls(ice);
  527. if (err < 0)
  528. return err;
  529. err = ap192_ak4114_init(ice);
  530. if (err < 0)
  531. return err;
  532. break;
  533. }
  534. return 0;
  535. }
  536. /* entry point */
  537. struct snd_ice1712_card_info snd_vt1724_revo_cards[] = {
  538. {
  539. .subvendor = VT1724_SUBDEVICE_REVOLUTION71,
  540. .name = "M Audio Revolution-7.1",
  541. .model = "revo71",
  542. .chip_init = revo_init,
  543. .build_controls = revo_add_controls,
  544. },
  545. {
  546. .subvendor = VT1724_SUBDEVICE_REVOLUTION51,
  547. .name = "M Audio Revolution-5.1",
  548. .model = "revo51",
  549. .chip_init = revo_init,
  550. .build_controls = revo_add_controls,
  551. },
  552. {
  553. .subvendor = VT1724_SUBDEVICE_AUDIOPHILE192,
  554. .name = "M Audio Audiophile192",
  555. .model = "ap192",
  556. .chip_init = revo_init,
  557. .build_controls = revo_add_controls,
  558. },
  559. { } /* terminator */
  560. };