wtm.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * ALSA driver for ICEnsemble VT1724 (Envy24HT)
  4. *
  5. * Lowlevel functions for Ego Sys Waveterminal 192M
  6. *
  7. * Copyright (c) 2006 Guedez Clement <[email protected]>
  8. * Some functions are taken from the Prodigy192 driver
  9. * source
  10. */
  11. #include <linux/delay.h>
  12. #include <linux/interrupt.h>
  13. #include <linux/init.h>
  14. #include <sound/core.h>
  15. #include <sound/tlv.h>
  16. #include <linux/slab.h>
  17. #include "ice1712.h"
  18. #include "envy24ht.h"
  19. #include "wtm.h"
  20. #include "stac946x.h"
  21. struct wtm_spec {
  22. /* rate change needs atomic mute/unmute of all dacs*/
  23. struct mutex mute_mutex;
  24. };
  25. /*
  26. * 2*ADC 6*DAC no1 ringbuffer r/w on i2c bus
  27. */
  28. static inline void stac9460_put(struct snd_ice1712 *ice, int reg,
  29. unsigned char val)
  30. {
  31. snd_vt1724_write_i2c(ice, STAC9460_I2C_ADDR, reg, val);
  32. }
  33. static inline unsigned char stac9460_get(struct snd_ice1712 *ice, int reg)
  34. {
  35. return snd_vt1724_read_i2c(ice, STAC9460_I2C_ADDR, reg);
  36. }
  37. /*
  38. * 2*ADC 2*DAC no2 ringbuffer r/w on i2c bus
  39. */
  40. static inline void stac9460_2_put(struct snd_ice1712 *ice, int reg,
  41. unsigned char val)
  42. {
  43. snd_vt1724_write_i2c(ice, STAC9460_2_I2C_ADDR, reg, val);
  44. }
  45. static inline unsigned char stac9460_2_get(struct snd_ice1712 *ice, int reg)
  46. {
  47. return snd_vt1724_read_i2c(ice, STAC9460_2_I2C_ADDR, reg);
  48. }
  49. /*
  50. * DAC mute control
  51. */
  52. static void stac9460_dac_mute_all(struct snd_ice1712 *ice, unsigned char mute,
  53. unsigned short int *change_mask)
  54. {
  55. unsigned char new, old;
  56. int id, idx, change;
  57. /*stac9460 1*/
  58. for (id = 0; id < 7; id++) {
  59. if (*change_mask & (0x01 << id)) {
  60. if (id == 0)
  61. idx = STAC946X_MASTER_VOLUME;
  62. else
  63. idx = STAC946X_LF_VOLUME - 1 + id;
  64. old = stac9460_get(ice, idx);
  65. new = (~mute << 7 & 0x80) | (old & ~0x80);
  66. change = (new != old);
  67. if (change) {
  68. stac9460_put(ice, idx, new);
  69. *change_mask = *change_mask | (0x01 << id);
  70. } else {
  71. *change_mask = *change_mask & ~(0x01 << id);
  72. }
  73. }
  74. }
  75. /*stac9460 2*/
  76. for (id = 0; id < 3; id++) {
  77. if (*change_mask & (0x01 << (id + 7))) {
  78. if (id == 0)
  79. idx = STAC946X_MASTER_VOLUME;
  80. else
  81. idx = STAC946X_LF_VOLUME - 1 + id;
  82. old = stac9460_2_get(ice, idx);
  83. new = (~mute << 7 & 0x80) | (old & ~0x80);
  84. change = (new != old);
  85. if (change) {
  86. stac9460_2_put(ice, idx, new);
  87. *change_mask = *change_mask | (0x01 << id);
  88. } else {
  89. *change_mask = *change_mask & ~(0x01 << id);
  90. }
  91. }
  92. }
  93. }
  94. #define stac9460_dac_mute_info snd_ctl_boolean_mono_info
  95. static int stac9460_dac_mute_get(struct snd_kcontrol *kcontrol,
  96. struct snd_ctl_elem_value *ucontrol)
  97. {
  98. struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
  99. struct wtm_spec *spec = ice->spec;
  100. unsigned char val;
  101. int idx, id;
  102. mutex_lock(&spec->mute_mutex);
  103. if (kcontrol->private_value) {
  104. idx = STAC946X_MASTER_VOLUME;
  105. id = 0;
  106. } else {
  107. id = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
  108. idx = id + STAC946X_LF_VOLUME;
  109. }
  110. if (id < 6)
  111. val = stac9460_get(ice, idx);
  112. else
  113. val = stac9460_2_get(ice, idx - 6);
  114. ucontrol->value.integer.value[0] = (~val >> 7) & 0x1;
  115. mutex_unlock(&spec->mute_mutex);
  116. return 0;
  117. }
  118. static int stac9460_dac_mute_put(struct snd_kcontrol *kcontrol,
  119. struct snd_ctl_elem_value *ucontrol)
  120. {
  121. struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
  122. unsigned char new, old;
  123. int id, idx;
  124. int change;
  125. if (kcontrol->private_value) {
  126. idx = STAC946X_MASTER_VOLUME;
  127. old = stac9460_get(ice, idx);
  128. new = (~ucontrol->value.integer.value[0] << 7 & 0x80) |
  129. (old & ~0x80);
  130. change = (new != old);
  131. if (change) {
  132. stac9460_put(ice, idx, new);
  133. stac9460_2_put(ice, idx, new);
  134. }
  135. } else {
  136. id = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
  137. idx = id + STAC946X_LF_VOLUME;
  138. if (id < 6)
  139. old = stac9460_get(ice, idx);
  140. else
  141. old = stac9460_2_get(ice, idx - 6);
  142. new = (~ucontrol->value.integer.value[0] << 7 & 0x80) |
  143. (old & ~0x80);
  144. change = (new != old);
  145. if (change) {
  146. if (id < 6)
  147. stac9460_put(ice, idx, new);
  148. else
  149. stac9460_2_put(ice, idx - 6, new);
  150. }
  151. }
  152. return change;
  153. }
  154. /*
  155. * DAC volume attenuation mixer control
  156. */
  157. static int stac9460_dac_vol_info(struct snd_kcontrol *kcontrol,
  158. struct snd_ctl_elem_info *uinfo)
  159. {
  160. uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
  161. uinfo->count = 1;
  162. uinfo->value.integer.min = 0; /* mute */
  163. uinfo->value.integer.max = 0x7f; /* 0dB */
  164. return 0;
  165. }
  166. static int stac9460_dac_vol_get(struct snd_kcontrol *kcontrol,
  167. struct snd_ctl_elem_value *ucontrol)
  168. {
  169. struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
  170. int idx, id;
  171. unsigned char vol;
  172. if (kcontrol->private_value) {
  173. idx = STAC946X_MASTER_VOLUME;
  174. id = 0;
  175. } else {
  176. id = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
  177. idx = id + STAC946X_LF_VOLUME;
  178. }
  179. if (id < 6)
  180. vol = stac9460_get(ice, idx) & 0x7f;
  181. else
  182. vol = stac9460_2_get(ice, idx - 6) & 0x7f;
  183. ucontrol->value.integer.value[0] = 0x7f - vol;
  184. return 0;
  185. }
  186. static int stac9460_dac_vol_put(struct snd_kcontrol *kcontrol,
  187. struct snd_ctl_elem_value *ucontrol)
  188. {
  189. struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
  190. int idx, id;
  191. unsigned char tmp, ovol, nvol;
  192. int change;
  193. if (kcontrol->private_value) {
  194. idx = STAC946X_MASTER_VOLUME;
  195. nvol = ucontrol->value.integer.value[0] & 0x7f;
  196. tmp = stac9460_get(ice, idx);
  197. ovol = 0x7f - (tmp & 0x7f);
  198. change = (ovol != nvol);
  199. if (change) {
  200. stac9460_put(ice, idx, (0x7f - nvol) | (tmp & 0x80));
  201. stac9460_2_put(ice, idx, (0x7f - nvol) | (tmp & 0x80));
  202. }
  203. } else {
  204. id = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
  205. idx = id + STAC946X_LF_VOLUME;
  206. nvol = ucontrol->value.integer.value[0] & 0x7f;
  207. if (id < 6)
  208. tmp = stac9460_get(ice, idx);
  209. else
  210. tmp = stac9460_2_get(ice, idx - 6);
  211. ovol = 0x7f - (tmp & 0x7f);
  212. change = (ovol != nvol);
  213. if (change) {
  214. if (id < 6)
  215. stac9460_put(ice, idx, (0x7f - nvol) |
  216. (tmp & 0x80));
  217. else
  218. stac9460_2_put(ice, idx-6, (0x7f - nvol) |
  219. (tmp & 0x80));
  220. }
  221. }
  222. return change;
  223. }
  224. /*
  225. * ADC mute control
  226. */
  227. #define stac9460_adc_mute_info snd_ctl_boolean_stereo_info
  228. static int stac9460_adc_mute_get(struct snd_kcontrol *kcontrol,
  229. struct snd_ctl_elem_value *ucontrol)
  230. {
  231. struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
  232. unsigned char val;
  233. int i, id;
  234. id = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
  235. if (id == 0) {
  236. for (i = 0; i < 2; ++i) {
  237. val = stac9460_get(ice, STAC946X_MIC_L_VOLUME + i);
  238. ucontrol->value.integer.value[i] = ~val>>7 & 0x1;
  239. }
  240. } else {
  241. for (i = 0; i < 2; ++i) {
  242. val = stac9460_2_get(ice, STAC946X_MIC_L_VOLUME + i);
  243. ucontrol->value.integer.value[i] = ~val>>7 & 0x1;
  244. }
  245. }
  246. return 0;
  247. }
  248. static int stac9460_adc_mute_put(struct snd_kcontrol *kcontrol,
  249. struct snd_ctl_elem_value *ucontrol)
  250. {
  251. struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
  252. unsigned char new, old;
  253. int i, reg, id;
  254. int change;
  255. id = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
  256. if (id == 0) {
  257. for (i = 0; i < 2; ++i) {
  258. reg = STAC946X_MIC_L_VOLUME + i;
  259. old = stac9460_get(ice, reg);
  260. new = (~ucontrol->value.integer.value[i]<<7&0x80) |
  261. (old&~0x80);
  262. change = (new != old);
  263. if (change)
  264. stac9460_put(ice, reg, new);
  265. }
  266. } else {
  267. for (i = 0; i < 2; ++i) {
  268. reg = STAC946X_MIC_L_VOLUME + i;
  269. old = stac9460_2_get(ice, reg);
  270. new = (~ucontrol->value.integer.value[i]<<7&0x80) |
  271. (old&~0x80);
  272. change = (new != old);
  273. if (change)
  274. stac9460_2_put(ice, reg, new);
  275. }
  276. }
  277. return change;
  278. }
  279. /*
  280. *ADC gain mixer control
  281. */
  282. static int stac9460_adc_vol_info(struct snd_kcontrol *kcontrol,
  283. struct snd_ctl_elem_info *uinfo)
  284. {
  285. uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
  286. uinfo->count = 2;
  287. uinfo->value.integer.min = 0; /* 0dB */
  288. uinfo->value.integer.max = 0x0f; /* 22.5dB */
  289. return 0;
  290. }
  291. static int stac9460_adc_vol_get(struct snd_kcontrol *kcontrol,
  292. struct snd_ctl_elem_value *ucontrol)
  293. {
  294. struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
  295. int i, reg, id;
  296. unsigned char vol;
  297. id = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
  298. if (id == 0) {
  299. for (i = 0; i < 2; ++i) {
  300. reg = STAC946X_MIC_L_VOLUME + i;
  301. vol = stac9460_get(ice, reg) & 0x0f;
  302. ucontrol->value.integer.value[i] = 0x0f - vol;
  303. }
  304. } else {
  305. for (i = 0; i < 2; ++i) {
  306. reg = STAC946X_MIC_L_VOLUME + i;
  307. vol = stac9460_2_get(ice, reg) & 0x0f;
  308. ucontrol->value.integer.value[i] = 0x0f - vol;
  309. }
  310. }
  311. return 0;
  312. }
  313. static int stac9460_adc_vol_put(struct snd_kcontrol *kcontrol,
  314. struct snd_ctl_elem_value *ucontrol)
  315. {
  316. struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
  317. int i, reg, id;
  318. unsigned char ovol, nvol;
  319. int change;
  320. id = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
  321. if (id == 0) {
  322. for (i = 0; i < 2; ++i) {
  323. reg = STAC946X_MIC_L_VOLUME + i;
  324. nvol = ucontrol->value.integer.value[i] & 0x0f;
  325. ovol = 0x0f - stac9460_get(ice, reg);
  326. change = ((ovol & 0x0f) != nvol);
  327. if (change)
  328. stac9460_put(ice, reg, (0x0f - nvol) |
  329. (ovol & ~0x0f));
  330. }
  331. } else {
  332. for (i = 0; i < 2; ++i) {
  333. reg = STAC946X_MIC_L_VOLUME + i;
  334. nvol = ucontrol->value.integer.value[i] & 0x0f;
  335. ovol = 0x0f - stac9460_2_get(ice, reg);
  336. change = ((ovol & 0x0f) != nvol);
  337. if (change)
  338. stac9460_2_put(ice, reg, (0x0f - nvol) |
  339. (ovol & ~0x0f));
  340. }
  341. }
  342. return change;
  343. }
  344. /*
  345. * MIC / LINE switch fonction
  346. */
  347. static int stac9460_mic_sw_info(struct snd_kcontrol *kcontrol,
  348. struct snd_ctl_elem_info *uinfo)
  349. {
  350. static const char * const texts[2] = { "Line In", "Mic" };
  351. return snd_ctl_enum_info(uinfo, 1, 2, texts);
  352. }
  353. static int stac9460_mic_sw_get(struct snd_kcontrol *kcontrol,
  354. struct snd_ctl_elem_value *ucontrol)
  355. {
  356. struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
  357. unsigned char val;
  358. int id;
  359. id = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
  360. if (id == 0)
  361. val = stac9460_get(ice, STAC946X_GENERAL_PURPOSE);
  362. else
  363. val = stac9460_2_get(ice, STAC946X_GENERAL_PURPOSE);
  364. ucontrol->value.enumerated.item[0] = (val >> 7) & 0x1;
  365. return 0;
  366. }
  367. static int stac9460_mic_sw_put(struct snd_kcontrol *kcontrol,
  368. struct snd_ctl_elem_value *ucontrol)
  369. {
  370. struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
  371. unsigned char new, old;
  372. int change, id;
  373. id = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
  374. if (id == 0)
  375. old = stac9460_get(ice, STAC946X_GENERAL_PURPOSE);
  376. else
  377. old = stac9460_2_get(ice, STAC946X_GENERAL_PURPOSE);
  378. new = (ucontrol->value.enumerated.item[0] << 7 & 0x80) | (old & ~0x80);
  379. change = (new != old);
  380. if (change) {
  381. if (id == 0)
  382. stac9460_put(ice, STAC946X_GENERAL_PURPOSE, new);
  383. else
  384. stac9460_2_put(ice, STAC946X_GENERAL_PURPOSE, new);
  385. }
  386. return change;
  387. }
  388. /*
  389. * Handler for setting correct codec rate - called when rate change is detected
  390. */
  391. static void stac9460_set_rate_val(struct snd_ice1712 *ice, unsigned int rate)
  392. {
  393. unsigned char old, new;
  394. unsigned short int changed;
  395. struct wtm_spec *spec = ice->spec;
  396. if (rate == 0) /* no hint - S/PDIF input is master, simply return */
  397. return;
  398. else if (rate <= 48000)
  399. new = 0x08; /* 256x, base rate mode */
  400. else if (rate <= 96000)
  401. new = 0x11; /* 256x, mid rate mode */
  402. else
  403. new = 0x12; /* 128x, high rate mode */
  404. old = stac9460_get(ice, STAC946X_MASTER_CLOCKING);
  405. if (old == new)
  406. return;
  407. /* change detected, setting master clock, muting first */
  408. /* due to possible conflicts with mute controls - mutexing */
  409. mutex_lock(&spec->mute_mutex);
  410. /* we have to remember current mute status for each DAC */
  411. changed = 0xFFFF;
  412. stac9460_dac_mute_all(ice, 0, &changed);
  413. /*printk(KERN_DEBUG "Rate change: %d, new MC: 0x%02x\n", rate, new);*/
  414. stac9460_put(ice, STAC946X_MASTER_CLOCKING, new);
  415. stac9460_2_put(ice, STAC946X_MASTER_CLOCKING, new);
  416. udelay(10);
  417. /* unmuting - only originally unmuted dacs -
  418. * i.e. those changed when muting */
  419. stac9460_dac_mute_all(ice, 1, &changed);
  420. mutex_unlock(&spec->mute_mutex);
  421. }
  422. /*Limits value in dB for fader*/
  423. static const DECLARE_TLV_DB_SCALE(db_scale_dac, -19125, 75, 0);
  424. static const DECLARE_TLV_DB_SCALE(db_scale_adc, 0, 150, 0);
  425. /*
  426. * Control tabs
  427. */
  428. static const struct snd_kcontrol_new stac9640_controls[] = {
  429. {
  430. .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  431. .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
  432. SNDRV_CTL_ELEM_ACCESS_TLV_READ),
  433. .name = "Master Playback Switch",
  434. .info = stac9460_dac_mute_info,
  435. .get = stac9460_dac_mute_get,
  436. .put = stac9460_dac_mute_put,
  437. .private_value = 1,
  438. .tlv = { .p = db_scale_dac }
  439. },
  440. {
  441. .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  442. .name = "Master Playback Volume",
  443. .info = stac9460_dac_vol_info,
  444. .get = stac9460_dac_vol_get,
  445. .put = stac9460_dac_vol_put,
  446. .private_value = 1,
  447. },
  448. {
  449. .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  450. .name = "MIC/Line Input Enum",
  451. .count = 2,
  452. .info = stac9460_mic_sw_info,
  453. .get = stac9460_mic_sw_get,
  454. .put = stac9460_mic_sw_put,
  455. },
  456. {
  457. .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  458. .name = "DAC Switch",
  459. .count = 8,
  460. .info = stac9460_dac_mute_info,
  461. .get = stac9460_dac_mute_get,
  462. .put = stac9460_dac_mute_put,
  463. },
  464. {
  465. .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  466. .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
  467. SNDRV_CTL_ELEM_ACCESS_TLV_READ),
  468. .name = "DAC Volume",
  469. .count = 8,
  470. .info = stac9460_dac_vol_info,
  471. .get = stac9460_dac_vol_get,
  472. .put = stac9460_dac_vol_put,
  473. .tlv = { .p = db_scale_dac }
  474. },
  475. {
  476. .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  477. .name = "ADC Switch",
  478. .count = 2,
  479. .info = stac9460_adc_mute_info,
  480. .get = stac9460_adc_mute_get,
  481. .put = stac9460_adc_mute_put,
  482. },
  483. {
  484. .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  485. .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
  486. SNDRV_CTL_ELEM_ACCESS_TLV_READ),
  487. .name = "ADC Volume",
  488. .count = 2,
  489. .info = stac9460_adc_vol_info,
  490. .get = stac9460_adc_vol_get,
  491. .put = stac9460_adc_vol_put,
  492. .tlv = { .p = db_scale_adc }
  493. }
  494. };
  495. /*INIT*/
  496. static int wtm_add_controls(struct snd_ice1712 *ice)
  497. {
  498. unsigned int i;
  499. int err;
  500. for (i = 0; i < ARRAY_SIZE(stac9640_controls); i++) {
  501. err = snd_ctl_add(ice->card,
  502. snd_ctl_new1(&stac9640_controls[i], ice));
  503. if (err < 0)
  504. return err;
  505. }
  506. return 0;
  507. }
  508. static int wtm_init(struct snd_ice1712 *ice)
  509. {
  510. static const unsigned short stac_inits_wtm[] = {
  511. STAC946X_RESET, 0,
  512. STAC946X_MASTER_CLOCKING, 0x11,
  513. (unsigned short)-1
  514. };
  515. const unsigned short *p;
  516. struct wtm_spec *spec;
  517. /*WTM 192M*/
  518. ice->num_total_dacs = 8;
  519. ice->num_total_adcs = 4;
  520. ice->force_rdma1 = 1;
  521. /*init mutex for dac mute conflict*/
  522. spec = kzalloc(sizeof(*spec), GFP_KERNEL);
  523. if (!spec)
  524. return -ENOMEM;
  525. ice->spec = spec;
  526. mutex_init(&spec->mute_mutex);
  527. /*initialize codec*/
  528. p = stac_inits_wtm;
  529. for (; *p != (unsigned short)-1; p += 2) {
  530. stac9460_put(ice, p[0], p[1]);
  531. stac9460_2_put(ice, p[0], p[1]);
  532. }
  533. ice->gpio.set_pro_rate = stac9460_set_rate_val;
  534. return 0;
  535. }
  536. static const unsigned char wtm_eeprom[] = {
  537. [ICE_EEP2_SYSCONF] = 0x67, /*SYSCONF: clock 192KHz, mpu401,
  538. 4ADC, 8DAC */
  539. [ICE_EEP2_ACLINK] = 0x80, /* ACLINK : I2S */
  540. [ICE_EEP2_I2S] = 0xf8, /* I2S: vol; 96k, 24bit, 192k */
  541. [ICE_EEP2_SPDIF] = 0xc1, /*SPDIF: out-en, spidf ext out*/
  542. [ICE_EEP2_GPIO_DIR] = 0x9f,
  543. [ICE_EEP2_GPIO_DIR1] = 0xff,
  544. [ICE_EEP2_GPIO_DIR2] = 0x7f,
  545. [ICE_EEP2_GPIO_MASK] = 0x9f,
  546. [ICE_EEP2_GPIO_MASK1] = 0xff,
  547. [ICE_EEP2_GPIO_MASK2] = 0x7f,
  548. [ICE_EEP2_GPIO_STATE] = 0x16,
  549. [ICE_EEP2_GPIO_STATE1] = 0x80,
  550. [ICE_EEP2_GPIO_STATE2] = 0x00,
  551. };
  552. /*entry point*/
  553. struct snd_ice1712_card_info snd_vt1724_wtm_cards[] = {
  554. {
  555. .subvendor = VT1724_SUBDEVICE_WTM,
  556. .name = "ESI Waveterminal 192M",
  557. .model = "WT192M",
  558. .chip_init = wtm_init,
  559. .build_controls = wtm_add_controls,
  560. .eeprom_size = sizeof(wtm_eeprom),
  561. .eeprom_data = wtm_eeprom,
  562. },
  563. {} /*terminator*/
  564. };