vxp_ops.c 15 KB

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