vxp_ops.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  1. /*
  2. * Driver for Digigram VXpocket soundcards
  3. *
  4. * lowlevel routines for VXpocket soundcards
  5. *
  6. * Copyright (c) 2002 by 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. #include <linux/delay.h>
  23. #include <linux/device.h>
  24. #include <linux/firmware.h>
  25. #include <linux/io.h>
  26. #include <sound/core.h>
  27. #include "vxpocket.h"
  28. static int vxp_reg_offset[VX_REG_MAX] = {
  29. [VX_ICR] = 0x00, // ICR
  30. [VX_CVR] = 0x01, // CVR
  31. [VX_ISR] = 0x02, // ISR
  32. [VX_IVR] = 0x03, // IVR
  33. [VX_RXH] = 0x05, // RXH
  34. [VX_RXM] = 0x06, // RXM
  35. [VX_RXL] = 0x07, // RXL
  36. [VX_DMA] = 0x04, // DMA
  37. [VX_CDSP] = 0x08, // CDSP
  38. [VX_LOFREQ] = 0x09, // LFREQ
  39. [VX_HIFREQ] = 0x0a, // HFREQ
  40. [VX_DATA] = 0x0b, // DATA
  41. [VX_MICRO] = 0x0c, // MICRO
  42. [VX_DIALOG] = 0x0d, // DIALOG
  43. [VX_CSUER] = 0x0e, // CSUER
  44. [VX_RUER] = 0x0f, // RUER
  45. };
  46. static inline unsigned long vxp_reg_addr(struct vx_core *_chip, int reg)
  47. {
  48. struct snd_vxpocket *chip = (struct snd_vxpocket *)_chip;
  49. return chip->port + vxp_reg_offset[reg];
  50. }
  51. /*
  52. * snd_vx_inb - read a byte from the register
  53. * @offset: register offset
  54. */
  55. static unsigned char vxp_inb(struct vx_core *chip, int offset)
  56. {
  57. return inb(vxp_reg_addr(chip, offset));
  58. }
  59. /*
  60. * snd_vx_outb - write a byte on the register
  61. * @offset: the register offset
  62. * @val: the value to write
  63. */
  64. static void vxp_outb(struct vx_core *chip, int offset, unsigned char val)
  65. {
  66. outb(val, vxp_reg_addr(chip, offset));
  67. }
  68. /*
  69. * redefine macros to call directly
  70. */
  71. #undef vx_inb
  72. #define vx_inb(chip,reg) vxp_inb((struct vx_core *)(chip), VX_##reg)
  73. #undef vx_outb
  74. #define vx_outb(chip,reg,val) vxp_outb((struct vx_core *)(chip), VX_##reg,val)
  75. /*
  76. * vx_check_magic - check the magic word on xilinx
  77. *
  78. * returns zero if a magic word is detected, or a negative error code.
  79. */
  80. static int vx_check_magic(struct vx_core *chip)
  81. {
  82. unsigned long end_time = jiffies + HZ / 5;
  83. int c;
  84. do {
  85. c = vx_inb(chip, CDSP);
  86. if (c == CDSP_MAGIC)
  87. return 0;
  88. msleep(10);
  89. } while (time_after_eq(end_time, jiffies));
  90. snd_printk(KERN_ERR "cannot find xilinx magic word (%x)\n", c);
  91. return -EIO;
  92. }
  93. /*
  94. * vx_reset_dsp - reset the DSP
  95. */
  96. #define XX_DSP_RESET_WAIT_TIME 2 /* ms */
  97. static void vxp_reset_dsp(struct vx_core *_chip)
  98. {
  99. struct snd_vxpocket *chip = (struct snd_vxpocket *)_chip;
  100. /* set the reset dsp bit to 1 */
  101. vx_outb(chip, CDSP, chip->regCDSP | VXP_CDSP_DSP_RESET_MASK);
  102. vx_inb(chip, CDSP);
  103. mdelay(XX_DSP_RESET_WAIT_TIME);
  104. /* reset the bit */
  105. chip->regCDSP &= ~VXP_CDSP_DSP_RESET_MASK;
  106. vx_outb(chip, CDSP, chip->regCDSP);
  107. vx_inb(chip, CDSP);
  108. mdelay(XX_DSP_RESET_WAIT_TIME);
  109. }
  110. /*
  111. * reset codec bit
  112. */
  113. static void vxp_reset_codec(struct vx_core *_chip)
  114. {
  115. struct snd_vxpocket *chip = (struct snd_vxpocket *)_chip;
  116. /* Set the reset CODEC bit to 1. */
  117. vx_outb(chip, CDSP, chip->regCDSP | VXP_CDSP_CODEC_RESET_MASK);
  118. vx_inb(chip, CDSP);
  119. msleep(10);
  120. /* Set the reset CODEC bit to 0. */
  121. chip->regCDSP &= ~VXP_CDSP_CODEC_RESET_MASK;
  122. vx_outb(chip, CDSP, chip->regCDSP);
  123. vx_inb(chip, CDSP);
  124. msleep(1);
  125. }
  126. /*
  127. * vx_load_xilinx_binary - load the xilinx binary image
  128. * the binary image is the binary array converted from the bitstream file.
  129. */
  130. static int vxp_load_xilinx_binary(struct vx_core *_chip, const struct firmware *fw)
  131. {
  132. struct snd_vxpocket *chip = (struct snd_vxpocket *)_chip;
  133. unsigned int i;
  134. int c;
  135. int regCSUER, regRUER;
  136. const unsigned char *image;
  137. unsigned char data;
  138. /* Switch to programmation mode */
  139. chip->regDIALOG |= VXP_DLG_XILINX_REPROG_MASK;
  140. vx_outb(chip, DIALOG, chip->regDIALOG);
  141. /* Save register CSUER and RUER */
  142. regCSUER = vx_inb(chip, CSUER);
  143. regRUER = vx_inb(chip, RUER);
  144. /* reset HF0 and HF1 */
  145. vx_outb(chip, ICR, 0);
  146. /* Wait for answer HF2 equal to 1 */
  147. snd_printdd(KERN_DEBUG "check ISR_HF2\n");
  148. if (vx_check_isr(_chip, ISR_HF2, ISR_HF2, 20) < 0)
  149. goto _error;
  150. /* set HF1 for loading xilinx binary */
  151. vx_outb(chip, ICR, ICR_HF1);
  152. image = fw->data;
  153. for (i = 0; i < fw->size; i++, image++) {
  154. data = *image;
  155. if (vx_wait_isr_bit(_chip, ISR_TX_EMPTY) < 0)
  156. goto _error;
  157. vx_outb(chip, TXL, data);
  158. /* wait for reading */
  159. if (vx_wait_for_rx_full(_chip) < 0)
  160. goto _error;
  161. c = vx_inb(chip, RXL);
  162. if (c != (int)data)
  163. snd_printk(KERN_ERR "vxpocket: load xilinx mismatch at %d: 0x%x != 0x%x\n", i, c, (int)data);
  164. }
  165. /* reset HF1 */
  166. vx_outb(chip, ICR, 0);
  167. /* wait for HF3 */
  168. if (vx_check_isr(_chip, ISR_HF3, ISR_HF3, 20) < 0)
  169. goto _error;
  170. /* read the number of bytes received */
  171. if (vx_wait_for_rx_full(_chip) < 0)
  172. goto _error;
  173. c = (int)vx_inb(chip, RXH) << 16;
  174. c |= (int)vx_inb(chip, RXM) << 8;
  175. c |= vx_inb(chip, RXL);
  176. snd_printdd(KERN_DEBUG "xilinx: dsp size received 0x%x, orig 0x%Zx\n", c, fw->size);
  177. vx_outb(chip, ICR, ICR_HF0);
  178. /* TEMPO 250ms : wait until Xilinx is downloaded */
  179. msleep(300);
  180. /* test magical word */
  181. if (vx_check_magic(_chip) < 0)
  182. goto _error;
  183. /* Restore register 0x0E and 0x0F (thus replacing COR and FCSR) */
  184. vx_outb(chip, CSUER, regCSUER);
  185. vx_outb(chip, RUER, regRUER);
  186. /* Reset the Xilinx's signal enabling IO access */
  187. chip->regDIALOG |= VXP_DLG_XILINX_REPROG_MASK;
  188. vx_outb(chip, DIALOG, chip->regDIALOG);
  189. vx_inb(chip, DIALOG);
  190. msleep(10);
  191. chip->regDIALOG &= ~VXP_DLG_XILINX_REPROG_MASK;
  192. vx_outb(chip, DIALOG, chip->regDIALOG);
  193. vx_inb(chip, DIALOG);
  194. /* Reset of the Codec */
  195. vxp_reset_codec(_chip);
  196. vx_reset_dsp(_chip);
  197. return 0;
  198. _error:
  199. vx_outb(chip, CSUER, regCSUER);
  200. vx_outb(chip, RUER, regRUER);
  201. chip->regDIALOG &= ~VXP_DLG_XILINX_REPROG_MASK;
  202. vx_outb(chip, DIALOG, chip->regDIALOG);
  203. return -EIO;
  204. }
  205. /*
  206. * vxp_load_dsp - load_dsp callback
  207. */
  208. static int vxp_load_dsp(struct vx_core *vx, int index, const struct firmware *fw)
  209. {
  210. int err;
  211. switch (index) {
  212. case 0:
  213. /* xilinx boot */
  214. if ((err = vx_check_magic(vx)) < 0)
  215. return err;
  216. if ((err = snd_vx_load_boot_image(vx, fw)) < 0)
  217. return err;
  218. return 0;
  219. case 1:
  220. /* xilinx image */
  221. return vxp_load_xilinx_binary(vx, fw);
  222. case 2:
  223. /* DSP boot */
  224. return snd_vx_dsp_boot(vx, fw);
  225. case 3:
  226. /* DSP image */
  227. return snd_vx_dsp_load(vx, fw);
  228. default:
  229. snd_BUG();
  230. return -EINVAL;
  231. }
  232. }
  233. /*
  234. * vx_test_and_ack - test and acknowledge interrupt
  235. *
  236. * called from irq hander, too
  237. *
  238. * spinlock held!
  239. */
  240. static int vxp_test_and_ack(struct vx_core *_chip)
  241. {
  242. struct snd_vxpocket *chip = (struct snd_vxpocket *)_chip;
  243. /* not booted yet? */
  244. if (! (_chip->chip_status & VX_STAT_XILINX_LOADED))
  245. return -ENXIO;
  246. if (! (vx_inb(chip, DIALOG) & VXP_DLG_MEMIRQ_MASK))
  247. return -EIO;
  248. /* ok, interrupts generated, now ack it */
  249. /* set ACQUIT bit up and down */
  250. vx_outb(chip, DIALOG, chip->regDIALOG | VXP_DLG_ACK_MEMIRQ_MASK);
  251. /* useless read just to spend some time and maintain
  252. * the ACQUIT signal up for a while ( a bus cycle )
  253. */
  254. vx_inb(chip, DIALOG);
  255. vx_outb(chip, DIALOG, chip->regDIALOG & ~VXP_DLG_ACK_MEMIRQ_MASK);
  256. return 0;
  257. }
  258. /*
  259. * vx_validate_irq - enable/disable IRQ
  260. */
  261. static void vxp_validate_irq(struct vx_core *_chip, int enable)
  262. {
  263. struct snd_vxpocket *chip = (struct snd_vxpocket *)_chip;
  264. /* Set the interrupt enable bit to 1 in CDSP register */
  265. if (enable)
  266. chip->regCDSP |= VXP_CDSP_VALID_IRQ_MASK;
  267. else
  268. chip->regCDSP &= ~VXP_CDSP_VALID_IRQ_MASK;
  269. vx_outb(chip, CDSP, chip->regCDSP);
  270. }
  271. /*
  272. * vx_setup_pseudo_dma - set up the pseudo dma read/write mode.
  273. * @do_write: 0 = read, 1 = set up for DMA write
  274. */
  275. static void vx_setup_pseudo_dma(struct vx_core *_chip, int do_write)
  276. {
  277. struct snd_vxpocket *chip = (struct snd_vxpocket *)_chip;
  278. /* Interrupt mode and HREQ pin enabled for host transmit / receive data transfers */
  279. vx_outb(chip, ICR, do_write ? ICR_TREQ : ICR_RREQ);
  280. /* Reset the pseudo-dma register */
  281. vx_inb(chip, ISR);
  282. vx_outb(chip, ISR, 0);
  283. /* Select DMA in read/write transfer mode and in 16-bit accesses */
  284. chip->regDIALOG |= VXP_DLG_DMA16_SEL_MASK;
  285. chip->regDIALOG |= do_write ? VXP_DLG_DMAWRITE_SEL_MASK : VXP_DLG_DMAREAD_SEL_MASK;
  286. vx_outb(chip, DIALOG, chip->regDIALOG);
  287. }
  288. /*
  289. * vx_release_pseudo_dma - disable the pseudo-DMA mode
  290. */
  291. static void vx_release_pseudo_dma(struct vx_core *_chip)
  292. {
  293. struct snd_vxpocket *chip = (struct snd_vxpocket *)_chip;
  294. /* Disable DMA and 16-bit accesses */
  295. chip->regDIALOG &= ~(VXP_DLG_DMAWRITE_SEL_MASK|
  296. VXP_DLG_DMAREAD_SEL_MASK|
  297. VXP_DLG_DMA16_SEL_MASK);
  298. vx_outb(chip, DIALOG, chip->regDIALOG);
  299. /* HREQ pin disabled. */
  300. vx_outb(chip, ICR, 0);
  301. }
  302. /*
  303. * vx_pseudo_dma_write - write bulk data on pseudo-DMA mode
  304. * @count: data length to transfer in bytes
  305. *
  306. * data size must be aligned to 6 bytes to ensure the 24bit alignment on DSP.
  307. * NB: call with a certain lock!
  308. */
  309. static void vxp_dma_write(struct vx_core *chip, struct snd_pcm_runtime *runtime,
  310. struct vx_pipe *pipe, int count)
  311. {
  312. long port = vxp_reg_addr(chip, VX_DMA);
  313. int offset = pipe->hw_ptr;
  314. unsigned short *addr = (unsigned short *)(runtime->dma_area + offset);
  315. vx_setup_pseudo_dma(chip, 1);
  316. if (offset + count >= pipe->buffer_bytes) {
  317. int length = pipe->buffer_bytes - offset;
  318. count -= length;
  319. length >>= 1; /* in 16bit words */
  320. /* Transfer using pseudo-dma. */
  321. for (; length > 0; length--) {
  322. outw(*addr, port);
  323. addr++;
  324. }
  325. addr = (unsigned short *)runtime->dma_area;
  326. pipe->hw_ptr = 0;
  327. }
  328. pipe->hw_ptr += count;
  329. count >>= 1; /* in 16bit words */
  330. /* Transfer using pseudo-dma. */
  331. for (; count > 0; count--) {
  332. outw(*addr, port);
  333. addr++;
  334. }
  335. vx_release_pseudo_dma(chip);
  336. }
  337. /*
  338. * vx_pseudo_dma_read - read bulk data on pseudo DMA mode
  339. * @offset: buffer offset in bytes
  340. * @count: data length to transfer in bytes
  341. *
  342. * the read length must be aligned to 6 bytes, as well as write.
  343. * NB: call with a certain lock!
  344. */
  345. static void vxp_dma_read(struct vx_core *chip, struct snd_pcm_runtime *runtime,
  346. struct vx_pipe *pipe, int count)
  347. {
  348. struct snd_vxpocket *pchip = (struct snd_vxpocket *)chip;
  349. long port = vxp_reg_addr(chip, VX_DMA);
  350. int offset = pipe->hw_ptr;
  351. unsigned short *addr = (unsigned short *)(runtime->dma_area + offset);
  352. if (snd_BUG_ON(count % 2))
  353. return;
  354. vx_setup_pseudo_dma(chip, 0);
  355. if (offset + count >= pipe->buffer_bytes) {
  356. int length = pipe->buffer_bytes - offset;
  357. count -= length;
  358. length >>= 1; /* in 16bit words */
  359. /* Transfer using pseudo-dma. */
  360. for (; length > 0; length--)
  361. *addr++ = inw(port);
  362. addr = (unsigned short *)runtime->dma_area;
  363. pipe->hw_ptr = 0;
  364. }
  365. pipe->hw_ptr += count;
  366. count >>= 1; /* in 16bit words */
  367. /* Transfer using pseudo-dma. */
  368. for (; count > 1; count--)
  369. *addr++ = inw(port);
  370. /* Disable DMA */
  371. pchip->regDIALOG &= ~VXP_DLG_DMAREAD_SEL_MASK;
  372. vx_outb(chip, DIALOG, pchip->regDIALOG);
  373. /* Read the last word (16 bits) */
  374. *addr = inw(port);
  375. /* Disable 16-bit accesses */
  376. pchip->regDIALOG &= ~VXP_DLG_DMA16_SEL_MASK;
  377. vx_outb(chip, DIALOG, pchip->regDIALOG);
  378. /* HREQ pin disabled. */
  379. vx_outb(chip, ICR, 0);
  380. }
  381. /*
  382. * write a codec data (24bit)
  383. */
  384. static void vxp_write_codec_reg(struct vx_core *chip, int codec, unsigned int data)
  385. {
  386. int i;
  387. /* Activate access to the corresponding codec register */
  388. if (! codec)
  389. vx_inb(chip, LOFREQ);
  390. else
  391. vx_inb(chip, CODEC2);
  392. /* We have to send 24 bits (3 x 8 bits). Start with most signif. Bit */
  393. for (i = 0; i < 24; i++, data <<= 1)
  394. vx_outb(chip, DATA, ((data & 0x800000) ? VX_DATA_CODEC_MASK : 0));
  395. /* Terminate access to codec registers */
  396. vx_inb(chip, HIFREQ);
  397. }
  398. /*
  399. * vx_set_mic_boost - set mic boost level (on vxp440 only)
  400. * @boost: 0 = 20dB, 1 = +38dB
  401. */
  402. void vx_set_mic_boost(struct vx_core *chip, int boost)
  403. {
  404. struct snd_vxpocket *pchip = (struct snd_vxpocket *)chip;
  405. if (chip->chip_status & VX_STAT_IS_STALE)
  406. return;
  407. mutex_lock(&chip->lock);
  408. if (pchip->regCDSP & P24_CDSP_MICS_SEL_MASK) {
  409. if (boost) {
  410. /* boost: 38 dB */
  411. pchip->regCDSP &= ~P24_CDSP_MIC20_SEL_MASK;
  412. pchip->regCDSP |= P24_CDSP_MIC38_SEL_MASK;
  413. } else {
  414. /* minimum value: 20 dB */
  415. pchip->regCDSP |= P24_CDSP_MIC20_SEL_MASK;
  416. pchip->regCDSP &= ~P24_CDSP_MIC38_SEL_MASK;
  417. }
  418. vx_outb(chip, CDSP, pchip->regCDSP);
  419. }
  420. mutex_unlock(&chip->lock);
  421. }
  422. /*
  423. * remap the linear value (0-8) to the actual value (0-15)
  424. */
  425. static int vx_compute_mic_level(int level)
  426. {
  427. switch (level) {
  428. case 5: level = 6 ; break;
  429. case 6: level = 8 ; break;
  430. case 7: level = 11; break;
  431. case 8: level = 15; break;
  432. default: break ;
  433. }
  434. return level;
  435. }
  436. /*
  437. * vx_set_mic_level - set mic level (on vxpocket only)
  438. * @level: the mic level = 0 - 8 (max)
  439. */
  440. void vx_set_mic_level(struct vx_core *chip, int level)
  441. {
  442. struct snd_vxpocket *pchip = (struct snd_vxpocket *)chip;
  443. if (chip->chip_status & VX_STAT_IS_STALE)
  444. return;
  445. mutex_lock(&chip->lock);
  446. if (pchip->regCDSP & VXP_CDSP_MIC_SEL_MASK) {
  447. level = vx_compute_mic_level(level);
  448. vx_outb(chip, MICRO, level);
  449. }
  450. mutex_unlock(&chip->lock);
  451. }
  452. /*
  453. * change the input audio source
  454. */
  455. static void vxp_change_audio_source(struct vx_core *_chip, int src)
  456. {
  457. struct snd_vxpocket *chip = (struct snd_vxpocket *)_chip;
  458. switch (src) {
  459. case VX_AUDIO_SRC_DIGITAL:
  460. chip->regCDSP |= VXP_CDSP_DATAIN_SEL_MASK;
  461. vx_outb(chip, CDSP, chip->regCDSP);
  462. break;
  463. case VX_AUDIO_SRC_LINE:
  464. chip->regCDSP &= ~VXP_CDSP_DATAIN_SEL_MASK;
  465. if (_chip->type == VX_TYPE_VXP440)
  466. chip->regCDSP &= ~P24_CDSP_MICS_SEL_MASK;
  467. else
  468. chip->regCDSP &= ~VXP_CDSP_MIC_SEL_MASK;
  469. vx_outb(chip, CDSP, chip->regCDSP);
  470. break;
  471. case VX_AUDIO_SRC_MIC:
  472. chip->regCDSP &= ~VXP_CDSP_DATAIN_SEL_MASK;
  473. /* reset mic levels */
  474. if (_chip->type == VX_TYPE_VXP440) {
  475. chip->regCDSP &= ~P24_CDSP_MICS_SEL_MASK;
  476. if (chip->mic_level)
  477. chip->regCDSP |= P24_CDSP_MIC38_SEL_MASK;
  478. else
  479. chip->regCDSP |= P24_CDSP_MIC20_SEL_MASK;
  480. vx_outb(chip, CDSP, chip->regCDSP);
  481. } else {
  482. chip->regCDSP |= VXP_CDSP_MIC_SEL_MASK;
  483. vx_outb(chip, CDSP, chip->regCDSP);
  484. vx_outb(chip, MICRO, vx_compute_mic_level(chip->mic_level));
  485. }
  486. break;
  487. }
  488. }
  489. /*
  490. * change the clock source
  491. * source = INTERNAL_QUARTZ or UER_SYNC
  492. */
  493. static void vxp_set_clock_source(struct vx_core *_chip, int source)
  494. {
  495. struct snd_vxpocket *chip = (struct snd_vxpocket *)_chip;
  496. if (source == INTERNAL_QUARTZ)
  497. chip->regCDSP &= ~VXP_CDSP_CLOCKIN_SEL_MASK;
  498. else
  499. chip->regCDSP |= VXP_CDSP_CLOCKIN_SEL_MASK;
  500. vx_outb(chip, CDSP, chip->regCDSP);
  501. }
  502. /*
  503. * reset the board
  504. */
  505. static void vxp_reset_board(struct vx_core *_chip, int cold_reset)
  506. {
  507. struct snd_vxpocket *chip = (struct snd_vxpocket *)_chip;
  508. chip->regCDSP = 0;
  509. chip->regDIALOG = 0;
  510. }
  511. /*
  512. * callbacks
  513. */
  514. /* exported */
  515. struct snd_vx_ops snd_vxpocket_ops = {
  516. .in8 = vxp_inb,
  517. .out8 = vxp_outb,
  518. .test_and_ack = vxp_test_and_ack,
  519. .validate_irq = vxp_validate_irq,
  520. .write_codec = vxp_write_codec_reg,
  521. .reset_codec = vxp_reset_codec,
  522. .change_audio_source = vxp_change_audio_source,
  523. .set_clock_source = vxp_set_clock_source,
  524. .load_dsp = vxp_load_dsp,
  525. .add_controls = vxp_add_mic_controls,
  526. .reset_dsp = vxp_reset_dsp,
  527. .reset_board = vxp_reset_board,
  528. .dma_write = vxp_dma_write,
  529. .dma_read = vxp_dma_read,
  530. };