ews.c 30 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025
  1. /*
  2. * ALSA driver for ICEnsemble ICE1712 (Envy24)
  3. *
  4. * Lowlevel functions for Terratec EWS88MT/D, EWX24/96, DMX 6Fire
  5. *
  6. * Copyright (c) 2000 Jaroslav Kysela <perex@perex.cz>
  7. * 2002 Takashi Iwai <tiwai@suse.de>
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  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. #include <sound/cs8427.h>
  32. #include <sound/asoundef.h>
  33. #include "ice1712.h"
  34. #include "ews.h"
  35. #define SND_CS8404
  36. #include <sound/cs8403.h>
  37. enum {
  38. EWS_I2C_CS8404 = 0, EWS_I2C_PCF1, EWS_I2C_PCF2,
  39. EWS_I2C_88D = 0,
  40. EWS_I2C_6FIRE = 0
  41. };
  42. /*
  43. * access via i2c mode (for EWX 24/96, EWS 88MT&D)
  44. */
  45. /* send SDA and SCL */
  46. static void ewx_i2c_setlines(struct snd_i2c_bus *bus, int clk, int data)
  47. {
  48. struct snd_ice1712 *ice = bus->private_data;
  49. unsigned char tmp = 0;
  50. if (clk)
  51. tmp |= ICE1712_EWX2496_SERIAL_CLOCK;
  52. if (data)
  53. tmp |= ICE1712_EWX2496_SERIAL_DATA;
  54. snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, tmp);
  55. udelay(5);
  56. }
  57. static int ewx_i2c_getclock(struct snd_i2c_bus *bus)
  58. {
  59. struct snd_ice1712 *ice = bus->private_data;
  60. return snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA) & ICE1712_EWX2496_SERIAL_CLOCK ? 1 : 0;
  61. }
  62. static int ewx_i2c_getdata(struct snd_i2c_bus *bus, int ack)
  63. {
  64. struct snd_ice1712 *ice = bus->private_data;
  65. int bit;
  66. /* set RW pin to low */
  67. snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK, ~ICE1712_EWX2496_RW);
  68. snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, 0);
  69. if (ack)
  70. udelay(5);
  71. bit = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA) & ICE1712_EWX2496_SERIAL_DATA ? 1 : 0;
  72. /* set RW pin to high */
  73. snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, ICE1712_EWX2496_RW);
  74. /* reset write mask */
  75. snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK, ~ICE1712_EWX2496_SERIAL_CLOCK);
  76. return bit;
  77. }
  78. static void ewx_i2c_start(struct snd_i2c_bus *bus)
  79. {
  80. struct snd_ice1712 *ice = bus->private_data;
  81. unsigned char mask;
  82. snd_ice1712_save_gpio_status(ice);
  83. /* set RW high */
  84. mask = ICE1712_EWX2496_RW;
  85. switch (ice->eeprom.subvendor) {
  86. case ICE1712_SUBDEVICE_EWX2496:
  87. mask |= ICE1712_EWX2496_AK4524_CS; /* CS high also */
  88. break;
  89. case ICE1712_SUBDEVICE_DMX6FIRE:
  90. mask |= ICE1712_6FIRE_AK4524_CS_MASK; /* CS high also */
  91. break;
  92. }
  93. snd_ice1712_gpio_write_bits(ice, mask, mask);
  94. }
  95. static void ewx_i2c_stop(struct snd_i2c_bus *bus)
  96. {
  97. struct snd_ice1712 *ice = bus->private_data;
  98. snd_ice1712_restore_gpio_status(ice);
  99. }
  100. static void ewx_i2c_direction(struct snd_i2c_bus *bus, int clock, int data)
  101. {
  102. struct snd_ice1712 *ice = bus->private_data;
  103. unsigned char mask = 0;
  104. if (clock)
  105. mask |= ICE1712_EWX2496_SERIAL_CLOCK; /* write SCL */
  106. if (data)
  107. mask |= ICE1712_EWX2496_SERIAL_DATA; /* write SDA */
  108. ice->gpio.direction &= ~(ICE1712_EWX2496_SERIAL_CLOCK|ICE1712_EWX2496_SERIAL_DATA);
  109. ice->gpio.direction |= mask;
  110. snd_ice1712_write(ice, ICE1712_IREG_GPIO_DIRECTION, ice->gpio.direction);
  111. snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK, ~mask);
  112. }
  113. static struct snd_i2c_bit_ops snd_ice1712_ewx_cs8427_bit_ops = {
  114. .start = ewx_i2c_start,
  115. .stop = ewx_i2c_stop,
  116. .direction = ewx_i2c_direction,
  117. .setlines = ewx_i2c_setlines,
  118. .getclock = ewx_i2c_getclock,
  119. .getdata = ewx_i2c_getdata,
  120. };
  121. /*
  122. * AK4524 access
  123. */
  124. /* AK4524 chip select; address 0x48 bit 0-3 */
  125. static int snd_ice1712_ews88mt_chip_select(struct snd_ice1712 *ice, int chip_mask)
  126. {
  127. unsigned char data, ndata;
  128. snd_assert(chip_mask >= 0 && chip_mask <= 0x0f, return -EINVAL);
  129. snd_i2c_lock(ice->i2c);
  130. if (snd_i2c_readbytes(ice->spec.i2cdevs[EWS_I2C_PCF2], &data, 1) != 1)
  131. goto __error;
  132. ndata = (data & 0xf0) | chip_mask;
  133. if (ndata != data)
  134. if (snd_i2c_sendbytes(ice->spec.i2cdevs[EWS_I2C_PCF2], &ndata, 1) != 1)
  135. goto __error;
  136. snd_i2c_unlock(ice->i2c);
  137. return 0;
  138. __error:
  139. snd_i2c_unlock(ice->i2c);
  140. snd_printk(KERN_ERR "AK4524 chip select failed, check cable to the front module\n");
  141. return -EIO;
  142. }
  143. /* start callback for EWS88MT, needs to select a certain chip mask */
  144. static void ews88mt_ak4524_lock(struct snd_akm4xxx *ak, int chip)
  145. {
  146. struct snd_ice1712 *ice = ak->private_data[0];
  147. unsigned char tmp;
  148. /* assert AK4524 CS */
  149. if (snd_ice1712_ews88mt_chip_select(ice, ~(1 << chip) & 0x0f) < 0)
  150. snd_printk(KERN_ERR "fatal error (ews88mt chip select)\n");
  151. snd_ice1712_save_gpio_status(ice);
  152. tmp = ICE1712_EWS88_SERIAL_DATA |
  153. ICE1712_EWS88_SERIAL_CLOCK |
  154. ICE1712_EWS88_RW;
  155. snd_ice1712_write(ice, ICE1712_IREG_GPIO_DIRECTION,
  156. ice->gpio.direction | tmp);
  157. snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK, ~tmp);
  158. }
  159. /* stop callback for EWS88MT, needs to deselect chip mask */
  160. static void ews88mt_ak4524_unlock(struct snd_akm4xxx *ak, int chip)
  161. {
  162. struct snd_ice1712 *ice = ak->private_data[0];
  163. snd_ice1712_restore_gpio_status(ice);
  164. udelay(1);
  165. snd_ice1712_ews88mt_chip_select(ice, 0x0f);
  166. }
  167. /* start callback for EWX24/96 */
  168. static void ewx2496_ak4524_lock(struct snd_akm4xxx *ak, int chip)
  169. {
  170. struct snd_ice1712 *ice = ak->private_data[0];
  171. unsigned char tmp;
  172. snd_ice1712_save_gpio_status(ice);
  173. tmp = ICE1712_EWX2496_SERIAL_DATA |
  174. ICE1712_EWX2496_SERIAL_CLOCK |
  175. ICE1712_EWX2496_AK4524_CS |
  176. ICE1712_EWX2496_RW;
  177. snd_ice1712_write(ice, ICE1712_IREG_GPIO_DIRECTION,
  178. ice->gpio.direction | tmp);
  179. snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK, ~tmp);
  180. }
  181. /* start callback for DMX 6fire */
  182. static void dmx6fire_ak4524_lock(struct snd_akm4xxx *ak, int chip)
  183. {
  184. struct snd_ak4xxx_private *priv = (void *)ak->private_value[0];
  185. struct snd_ice1712 *ice = ak->private_data[0];
  186. unsigned char tmp;
  187. snd_ice1712_save_gpio_status(ice);
  188. tmp = priv->cs_mask = priv->cs_addr = (1 << chip) & ICE1712_6FIRE_AK4524_CS_MASK;
  189. tmp |= ICE1712_6FIRE_SERIAL_DATA |
  190. ICE1712_6FIRE_SERIAL_CLOCK |
  191. ICE1712_6FIRE_RW;
  192. snd_ice1712_write(ice, ICE1712_IREG_GPIO_DIRECTION,
  193. ice->gpio.direction | tmp);
  194. snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK, ~tmp);
  195. }
  196. /*
  197. * CS8404 interface on EWS88MT/D
  198. */
  199. static void snd_ice1712_ews_cs8404_spdif_write(struct snd_ice1712 *ice, unsigned char bits)
  200. {
  201. unsigned char bytes[2];
  202. snd_i2c_lock(ice->i2c);
  203. switch (ice->eeprom.subvendor) {
  204. case ICE1712_SUBDEVICE_EWS88MT:
  205. case ICE1712_SUBDEVICE_EWS88MT_NEW:
  206. case ICE1712_SUBDEVICE_PHASE88:
  207. if (snd_i2c_sendbytes(ice->spec.i2cdevs[EWS_I2C_CS8404], &bits, 1) != 1)
  208. goto _error;
  209. break;
  210. case ICE1712_SUBDEVICE_EWS88D:
  211. if (snd_i2c_readbytes(ice->spec.i2cdevs[EWS_I2C_88D], bytes, 2) != 2)
  212. goto _error;
  213. if (bits != bytes[1]) {
  214. bytes[1] = bits;
  215. if (snd_i2c_sendbytes(ice->spec.i2cdevs[EWS_I2C_88D], bytes, 2) != 2)
  216. goto _error;
  217. }
  218. break;
  219. }
  220. _error:
  221. snd_i2c_unlock(ice->i2c);
  222. }
  223. /*
  224. */
  225. static void ews88_spdif_default_get(struct snd_ice1712 *ice, struct snd_ctl_elem_value *ucontrol)
  226. {
  227. snd_cs8404_decode_spdif_bits(&ucontrol->value.iec958, ice->spdif.cs8403_bits);
  228. }
  229. static int ews88_spdif_default_put(struct snd_ice1712 *ice, struct snd_ctl_elem_value *ucontrol)
  230. {
  231. unsigned int val;
  232. int change;
  233. val = snd_cs8404_encode_spdif_bits(&ucontrol->value.iec958);
  234. spin_lock_irq(&ice->reg_lock);
  235. change = ice->spdif.cs8403_bits != val;
  236. ice->spdif.cs8403_bits = val;
  237. if (change && ice->playback_pro_substream == NULL) {
  238. spin_unlock_irq(&ice->reg_lock);
  239. snd_ice1712_ews_cs8404_spdif_write(ice, val);
  240. } else {
  241. spin_unlock_irq(&ice->reg_lock);
  242. }
  243. return change;
  244. }
  245. static void ews88_spdif_stream_get(struct snd_ice1712 *ice, struct snd_ctl_elem_value *ucontrol)
  246. {
  247. snd_cs8404_decode_spdif_bits(&ucontrol->value.iec958, ice->spdif.cs8403_stream_bits);
  248. }
  249. static int ews88_spdif_stream_put(struct snd_ice1712 *ice, struct snd_ctl_elem_value *ucontrol)
  250. {
  251. unsigned int val;
  252. int change;
  253. val = snd_cs8404_encode_spdif_bits(&ucontrol->value.iec958);
  254. spin_lock_irq(&ice->reg_lock);
  255. change = ice->spdif.cs8403_stream_bits != val;
  256. ice->spdif.cs8403_stream_bits = val;
  257. if (change && ice->playback_pro_substream != NULL) {
  258. spin_unlock_irq(&ice->reg_lock);
  259. snd_ice1712_ews_cs8404_spdif_write(ice, val);
  260. } else {
  261. spin_unlock_irq(&ice->reg_lock);
  262. }
  263. return change;
  264. }
  265. /* open callback */
  266. static void ews88_open_spdif(struct snd_ice1712 *ice, struct snd_pcm_substream *substream)
  267. {
  268. ice->spdif.cs8403_stream_bits = ice->spdif.cs8403_bits;
  269. }
  270. /* set up SPDIF for EWS88MT / EWS88D */
  271. static void ews88_setup_spdif(struct snd_ice1712 *ice, int rate)
  272. {
  273. unsigned long flags;
  274. unsigned char tmp;
  275. int change;
  276. spin_lock_irqsave(&ice->reg_lock, flags);
  277. tmp = ice->spdif.cs8403_stream_bits;
  278. if (tmp & 0x10) /* consumer */
  279. tmp &= (tmp & 0x01) ? ~0x06 : ~0x60;
  280. switch (rate) {
  281. case 32000: tmp |= (tmp & 0x01) ? 0x02 : 0x00; break;
  282. case 44100: tmp |= (tmp & 0x01) ? 0x06 : 0x40; break;
  283. case 48000: tmp |= (tmp & 0x01) ? 0x04 : 0x20; break;
  284. default: tmp |= (tmp & 0x01) ? 0x06 : 0x40; break;
  285. }
  286. change = ice->spdif.cs8403_stream_bits != tmp;
  287. ice->spdif.cs8403_stream_bits = tmp;
  288. spin_unlock_irqrestore(&ice->reg_lock, flags);
  289. if (change)
  290. snd_ctl_notify(ice->card, SNDRV_CTL_EVENT_MASK_VALUE, &ice->spdif.stream_ctl->id);
  291. snd_ice1712_ews_cs8404_spdif_write(ice, tmp);
  292. }
  293. /*
  294. */
  295. static struct snd_akm4xxx akm_ews88mt __devinitdata = {
  296. .num_adcs = 8,
  297. .num_dacs = 8,
  298. .type = SND_AK4524,
  299. .ops = {
  300. .lock = ews88mt_ak4524_lock,
  301. .unlock = ews88mt_ak4524_unlock
  302. }
  303. };
  304. static struct snd_ak4xxx_private akm_ews88mt_priv __devinitdata = {
  305. .caddr = 2,
  306. .cif = 1, /* CIF high */
  307. .data_mask = ICE1712_EWS88_SERIAL_DATA,
  308. .clk_mask = ICE1712_EWS88_SERIAL_CLOCK,
  309. .cs_mask = 0,
  310. .cs_addr = 0,
  311. .cs_none = 0, /* no chip select on gpio */
  312. .add_flags = ICE1712_EWS88_RW, /* set rw bit high */
  313. .mask_flags = 0,
  314. };
  315. static struct snd_akm4xxx akm_ewx2496 __devinitdata = {
  316. .num_adcs = 2,
  317. .num_dacs = 2,
  318. .type = SND_AK4524,
  319. .ops = {
  320. .lock = ewx2496_ak4524_lock
  321. }
  322. };
  323. static struct snd_ak4xxx_private akm_ewx2496_priv __devinitdata = {
  324. .caddr = 2,
  325. .cif = 1, /* CIF high */
  326. .data_mask = ICE1712_EWS88_SERIAL_DATA,
  327. .clk_mask = ICE1712_EWS88_SERIAL_CLOCK,
  328. .cs_mask = ICE1712_EWX2496_AK4524_CS,
  329. .cs_addr = ICE1712_EWX2496_AK4524_CS,
  330. .cs_none = 0,
  331. .add_flags = ICE1712_EWS88_RW, /* set rw bit high */
  332. .mask_flags = 0,
  333. };
  334. static struct snd_akm4xxx akm_6fire __devinitdata = {
  335. .num_adcs = 6,
  336. .num_dacs = 6,
  337. .type = SND_AK4524,
  338. .ops = {
  339. .lock = dmx6fire_ak4524_lock
  340. }
  341. };
  342. static struct snd_ak4xxx_private akm_6fire_priv __devinitdata = {
  343. .caddr = 2,
  344. .cif = 1, /* CIF high */
  345. .data_mask = ICE1712_6FIRE_SERIAL_DATA,
  346. .clk_mask = ICE1712_6FIRE_SERIAL_CLOCK,
  347. .cs_mask = 0,
  348. .cs_addr = 0, /* set later */
  349. .cs_none = 0,
  350. .add_flags = ICE1712_6FIRE_RW, /* set rw bit high */
  351. .mask_flags = 0,
  352. };
  353. /*
  354. * initialize the chip
  355. */
  356. /* 6fire specific */
  357. #define PCF9554_REG_INPUT 0
  358. #define PCF9554_REG_OUTPUT 1
  359. #define PCF9554_REG_POLARITY 2
  360. #define PCF9554_REG_CONFIG 3
  361. static int snd_ice1712_6fire_write_pca(struct snd_ice1712 *ice, unsigned char reg, unsigned char data);
  362. static int __devinit snd_ice1712_ews_init(struct snd_ice1712 *ice)
  363. {
  364. int err;
  365. struct snd_akm4xxx *ak;
  366. /* set the analog DACs */
  367. switch (ice->eeprom.subvendor) {
  368. case ICE1712_SUBDEVICE_EWX2496:
  369. ice->num_total_dacs = 2;
  370. ice->num_total_adcs = 2;
  371. break;
  372. case ICE1712_SUBDEVICE_EWS88MT:
  373. case ICE1712_SUBDEVICE_EWS88MT_NEW:
  374. case ICE1712_SUBDEVICE_PHASE88:
  375. ice->num_total_dacs = 8;
  376. ice->num_total_adcs = 8;
  377. break;
  378. case ICE1712_SUBDEVICE_EWS88D:
  379. /* Note: not analog but ADAT I/O */
  380. ice->num_total_dacs = 8;
  381. ice->num_total_adcs = 8;
  382. break;
  383. case ICE1712_SUBDEVICE_DMX6FIRE:
  384. ice->num_total_dacs = 6;
  385. ice->num_total_adcs = 6;
  386. break;
  387. }
  388. /* create i2c */
  389. if ((err = snd_i2c_bus_create(ice->card, "ICE1712 GPIO 1", NULL, &ice->i2c)) < 0) {
  390. snd_printk(KERN_ERR "unable to create I2C bus\n");
  391. return err;
  392. }
  393. ice->i2c->private_data = ice;
  394. ice->i2c->hw_ops.bit = &snd_ice1712_ewx_cs8427_bit_ops;
  395. /* create i2c devices */
  396. switch (ice->eeprom.subvendor) {
  397. case ICE1712_SUBDEVICE_DMX6FIRE:
  398. if ((err = snd_i2c_device_create(ice->i2c, "PCF9554", ICE1712_6FIRE_PCF9554_ADDR, &ice->spec.i2cdevs[EWS_I2C_6FIRE])) < 0) {
  399. snd_printk(KERN_ERR "PCF9554 initialization failed\n");
  400. return err;
  401. }
  402. snd_ice1712_6fire_write_pca(ice, PCF9554_REG_CONFIG, 0x80);
  403. break;
  404. case ICE1712_SUBDEVICE_EWS88MT:
  405. case ICE1712_SUBDEVICE_EWS88MT_NEW:
  406. case ICE1712_SUBDEVICE_PHASE88:
  407. if ((err = snd_i2c_device_create(ice->i2c, "CS8404", ICE1712_EWS88MT_CS8404_ADDR, &ice->spec.i2cdevs[EWS_I2C_CS8404])) < 0)
  408. return err;
  409. if ((err = snd_i2c_device_create(ice->i2c, "PCF8574 (1st)", ICE1712_EWS88MT_INPUT_ADDR, &ice->spec.i2cdevs[EWS_I2C_PCF1])) < 0)
  410. return err;
  411. if ((err = snd_i2c_device_create(ice->i2c, "PCF8574 (2nd)", ICE1712_EWS88MT_OUTPUT_ADDR, &ice->spec.i2cdevs[EWS_I2C_PCF2])) < 0)
  412. return err;
  413. /* Check if the front module is connected */
  414. if ((err = snd_ice1712_ews88mt_chip_select(ice, 0x0f)) < 0)
  415. return err;
  416. break;
  417. case ICE1712_SUBDEVICE_EWS88D:
  418. if ((err = snd_i2c_device_create(ice->i2c, "PCF8575", ICE1712_EWS88D_PCF_ADDR, &ice->spec.i2cdevs[EWS_I2C_88D])) < 0)
  419. return err;
  420. break;
  421. }
  422. /* set up SPDIF interface */
  423. switch (ice->eeprom.subvendor) {
  424. case ICE1712_SUBDEVICE_EWX2496:
  425. if ((err = snd_ice1712_init_cs8427(ice, CS8427_BASE_ADDR)) < 0)
  426. return err;
  427. snd_cs8427_reg_write(ice->cs8427, CS8427_REG_RECVERRMASK, CS8427_UNLOCK | CS8427_CONF | CS8427_BIP | CS8427_PAR);
  428. break;
  429. case ICE1712_SUBDEVICE_DMX6FIRE:
  430. if ((err = snd_ice1712_init_cs8427(ice, ICE1712_6FIRE_CS8427_ADDR)) < 0)
  431. return err;
  432. snd_cs8427_reg_write(ice->cs8427, CS8427_REG_RECVERRMASK, CS8427_UNLOCK | CS8427_CONF | CS8427_BIP | CS8427_PAR);
  433. break;
  434. case ICE1712_SUBDEVICE_EWS88MT:
  435. case ICE1712_SUBDEVICE_EWS88MT_NEW:
  436. case ICE1712_SUBDEVICE_PHASE88:
  437. case ICE1712_SUBDEVICE_EWS88D:
  438. /* set up CS8404 */
  439. ice->spdif.ops.open = ews88_open_spdif;
  440. ice->spdif.ops.setup_rate = ews88_setup_spdif;
  441. ice->spdif.ops.default_get = ews88_spdif_default_get;
  442. ice->spdif.ops.default_put = ews88_spdif_default_put;
  443. ice->spdif.ops.stream_get = ews88_spdif_stream_get;
  444. ice->spdif.ops.stream_put = ews88_spdif_stream_put;
  445. /* Set spdif defaults */
  446. snd_ice1712_ews_cs8404_spdif_write(ice, ice->spdif.cs8403_bits);
  447. break;
  448. }
  449. /* no analog? */
  450. switch (ice->eeprom.subvendor) {
  451. case ICE1712_SUBDEVICE_EWS88D:
  452. return 0;
  453. }
  454. /* analog section */
  455. ak = ice->akm = kmalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL);
  456. if (! ak)
  457. return -ENOMEM;
  458. ice->akm_codecs = 1;
  459. switch (ice->eeprom.subvendor) {
  460. case ICE1712_SUBDEVICE_EWS88MT:
  461. case ICE1712_SUBDEVICE_EWS88MT_NEW:
  462. case ICE1712_SUBDEVICE_PHASE88:
  463. err = snd_ice1712_akm4xxx_init(ak, &akm_ews88mt, &akm_ews88mt_priv, ice);
  464. break;
  465. case ICE1712_SUBDEVICE_EWX2496:
  466. err = snd_ice1712_akm4xxx_init(ak, &akm_ewx2496, &akm_ewx2496_priv, ice);
  467. break;
  468. case ICE1712_SUBDEVICE_DMX6FIRE:
  469. err = snd_ice1712_akm4xxx_init(ak, &akm_6fire, &akm_6fire_priv, ice);
  470. break;
  471. default:
  472. err = 0;
  473. }
  474. return err;
  475. }
  476. /*
  477. * EWX 24/96 specific controls
  478. */
  479. /* i/o sensitivity - this callback is shared among other devices, too */
  480. static int snd_ice1712_ewx_io_sense_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo){
  481. static char *texts[2] = {
  482. "+4dBu", "-10dBV",
  483. };
  484. uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
  485. uinfo->count = 1;
  486. uinfo->value.enumerated.items = 2;
  487. if (uinfo->value.enumerated.item >= 2)
  488. uinfo->value.enumerated.item = 1;
  489. strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
  490. return 0;
  491. }
  492. static int snd_ice1712_ewx_io_sense_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
  493. {
  494. struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
  495. unsigned char mask = kcontrol->private_value & 0xff;
  496. snd_ice1712_save_gpio_status(ice);
  497. ucontrol->value.enumerated.item[0] = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA) & mask ? 1 : 0;
  498. snd_ice1712_restore_gpio_status(ice);
  499. return 0;
  500. }
  501. static int snd_ice1712_ewx_io_sense_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
  502. {
  503. struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
  504. unsigned char mask = kcontrol->private_value & 0xff;
  505. int val, nval;
  506. if (kcontrol->private_value & (1 << 31))
  507. return -EPERM;
  508. nval = ucontrol->value.enumerated.item[0] ? mask : 0;
  509. snd_ice1712_save_gpio_status(ice);
  510. val = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA);
  511. nval |= val & ~mask;
  512. snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, nval);
  513. snd_ice1712_restore_gpio_status(ice);
  514. return val != nval;
  515. }
  516. static struct snd_kcontrol_new snd_ice1712_ewx2496_controls[] __devinitdata = {
  517. {
  518. .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  519. .name = "Input Sensitivity Switch",
  520. .info = snd_ice1712_ewx_io_sense_info,
  521. .get = snd_ice1712_ewx_io_sense_get,
  522. .put = snd_ice1712_ewx_io_sense_put,
  523. .private_value = ICE1712_EWX2496_AIN_SEL,
  524. },
  525. {
  526. .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  527. .name = "Output Sensitivity Switch",
  528. .info = snd_ice1712_ewx_io_sense_info,
  529. .get = snd_ice1712_ewx_io_sense_get,
  530. .put = snd_ice1712_ewx_io_sense_put,
  531. .private_value = ICE1712_EWX2496_AOUT_SEL,
  532. },
  533. };
  534. /*
  535. * EWS88MT specific controls
  536. */
  537. /* analog output sensitivity;; address 0x48 bit 6 */
  538. static int snd_ice1712_ews88mt_output_sense_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
  539. {
  540. struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
  541. unsigned char data;
  542. snd_i2c_lock(ice->i2c);
  543. if (snd_i2c_readbytes(ice->spec.i2cdevs[EWS_I2C_PCF2], &data, 1) != 1) {
  544. snd_i2c_unlock(ice->i2c);
  545. return -EIO;
  546. }
  547. snd_i2c_unlock(ice->i2c);
  548. ucontrol->value.enumerated.item[0] = data & ICE1712_EWS88MT_OUTPUT_SENSE ? 1 : 0; /* high = -10dBV, low = +4dBu */
  549. return 0;
  550. }
  551. /* analog output sensitivity;; address 0x48 bit 6 */
  552. static int snd_ice1712_ews88mt_output_sense_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
  553. {
  554. struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
  555. unsigned char data, ndata;
  556. snd_i2c_lock(ice->i2c);
  557. if (snd_i2c_readbytes(ice->spec.i2cdevs[EWS_I2C_PCF2], &data, 1) != 1) {
  558. snd_i2c_unlock(ice->i2c);
  559. return -EIO;
  560. }
  561. ndata = (data & ~ICE1712_EWS88MT_OUTPUT_SENSE) | (ucontrol->value.enumerated.item[0] ? ICE1712_EWS88MT_OUTPUT_SENSE : 0);
  562. if (ndata != data && snd_i2c_sendbytes(ice->spec.i2cdevs[EWS_I2C_PCF2], &ndata, 1) != 1) {
  563. snd_i2c_unlock(ice->i2c);
  564. return -EIO;
  565. }
  566. snd_i2c_unlock(ice->i2c);
  567. return ndata != data;
  568. }
  569. /* analog input sensitivity; address 0x46 */
  570. static int snd_ice1712_ews88mt_input_sense_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
  571. {
  572. struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
  573. int channel = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
  574. unsigned char data;
  575. snd_assert(channel >= 0 && channel <= 7, return 0);
  576. snd_i2c_lock(ice->i2c);
  577. if (snd_i2c_readbytes(ice->spec.i2cdevs[EWS_I2C_PCF1], &data, 1) != 1) {
  578. snd_i2c_unlock(ice->i2c);
  579. return -EIO;
  580. }
  581. /* reversed; high = +4dBu, low = -10dBV */
  582. ucontrol->value.enumerated.item[0] = data & (1 << channel) ? 0 : 1;
  583. snd_i2c_unlock(ice->i2c);
  584. return 0;
  585. }
  586. /* analog output sensitivity; address 0x46 */
  587. static int snd_ice1712_ews88mt_input_sense_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
  588. {
  589. struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
  590. int channel = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
  591. unsigned char data, ndata;
  592. snd_assert(channel >= 0 && channel <= 7, return 0);
  593. snd_i2c_lock(ice->i2c);
  594. if (snd_i2c_readbytes(ice->spec.i2cdevs[EWS_I2C_PCF1], &data, 1) != 1) {
  595. snd_i2c_unlock(ice->i2c);
  596. return -EIO;
  597. }
  598. ndata = (data & ~(1 << channel)) | (ucontrol->value.enumerated.item[0] ? 0 : (1 << channel));
  599. if (ndata != data && snd_i2c_sendbytes(ice->spec.i2cdevs[EWS_I2C_PCF1], &ndata, 1) != 1) {
  600. snd_i2c_unlock(ice->i2c);
  601. return -EIO;
  602. }
  603. snd_i2c_unlock(ice->i2c);
  604. return ndata != data;
  605. }
  606. static struct snd_kcontrol_new snd_ice1712_ews88mt_input_sense __devinitdata = {
  607. .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  608. .name = "Input Sensitivity Switch",
  609. .info = snd_ice1712_ewx_io_sense_info,
  610. .get = snd_ice1712_ews88mt_input_sense_get,
  611. .put = snd_ice1712_ews88mt_input_sense_put,
  612. .count = 8,
  613. };
  614. static struct snd_kcontrol_new snd_ice1712_ews88mt_output_sense __devinitdata = {
  615. .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  616. .name = "Output Sensitivity Switch",
  617. .info = snd_ice1712_ewx_io_sense_info,
  618. .get = snd_ice1712_ews88mt_output_sense_get,
  619. .put = snd_ice1712_ews88mt_output_sense_put,
  620. };
  621. /*
  622. * EWS88D specific controls
  623. */
  624. #define snd_ice1712_ews88d_control_info snd_ctl_boolean_mono_info
  625. static int snd_ice1712_ews88d_control_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
  626. {
  627. struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
  628. int shift = kcontrol->private_value & 0xff;
  629. int invert = (kcontrol->private_value >> 8) & 1;
  630. unsigned char data[2];
  631. snd_i2c_lock(ice->i2c);
  632. if (snd_i2c_readbytes(ice->spec.i2cdevs[EWS_I2C_88D], data, 2) != 2) {
  633. snd_i2c_unlock(ice->i2c);
  634. return -EIO;
  635. }
  636. snd_i2c_unlock(ice->i2c);
  637. data[0] = (data[shift >> 3] >> (shift & 7)) & 0x01;
  638. if (invert)
  639. data[0] ^= 0x01;
  640. ucontrol->value.integer.value[0] = data[0];
  641. return 0;
  642. }
  643. static int snd_ice1712_ews88d_control_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
  644. {
  645. struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
  646. int shift = kcontrol->private_value & 0xff;
  647. int invert = (kcontrol->private_value >> 8) & 1;
  648. unsigned char data[2], ndata[2];
  649. int change;
  650. snd_i2c_lock(ice->i2c);
  651. if (snd_i2c_readbytes(ice->spec.i2cdevs[EWS_I2C_88D], data, 2) != 2) {
  652. snd_i2c_unlock(ice->i2c);
  653. return -EIO;
  654. }
  655. ndata[shift >> 3] = data[shift >> 3] & ~(1 << (shift & 7));
  656. if (invert) {
  657. if (! ucontrol->value.integer.value[0])
  658. ndata[shift >> 3] |= (1 << (shift & 7));
  659. } else {
  660. if (ucontrol->value.integer.value[0])
  661. ndata[shift >> 3] |= (1 << (shift & 7));
  662. }
  663. change = (data[shift >> 3] != ndata[shift >> 3]);
  664. if (change && snd_i2c_sendbytes(ice->spec.i2cdevs[EWS_I2C_88D], data, 2) != 2) {
  665. snd_i2c_unlock(ice->i2c);
  666. return -EIO;
  667. }
  668. snd_i2c_unlock(ice->i2c);
  669. return change;
  670. }
  671. #define EWS88D_CONTROL(xiface, xname, xshift, xinvert, xaccess) \
  672. { .iface = xiface,\
  673. .name = xname,\
  674. .access = xaccess,\
  675. .info = snd_ice1712_ews88d_control_info,\
  676. .get = snd_ice1712_ews88d_control_get,\
  677. .put = snd_ice1712_ews88d_control_put,\
  678. .private_value = xshift | (xinvert << 8),\
  679. }
  680. static struct snd_kcontrol_new snd_ice1712_ews88d_controls[] __devinitdata = {
  681. EWS88D_CONTROL(SNDRV_CTL_ELEM_IFACE_MIXER, "IEC958 Input Optical", 0, 1, 0), /* inverted */
  682. EWS88D_CONTROL(SNDRV_CTL_ELEM_IFACE_MIXER, "ADAT Output Optical", 1, 0, 0),
  683. EWS88D_CONTROL(SNDRV_CTL_ELEM_IFACE_MIXER, "ADAT External Master Clock", 2, 0, 0),
  684. EWS88D_CONTROL(SNDRV_CTL_ELEM_IFACE_MIXER, "Enable ADAT", 3, 0, 0),
  685. EWS88D_CONTROL(SNDRV_CTL_ELEM_IFACE_MIXER, "ADAT Through", 4, 1, 0),
  686. };
  687. /*
  688. * DMX 6Fire specific controls
  689. */
  690. static int snd_ice1712_6fire_read_pca(struct snd_ice1712 *ice, unsigned char reg)
  691. {
  692. unsigned char byte;
  693. snd_i2c_lock(ice->i2c);
  694. byte = reg;
  695. snd_i2c_sendbytes(ice->spec.i2cdevs[EWS_I2C_6FIRE], &byte, 1);
  696. byte = 0;
  697. if (snd_i2c_readbytes(ice->spec.i2cdevs[EWS_I2C_6FIRE], &byte, 1) != 1) {
  698. snd_i2c_unlock(ice->i2c);
  699. printk(KERN_ERR "cannot read pca\n");
  700. return -EIO;
  701. }
  702. snd_i2c_unlock(ice->i2c);
  703. return byte;
  704. }
  705. static int snd_ice1712_6fire_write_pca(struct snd_ice1712 *ice, unsigned char reg, unsigned char data)
  706. {
  707. unsigned char bytes[2];
  708. snd_i2c_lock(ice->i2c);
  709. bytes[0] = reg;
  710. bytes[1] = data;
  711. if (snd_i2c_sendbytes(ice->spec.i2cdevs[EWS_I2C_6FIRE], bytes, 2) != 2) {
  712. snd_i2c_unlock(ice->i2c);
  713. return -EIO;
  714. }
  715. snd_i2c_unlock(ice->i2c);
  716. return 0;
  717. }
  718. #define snd_ice1712_6fire_control_info snd_ctl_boolean_mono_info
  719. static int snd_ice1712_6fire_control_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
  720. {
  721. struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
  722. int shift = kcontrol->private_value & 0xff;
  723. int invert = (kcontrol->private_value >> 8) & 1;
  724. int data;
  725. if ((data = snd_ice1712_6fire_read_pca(ice, PCF9554_REG_OUTPUT)) < 0)
  726. return data;
  727. data = (data >> shift) & 1;
  728. if (invert)
  729. data ^= 1;
  730. ucontrol->value.integer.value[0] = data;
  731. return 0;
  732. }
  733. static int snd_ice1712_6fire_control_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
  734. {
  735. struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
  736. int shift = kcontrol->private_value & 0xff;
  737. int invert = (kcontrol->private_value >> 8) & 1;
  738. int data, ndata;
  739. if ((data = snd_ice1712_6fire_read_pca(ice, PCF9554_REG_OUTPUT)) < 0)
  740. return data;
  741. ndata = data & ~(1 << shift);
  742. if (ucontrol->value.integer.value[0])
  743. ndata |= (1 << shift);
  744. if (invert)
  745. ndata ^= (1 << shift);
  746. if (data != ndata) {
  747. snd_ice1712_6fire_write_pca(ice, PCF9554_REG_OUTPUT, (unsigned char)ndata);
  748. return 1;
  749. }
  750. return 0;
  751. }
  752. static int snd_ice1712_6fire_select_input_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
  753. {
  754. static char *texts[4] = {
  755. "Internal", "Front Input", "Rear Input", "Wave Table"
  756. };
  757. uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
  758. uinfo->count = 1;
  759. uinfo->value.enumerated.items = 4;
  760. if (uinfo->value.enumerated.item >= 4)
  761. uinfo->value.enumerated.item = 1;
  762. strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
  763. return 0;
  764. }
  765. static int snd_ice1712_6fire_select_input_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
  766. {
  767. struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
  768. int data;
  769. if ((data = snd_ice1712_6fire_read_pca(ice, PCF9554_REG_OUTPUT)) < 0)
  770. return data;
  771. ucontrol->value.integer.value[0] = data & 3;
  772. return 0;
  773. }
  774. static int snd_ice1712_6fire_select_input_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
  775. {
  776. struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
  777. int data, ndata;
  778. if ((data = snd_ice1712_6fire_read_pca(ice, PCF9554_REG_OUTPUT)) < 0)
  779. return data;
  780. ndata = data & ~3;
  781. ndata |= (ucontrol->value.integer.value[0] & 3);
  782. if (data != ndata) {
  783. snd_ice1712_6fire_write_pca(ice, PCF9554_REG_OUTPUT, (unsigned char)ndata);
  784. return 1;
  785. }
  786. return 0;
  787. }
  788. #define DMX6FIRE_CONTROL(xname, xshift, xinvert) \
  789. { .iface = SNDRV_CTL_ELEM_IFACE_MIXER,\
  790. .name = xname,\
  791. .info = snd_ice1712_6fire_control_info,\
  792. .get = snd_ice1712_6fire_control_get,\
  793. .put = snd_ice1712_6fire_control_put,\
  794. .private_value = xshift | (xinvert << 8),\
  795. }
  796. static struct snd_kcontrol_new snd_ice1712_6fire_controls[] __devinitdata = {
  797. {
  798. .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  799. .name = "Analog Input Select",
  800. .info = snd_ice1712_6fire_select_input_info,
  801. .get = snd_ice1712_6fire_select_input_get,
  802. .put = snd_ice1712_6fire_select_input_put,
  803. },
  804. DMX6FIRE_CONTROL("Front Digital Input Switch", 2, 1),
  805. // DMX6FIRE_CONTROL("Master Clock Select", 3, 0),
  806. DMX6FIRE_CONTROL("Optical Digital Input Switch", 4, 0),
  807. DMX6FIRE_CONTROL("Phono Analog Input Switch", 5, 0),
  808. DMX6FIRE_CONTROL("Breakbox LED", 6, 0),
  809. };
  810. static int __devinit snd_ice1712_ews_add_controls(struct snd_ice1712 *ice)
  811. {
  812. unsigned int idx;
  813. int err;
  814. /* all terratec cards have spdif, but cs8427 module builds it's own controls */
  815. if (ice->cs8427 == NULL) {
  816. err = snd_ice1712_spdif_build_controls(ice);
  817. if (err < 0)
  818. return err;
  819. }
  820. /* ak4524 controls */
  821. switch (ice->eeprom.subvendor) {
  822. case ICE1712_SUBDEVICE_EWX2496:
  823. case ICE1712_SUBDEVICE_EWS88MT:
  824. case ICE1712_SUBDEVICE_EWS88MT_NEW:
  825. case ICE1712_SUBDEVICE_PHASE88:
  826. case ICE1712_SUBDEVICE_DMX6FIRE:
  827. err = snd_ice1712_akm4xxx_build_controls(ice);
  828. if (err < 0)
  829. return err;
  830. break;
  831. }
  832. /* card specific controls */
  833. switch (ice->eeprom.subvendor) {
  834. case ICE1712_SUBDEVICE_EWX2496:
  835. for (idx = 0; idx < ARRAY_SIZE(snd_ice1712_ewx2496_controls); idx++) {
  836. err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_ewx2496_controls[idx], ice));
  837. if (err < 0)
  838. return err;
  839. }
  840. break;
  841. case ICE1712_SUBDEVICE_EWS88MT:
  842. case ICE1712_SUBDEVICE_EWS88MT_NEW:
  843. case ICE1712_SUBDEVICE_PHASE88:
  844. err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_ews88mt_input_sense, ice));
  845. if (err < 0)
  846. return err;
  847. err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_ews88mt_output_sense, ice));
  848. if (err < 0)
  849. return err;
  850. break;
  851. case ICE1712_SUBDEVICE_EWS88D:
  852. for (idx = 0; idx < ARRAY_SIZE(snd_ice1712_ews88d_controls); idx++) {
  853. err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_ews88d_controls[idx], ice));
  854. if (err < 0)
  855. return err;
  856. }
  857. break;
  858. case ICE1712_SUBDEVICE_DMX6FIRE:
  859. for (idx = 0; idx < ARRAY_SIZE(snd_ice1712_6fire_controls); idx++) {
  860. err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_6fire_controls[idx], ice));
  861. if (err < 0)
  862. return err;
  863. }
  864. break;
  865. }
  866. return 0;
  867. }
  868. /* entry point */
  869. struct snd_ice1712_card_info snd_ice1712_ews_cards[] __devinitdata = {
  870. {
  871. .subvendor = ICE1712_SUBDEVICE_EWX2496,
  872. .name = "TerraTec EWX24/96",
  873. .model = "ewx2496",
  874. .chip_init = snd_ice1712_ews_init,
  875. .build_controls = snd_ice1712_ews_add_controls,
  876. },
  877. {
  878. .subvendor = ICE1712_SUBDEVICE_EWS88MT,
  879. .name = "TerraTec EWS88MT",
  880. .model = "ews88mt",
  881. .chip_init = snd_ice1712_ews_init,
  882. .build_controls = snd_ice1712_ews_add_controls,
  883. },
  884. {
  885. .subvendor = ICE1712_SUBDEVICE_EWS88MT_NEW,
  886. .name = "TerraTec EWS88MT",
  887. .model = "ews88mt_new",
  888. .chip_init = snd_ice1712_ews_init,
  889. .build_controls = snd_ice1712_ews_add_controls,
  890. },
  891. {
  892. .subvendor = ICE1712_SUBDEVICE_PHASE88,
  893. .name = "TerraTec Phase88",
  894. .model = "phase88",
  895. .chip_init = snd_ice1712_ews_init,
  896. .build_controls = snd_ice1712_ews_add_controls,
  897. },
  898. {
  899. .subvendor = ICE1712_SUBDEVICE_EWS88D,
  900. .name = "TerraTec EWS88D",
  901. .model = "ews88d",
  902. .chip_init = snd_ice1712_ews_init,
  903. .build_controls = snd_ice1712_ews_add_controls,
  904. },
  905. {
  906. .subvendor = ICE1712_SUBDEVICE_DMX6FIRE,
  907. .name = "TerraTec DMX6Fire",
  908. .model = "dmx6fire",
  909. .chip_init = snd_ice1712_ews_init,
  910. .build_controls = snd_ice1712_ews_add_controls,
  911. .mpu401_1_name = "MIDI-Front DMX6fire",
  912. .mpu401_2_name = "Wavetable DMX6fire",
  913. .mpu401_2_info_flags = MPU401_INFO_OUTPUT,
  914. },
  915. { } /* terminator */
  916. };