aboutsummaryrefslogtreecommitdiffstats
path: root/sound/oss/ad1889.c
diff options
context:
space:
mode:
authorStuart Brady <sdb@parisc-linux.org>2005-03-01 18:00:56 -0500
committerKyle McMartin <kyle@hera.kernel.org>2006-04-21 18:20:31 -0400
commite74eb808ba64610d4983ddd8b5b9a159d178aa8e (patch)
tree44415a7da851cbb4069a81d79a21b6abacdb28a6 /sound/oss/ad1889.c
parentf4ffaa452e71495a06376f12f772342bc57051fc (diff)
[PARISC] OSS ad1889: Match register names with ALSA driver
Signed-off-by: Stuart Brady <sdb@parisc-linux.org> Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
Diffstat (limited to 'sound/oss/ad1889.c')
-rw-r--r--sound/oss/ad1889.c198
1 files changed, 99 insertions, 99 deletions
diff --git a/sound/oss/ad1889.c b/sound/oss/ad1889.c
index 54dabf862802..a4ca7569e700 100644
--- a/sound/oss/ad1889.c
+++ b/sound/oss/ad1889.c
@@ -75,7 +75,7 @@ static inline void ad1889_set_wav_rate(ad1889_dev_t *dev, int rate)
75 75
76 DBG("Setting WAV rate to %d\n", rate); 76 DBG("Setting WAV rate to %d\n", rate);
77 dev->state[AD_WAV_STATE].dmabuf.rate = rate; 77 dev->state[AD_WAV_STATE].dmabuf.rate = rate;
78 AD1889_WRITEW(dev, AD_DSWAS, rate); 78 AD1889_WRITEW(dev, AD_DS_WAS, rate);
79 79
80 /* Cycle the DAC to enable the new rate */ 80 /* Cycle the DAC to enable the new rate */
81 ac97_codec->codec_write(dev->ac97_codec, AC97_POWER_CONTROL, 0x0200); 81 ac97_codec->codec_write(dev->ac97_codec, AC97_POWER_CONTROL, 0x0200);
@@ -89,14 +89,14 @@ static inline void ad1889_set_wav_fmt(ad1889_dev_t *dev, int fmt)
89 89
90 DBG("Setting WAV format to 0x%x\n", fmt); 90 DBG("Setting WAV format to 0x%x\n", fmt);
91 91
92 tmp = AD1889_READW(ad1889_dev, AD_DSWSMC); 92 tmp = AD1889_READW(ad1889_dev, AD_DS_WSMC);
93 if (fmt & AFMT_S16_LE) { 93 if (fmt & AFMT_S16_LE) {
94 //tmp |= 0x0100; /* set WA16 */ 94 //tmp |= 0x0100; /* set WA16 */
95 tmp |= 0x0300; /* set WA16 stereo */ 95 tmp |= 0x0300; /* set WA16 stereo */
96 } else if (fmt & AFMT_U8) { 96 } else if (fmt & AFMT_U8) {
97 tmp &= ~0x0100; /* clear WA16 */ 97 tmp &= ~0x0100; /* clear WA16 */
98 } 98 }
99 AD1889_WRITEW(ad1889_dev, AD_DSWSMC, tmp); 99 AD1889_WRITEW(ad1889_dev, AD_DS_WSMC, tmp);
100} 100}
101 101
102static inline void ad1889_set_adc_fmt(ad1889_dev_t *dev, int fmt) 102static inline void ad1889_set_adc_fmt(ad1889_dev_t *dev, int fmt)
@@ -105,13 +105,13 @@ static inline void ad1889_set_adc_fmt(ad1889_dev_t *dev, int fmt)
105 105
106 DBG("Setting ADC format to 0x%x\n", fmt); 106 DBG("Setting ADC format to 0x%x\n", fmt);
107 107
108 tmp = AD1889_READW(ad1889_dev, AD_DSRAMC); 108 tmp = AD1889_READW(ad1889_dev, AD_DS_RAMC);
109 if (fmt & AFMT_S16_LE) { 109 if (fmt & AFMT_S16_LE) {
110 tmp |= 0x0100; /* set WA16 */ 110 tmp |= 0x0100; /* set WA16 */
111 } else if (fmt & AFMT_U8) { 111 } else if (fmt & AFMT_U8) {
112 tmp &= ~0x0100; /* clear WA16 */ 112 tmp &= ~0x0100; /* clear WA16 */
113 } 113 }
114 AD1889_WRITEW(ad1889_dev, AD_DSRAMC, tmp); 114 AD1889_WRITEW(ad1889_dev, AD_DS_RAMC, tmp);
115} 115}
116 116
117static void ad1889_start_wav(ad1889_state_t *state) 117static void ad1889_start_wav(ad1889_state_t *state)
@@ -145,21 +145,21 @@ static void ad1889_start_wav(ad1889_state_t *state)
145 dmabuf->rd_ptr, dmabuf->dma_len); 145 dmabuf->rd_ptr, dmabuf->dma_len);
146 146
147 /* load up the current register set */ 147 /* load up the current register set */
148 AD1889_WRITEL(ad1889_dev, AD_DMAWAVCC, cnt); 148 AD1889_WRITEL(ad1889_dev, AD_DMA_WAVCC, cnt);
149 AD1889_WRITEL(ad1889_dev, AD_DMAWAVICC, cnt); 149 AD1889_WRITEL(ad1889_dev, AD_DMA_WAVICC, cnt);
150 AD1889_WRITEL(ad1889_dev, AD_DMAWAVCA, dmabuf->dma_handle); 150 AD1889_WRITEL(ad1889_dev, AD_DMA_WAVCA, dmabuf->dma_handle);
151 151
152 /* TODO: for now we load the base registers with the same thing */ 152 /* TODO: for now we load the base registers with the same thing */
153 AD1889_WRITEL(ad1889_dev, AD_DMAWAVBC, cnt); 153 AD1889_WRITEL(ad1889_dev, AD_DMA_WAVBC, cnt);
154 AD1889_WRITEL(ad1889_dev, AD_DMAWAVIBC, cnt); 154 AD1889_WRITEL(ad1889_dev, AD_DMA_WAVIBC, cnt);
155 AD1889_WRITEL(ad1889_dev, AD_DMAWAVBA, dmabuf->dma_handle); 155 AD1889_WRITEL(ad1889_dev, AD_DMA_WAVBA, dmabuf->dma_handle);
156 156
157 /* and we're off to the races... */ 157 /* and we're off to the races... */
158 AD1889_WRITEL(ad1889_dev, AD_DMACHSS, 0x8); 158 AD1889_WRITEL(ad1889_dev, AD_DMA_CHSS, 0x8);
159 tmp = AD1889_READW(ad1889_dev, AD_DSWSMC); 159 tmp = AD1889_READW(ad1889_dev, AD_DS_WSMC);
160 tmp |= 0x0400; /* set WAEN */ 160 tmp |= 0x0400; /* set WAEN */
161 AD1889_WRITEW(ad1889_dev, AD_DSWSMC, tmp); 161 AD1889_WRITEW(ad1889_dev, AD_DS_WSMC, tmp);
162 (void) AD1889_READW(ad1889_dev, AD_DSWSMC); /* flush posted PCI write */ 162 (void) AD1889_READW(ad1889_dev, AD_DS_WSMC); /* flush posted PCI write */
163 163
164 dmabuf->enable |= DAC_RUNNING; 164 dmabuf->enable |= DAC_RUNNING;
165 165
@@ -179,10 +179,10 @@ static void ad1889_stop_wav(ad1889_state_t *state)
179 u16 tmp; 179 u16 tmp;
180 unsigned long cnt = dmabuf->dma_len; 180 unsigned long cnt = dmabuf->dma_len;
181 181
182 tmp = AD1889_READW(ad1889_dev, AD_DSWSMC); 182 tmp = AD1889_READW(ad1889_dev, AD_DS_WSMC);
183 tmp &= ~0x0400; /* clear WAEN */ 183 tmp &= ~0x0400; /* clear WAEN */
184 AD1889_WRITEW(ad1889_dev, AD_DSWSMC, tmp); 184 AD1889_WRITEW(ad1889_dev, AD_DS_WSMC, tmp);
185 (void) AD1889_READW(ad1889_dev, AD_DSWSMC); /* flush posted PCI write */ 185 (void) AD1889_READW(ad1889_dev, AD_DS_WSMC); /* flush posted PCI write */
186 pci_unmap_single(ad1889_dev->pci, dmabuf->dma_handle, 186 pci_unmap_single(ad1889_dev->pci, dmabuf->dma_handle,
187 cnt, PCI_DMA_TODEVICE); 187 cnt, PCI_DMA_TODEVICE);
188 188
@@ -211,7 +211,7 @@ static void ad1889_startstop_adc(ad1889_state_t *state, int start)
211 211
212 spin_lock_irqsave(&state->card->lock, flags); 212 spin_lock_irqsave(&state->card->lock, flags);
213 213
214 tmp = AD1889_READW(ad1889_dev, AD_DSRAMC); 214 tmp = AD1889_READW(ad1889_dev, AD_DS_RAMC);
215 if (start) { 215 if (start) {
216 state->dmabuf.enable |= ADC_RUNNING; 216 state->dmabuf.enable |= ADC_RUNNING;
217 tmp |= 0x0004; /* set ADEN */ 217 tmp |= 0x0004; /* set ADEN */
@@ -219,7 +219,7 @@ static void ad1889_startstop_adc(ad1889_state_t *state, int start)
219 state->dmabuf.enable &= ~ADC_RUNNING; 219 state->dmabuf.enable &= ~ADC_RUNNING;
220 tmp &= ~0x0004; /* clear ADEN */ 220 tmp &= ~0x0004; /* clear ADEN */
221 } 221 }
222 AD1889_WRITEW(ad1889_dev, AD_DSRAMC, tmp); 222 AD1889_WRITEW(ad1889_dev, AD_DS_RAMC, tmp);
223 223
224 spin_unlock_irqrestore(&state->card->lock, flags); 224 spin_unlock_irqrestore(&state->card->lock, flags);
225} 225}
@@ -301,53 +301,53 @@ static int ad1889_read_proc (char *page, char **start, off_t off,
301 int len, i; 301 int len, i;
302 ad1889_dev_t *dev = data; 302 ad1889_dev_t *dev = data;
303 ad1889_reg_t regs[] = { 303 ad1889_reg_t regs[] = {
304 { "WSMC", AD_DSWSMC, 16 }, 304 { "WSMC", AD_DS_WSMC, 16 },
305 { "RAMC", AD_DSRAMC, 16 }, 305 { "RAMC", AD_DS_RAMC, 16 },
306 { "WADA", AD_DSWADA, 16 }, 306 { "WADA", AD_DS_WADA, 16 },
307 { "SYDA", AD_DSSYDA, 16 }, 307 { "SYDA", AD_DS_SYDA, 16 },
308 { "WAS", AD_DSWAS, 16 }, 308 { "WAS", AD_DS_WAS, 16 },
309 { "RES", AD_DSRES, 16 }, 309 { "RES", AD_DS_RES, 16 },
310 { "CCS", AD_DSCCS, 16 }, 310 { "CCS", AD_DS_CCS, 16 },
311 { "ADCBA", AD_DMAADCBA, 32 }, 311 { "ADCBA", AD_DMA_ADCBA, 32 },
312 { "ADCCA", AD_DMAADCCA, 32 }, 312 { "ADCCA", AD_DMA_ADCCA, 32 },
313 { "ADCBC", AD_DMAADCBC, 32 }, 313 { "ADCBC", AD_DMA_ADCBC, 32 },
314 { "ADCCC", AD_DMAADCCC, 32 }, 314 { "ADCCC", AD_DMA_ADCCC, 32 },
315 { "ADCIBC", AD_DMAADCIBC, 32 }, 315 { "ADCIBC", AD_DMA_ADCIBC, 32 },
316 { "ADCICC", AD_DMAADCICC, 32 }, 316 { "ADCICC", AD_DMA_ADCICC, 32 },
317 { "ADCCTRL", AD_DMAADCCTRL, 16 }, 317 { "ADCCTRL", AD_DMA_ADCCTRL, 16 },
318 { "WAVBA", AD_DMAWAVBA, 32 }, 318 { "WAVBA", AD_DMA_WAVBA, 32 },
319 { "WAVCA", AD_DMAWAVCA, 32 }, 319 { "WAVCA", AD_DMA_WAVCA, 32 },
320 { "WAVBC", AD_DMAWAVBC, 32 }, 320 { "WAVBC", AD_DMA_WAVBC, 32 },
321 { "WAVCC", AD_DMAWAVCC, 32 }, 321 { "WAVCC", AD_DMA_WAVCC, 32 },
322 { "WAVIBC", AD_DMAWAVIBC, 32 }, 322 { "WAVIBC", AD_DMA_WAVIBC, 32 },
323 { "WAVICC", AD_DMAWAVICC, 32 }, 323 { "WAVICC", AD_DMA_WAVICC, 32 },
324 { "WAVCTRL", AD_DMAWAVCTRL, 16 }, 324 { "WAVCTRL", AD_DMA_WAVCTRL, 16 },
325 { "DISR", AD_DMADISR, 32 }, 325 { "DISR", AD_DMA_DISR, 32 },
326 { "CHSS", AD_DMACHSS, 32 }, 326 { "CHSS", AD_DMA_CHSS, 32 },
327 { "IPC", AD_GPIOIPC, 16 }, 327 { "IPC", AD_GPIO_IPC, 16 },
328 { "OP", AD_GPIOOP, 16 }, 328 { "OP", AD_GPIO_OP, 16 },
329 { "IP", AD_GPIOIP, 16 }, 329 { "IP", AD_GPIO_IP, 16 },
330 { "ACIC", AD_ACIC, 16 }, 330 { "ACIC", AD_AC97_ACIC, 16 },
331 { "AC97_RESET", 0x100 + AC97_RESET, 16 }, 331 { "AC97_RESET", AD_AC97_BASE + AC97_RESET, 16 },
332 { "AC97_MASTER_VOL_STEREO", 0x100 + AC97_MASTER_VOL_STEREO, 16 }, 332 { "AC97_MASTER_VOL_STEREO", AD_AC97_BASE + AC97_MASTER_VOL_STEREO, 16 },
333 { "AC97_HEADPHONE_VOL", 0x100 + AC97_HEADPHONE_VOL, 16 }, 333 { "AC97_HEADPHONE_VOL", AD_AC97_BASE + AC97_HEADPHONE_VOL, 16 },
334 { "AC97_MASTER_VOL_MONO", 0x100 + AC97_MASTER_VOL_MONO, 16 }, 334 { "AC97_MASTER_VOL_MONO", AD_AC97_BASE + AC97_MASTER_VOL_MONO, 16 },
335 { "AC97_MASTER_TONE", 0x100 + AC97_MASTER_TONE, 16 }, 335 { "AC97_MASTER_TONE", AD_AC97_BASE + AC97_MASTER_TONE, 16 },
336 { "AC97_PCBEEP_VOL", 0x100 + AC97_PCBEEP_VOL, 16 }, 336 { "AC97_PCBEEP_VOL", AD_AC97_BASE + AC97_PCBEEP_VOL, 16 },
337 { "AC97_PHONE_VOL", 0x100 + AC97_PHONE_VOL, 16 }, 337 { "AC97_PHONE_VOL", AD_AC97_BASE + AC97_PHONE_VOL, 16 },
338 { "AC97_MIC_VOL", 0x100 + AC97_MIC_VOL, 16 }, 338 { "AC97_MIC_VOL", AD_AC97_BASE + AC97_MIC_VOL, 16 },
339 { "AC97_LINEIN_VOL", 0x100 + AC97_LINEIN_VOL, 16 }, 339 { "AC97_LINEIN_VOL", AD_AC97_BASE + AC97_LINEIN_VOL, 16 },
340 { "AC97_CD_VOL", 0x100 + AC97_CD_VOL, 16 }, 340 { "AC97_CD_VOL", AD_AC97_BASE + AC97_CD_VOL, 16 },
341 { "AC97_VIDEO_VOL", 0x100 + AC97_VIDEO_VOL, 16 }, 341 { "AC97_VIDEO_VOL", AD_AC97_BASE + AC97_VIDEO_VOL, 16 },
342 { "AC97_AUX_VOL", 0x100 + AC97_AUX_VOL, 16 }, 342 { "AC97_AUX_VOL", AD_AC97_BASE + AC97_AUX_VOL, 16 },
343 { "AC97_PCMOUT_VOL", 0x100 + AC97_PCMOUT_VOL, 16 }, 343 { "AC97_PCMOUT_VOL", AD_AC97_BASE + AC97_PCMOUT_VOL, 16 },
344 { "AC97_RECORD_SELECT", 0x100 + AC97_RECORD_SELECT, 16 }, 344 { "AC97_RECORD_SELECT", AD_AC97_BASE + AC97_RECORD_SELECT, 16 },
345 { "AC97_RECORD_GAIN", 0x100 + AC97_RECORD_GAIN, 16 }, 345 { "AC97_RECORD_GAIN", AD_AC97_BASE + AC97_RECORD_GAIN, 16 },
346 { "AC97_RECORD_GAIN_MIC", 0x100 + AC97_RECORD_GAIN_MIC, 16 }, 346 { "AC97_RECORD_GAIN_MIC", AD_AC97_BASE + AC97_RECORD_GAIN_MIC, 16 },
347 { "AC97_GENERAL_PURPOSE", 0x100 + AC97_GENERAL_PURPOSE, 16 }, 347 { "AC97_GENERAL_PURPOSE", AD_AC97_BASE + AC97_GENERAL_PURPOSE, 16 },
348 { "AC97_3D_CONTROL", 0x100 + AC97_3D_CONTROL, 16 }, 348 { "AC97_3D_CONTROL", AD_AC97_BASE + AC97_3D_CONTROL, 16 },
349 { "AC97_MODEM_RATE", 0x100 + AC97_MODEM_RATE, 16 }, 349 { "AC97_MODEM_RATE", AD_AC97_BASE + AC97_MODEM_RATE, 16 },
350 { "AC97_POWER_CONTROL", 0x100 + AC97_POWER_CONTROL, 16 }, 350 { "AC97_POWER_CONTROL", AD_AC97_BASE + AC97_POWER_CONTROL, 16 },
351 { NULL } 351 { NULL }
352 }; 352 };
353 353
@@ -400,9 +400,9 @@ static inline unsigned long ad1889_get_dma_addr(ad1889_state_t *state)
400 } 400 }
401 401
402 if (dmabuf->enable & DAC_RUNNING) 402 if (dmabuf->enable & DAC_RUNNING)
403 offset = le32_to_cpu(AD1889_READL(state->card, AD_DMAWAVBA)); 403 offset = le32_to_cpu(AD1889_READL(state->card, AD_DMA_WAVBA));
404 else 404 else
405 offset = le32_to_cpu(AD1889_READL(state->card, AD_DMAADCBA)); 405 offset = le32_to_cpu(AD1889_READL(state->card, AD_DMA_ADCBA));
406 406
407 return (unsigned long)bus_to_virt((unsigned long)offset) - (unsigned long)dmabuf->rawbuf; 407 return (unsigned long)bus_to_virt((unsigned long)offset) - (unsigned long)dmabuf->rawbuf;
408} 408}
@@ -639,9 +639,9 @@ static int ad1889_ioctl(struct inode *inode, struct file *file, unsigned int cmd
639 if (val > 5400 && val < 48000) 639 if (val > 5400 && val < 48000)
640 { 640 {
641 if (file->f_mode & FMODE_WRITE) 641 if (file->f_mode & FMODE_WRITE)
642 AD1889_WRITEW(ad1889_dev, AD_DSWAS, val); 642 AD1889_WRITEW(ad1889_dev, AD_DS_WAS, val);
643 if (file->f_mode & FMODE_READ) 643 if (file->f_mode & FMODE_READ)
644 AD1889_WRITEW(ad1889_dev, AD_DSRES, val); 644 AD1889_WRITEW(ad1889_dev, AD_DS_RES, val);
645 } 645 }
646 return 0; 646 return 0;
647 647
@@ -649,22 +649,22 @@ static int ad1889_ioctl(struct inode *inode, struct file *file, unsigned int cmd
649 if (get_user(val, p)) 649 if (get_user(val, p))
650 return -EFAULT; 650 return -EFAULT;
651 if (file->f_mode & FMODE_READ) { 651 if (file->f_mode & FMODE_READ) {
652 val = AD1889_READW(ad1889_dev, AD_DSWSMC); 652 val = AD1889_READW(ad1889_dev, AD_DS_WSMC);
653 if (val) { 653 if (val) {
654 val |= 0x0200; /* set WAST */ 654 val |= 0x0200; /* set WAST */
655 } else { 655 } else {
656 val &= ~0x0200; /* clear WAST */ 656 val &= ~0x0200; /* clear WAST */
657 } 657 }
658 AD1889_WRITEW(ad1889_dev, AD_DSWSMC, val); 658 AD1889_WRITEW(ad1889_dev, AD_DS_WSMC, val);
659 } 659 }
660 if (file->f_mode & FMODE_WRITE) { 660 if (file->f_mode & FMODE_WRITE) {
661 val = AD1889_READW(ad1889_dev, AD_DSRAMC); 661 val = AD1889_READW(ad1889_dev, AD_DS_RAMC);
662 if (val) { 662 if (val) {
663 val |= 0x0002; /* set ADST */ 663 val |= 0x0002; /* set ADST */
664 } else { 664 } else {
665 val &= ~0x0002; /* clear ADST */ 665 val &= ~0x0002; /* clear ADST */
666 } 666 }
667 AD1889_WRITEW(ad1889_dev, AD_DSRAMC, val); 667 AD1889_WRITEW(ad1889_dev, AD_DS_RAMC, val);
668 } 668 }
669 669
670 return 0; 670 return 0;
@@ -739,7 +739,7 @@ static int ad1889_ioctl(struct inode *inode, struct file *file, unsigned int cmd
739 break; 739 break;
740 740
741 case SOUND_PCM_READ_RATE: 741 case SOUND_PCM_READ_RATE:
742 return put_user(AD1889_READW(ad1889_dev, AD_DSWAS), p); 742 return put_user(AD1889_READW(ad1889_dev, AD_DS_WAS), p);
743 743
744 case SOUND_PCM_READ_CHANNELS: 744 case SOUND_PCM_READ_CHANNELS:
745 case SOUND_PCM_READ_BITS: 745 case SOUND_PCM_READ_BITS:
@@ -769,7 +769,7 @@ static int ad1889_open(struct inode *inode, struct file *file)
769 769
770 ad1889_set_wav_rate(ad1889_dev, 48000); 770 ad1889_set_wav_rate(ad1889_dev, 48000);
771 ad1889_set_wav_fmt(ad1889_dev, AFMT_S16_LE); 771 ad1889_set_wav_fmt(ad1889_dev, AFMT_S16_LE);
772 AD1889_WRITEW(ad1889_dev, AD_DSWADA, 0x0404); /* attenuation */ 772 AD1889_WRITEW(ad1889_dev, AD_DS_WADA, 0x0404); /* attenuation */
773 return nonseekable_open(inode, file); 773 return nonseekable_open(inode, file);
774} 774}
775 775
@@ -826,15 +826,15 @@ static void ad1889_codec_write(struct ac97_codec *ac97, u8 reg, u16 val)
826{ 826{
827 ad1889_dev_t *dev = ac97->private_data; 827 ad1889_dev_t *dev = ac97->private_data;
828 828
829 //DBG("Writing 0x%x to 0x%lx\n", val, dev->regbase + 0x100 + reg); 829 //DBG("Writing 0x%x to 0x%lx\n", val, dev->regbase + AD_AC97_BASE + reg);
830 AD1889_WRITEW(dev, 0x100 + reg, val); 830 AD1889_WRITEW(dev, AD_AC97_BASE + reg, val);
831} 831}
832 832
833static u16 ad1889_codec_read(struct ac97_codec *ac97, u8 reg) 833static u16 ad1889_codec_read(struct ac97_codec *ac97, u8 reg)
834{ 834{
835 ad1889_dev_t *dev = ac97->private_data; 835 ad1889_dev_t *dev = ac97->private_data;
836 //DBG("Reading from 0x%lx\n", dev->regbase + 0x100 + reg); 836 //DBG("Reading from 0x%lx\n", dev->regbase + AD_AC97_BASE + reg);
837 return AD1889_READW(dev, 0x100 + reg); 837 return AD1889_READW(dev, AD_AC97_BASE + reg);
838} 838}
839 839
840static int ad1889_ac97_init(ad1889_dev_t *dev, int id) 840static int ad1889_ac97_init(ad1889_dev_t *dev, int id)
@@ -883,24 +883,24 @@ static int ad1889_aclink_reset(struct pci_dev * pcidev)
883 int retry = 200; 883 int retry = 200;
884 ad1889_dev_t *dev = pci_get_drvdata(pcidev); 884 ad1889_dev_t *dev = pci_get_drvdata(pcidev);
885 885
886 AD1889_WRITEW(dev, AD_DSCCS, 0x8000); /* turn on clock */ 886 AD1889_WRITEW(dev, AD_DS_CCS, 0x8000); /* turn on clock */
887 AD1889_READW(dev, AD_DSCCS); 887 AD1889_READW(dev, AD_DS_CCS);
888 888
889 WAIT_10MS(); 889 WAIT_10MS();
890 890
891 stat = AD1889_READW(dev, AD_ACIC); 891 stat = AD1889_READW(dev, AD_AC97_ACIC);
892 stat |= 0x0002; /* Reset Disable */ 892 stat |= 0x0002; /* Reset Disable */
893 AD1889_WRITEW(dev, AD_ACIC, stat); 893 AD1889_WRITEW(dev, AD_AC97_ACIC, stat);
894 (void) AD1889_READW(dev, AD_ACIC); /* flush posted write */ 894 (void) AD1889_READW(dev, AD_AC97_ACIC); /* flush posted write */
895 895
896 udelay(10); 896 udelay(10);
897 897
898 stat = AD1889_READW(dev, AD_ACIC); 898 stat = AD1889_READW(dev, AD_AC97_ACIC);
899 stat |= 0x0001; /* Interface Enable */ 899 stat |= 0x0001; /* Interface Enable */
900 AD1889_WRITEW(dev, AD_ACIC, stat); 900 AD1889_WRITEW(dev, AD_AC97_ACIC, stat);
901 901
902 do { 902 do {
903 if (AD1889_READW(dev, AD_ACIC) & 0x8000) /* Ready */ 903 if (AD1889_READW(dev, AD_AC97_ACIC) & 0x8000) /* Ready */
904 break; 904 break;
905 WAIT_10MS(); 905 WAIT_10MS();
906 retry--; 906 retry--;
@@ -908,16 +908,16 @@ static int ad1889_aclink_reset(struct pci_dev * pcidev)
908 908
909 if (!retry) { 909 if (!retry) {
910 printk(KERN_ERR "ad1889_aclink_reset: codec is not ready [0x%x]\n", 910 printk(KERN_ERR "ad1889_aclink_reset: codec is not ready [0x%x]\n",
911 AD1889_READW(dev, AD_ACIC)); 911 AD1889_READW(dev, AD_AC97_ACIC));
912 return -EBUSY; 912 return -EBUSY;
913 } 913 }
914 914
915 /* TODO reset AC97 codec */ 915 /* TODO reset AC97 codec */
916 /* TODO set wave/adc pci ctrl status */ 916 /* TODO set wave/adc pci ctrl status */
917 917
918 stat = AD1889_READW(dev, AD_ACIC); 918 stat = AD1889_READW(dev, AD_AC97_ACIC);
919 stat |= 0x0004; /* Audio Stream Output Enable */ 919 stat |= 0x0004; /* Audio Stream Output Enable */
920 AD1889_WRITEW(dev, AD_ACIC, stat); 920 AD1889_WRITEW(dev, AD_AC97_ACIC, stat);
921 return 0; 921 return 0;
922} 922}
923 923
@@ -935,10 +935,10 @@ static irqreturn_t ad1889_interrupt(int irq, void *dev_id, struct pt_regs *regs)
935 u32 stat; 935 u32 stat;
936 ad1889_dev_t *dev = (ad1889_dev_t *)dev_id; 936 ad1889_dev_t *dev = (ad1889_dev_t *)dev_id;
937 937
938 stat = AD1889_READL(dev, AD_DMADISR); 938 stat = AD1889_READL(dev, AD_DMA_DISR);
939 939
940 /* clear ISR */ 940 /* clear ISR */
941 AD1889_WRITEL(dev, AD_DMADISR, stat); 941 AD1889_WRITEL(dev, AD_DMA_DISR, stat);
942 942
943 if (stat & 0x8) { /* WAVI */ 943 if (stat & 0x8) { /* WAVI */
944 DBG("WAV interrupt\n"); 944 DBG("WAV interrupt\n");
@@ -964,15 +964,15 @@ static void ad1889_initcfg(ad1889_dev_t *dev)
964 u32 tmp32; 964 u32 tmp32;
965 965
966 /* make sure the interrupt bits are setup the way we want */ 966 /* make sure the interrupt bits are setup the way we want */
967 tmp32 = AD1889_READL(dev, AD_DMAWAVCTRL); 967 tmp32 = AD1889_READL(dev, AD_DMA_WAVCTRL);
968 tmp32 &= ~0xff; /* flat dma, no sg, mask out the intr bits */ 968 tmp32 &= ~0xff; /* flat dma, no sg, mask out the intr bits */
969 tmp32 |= 0x6; /* intr on count, loop */ 969 tmp32 |= 0x6; /* intr on count, loop */
970 AD1889_WRITEL(dev, AD_DMAWAVCTRL, tmp32); 970 AD1889_WRITEL(dev, AD_DMA_WAVCTRL, tmp32);
971 971
972 /* unmute... */ 972 /* unmute... */
973 tmp16 = AD1889_READW(dev, AD_DSWADA); 973 tmp16 = AD1889_READW(dev, AD_DS_WADA);
974 tmp16 &= ~0x8080; 974 tmp16 &= ~0x8080;
975 AD1889_WRITEW(dev, AD_DSWADA, tmp16); 975 AD1889_WRITEW(dev, AD_DS_WADA, tmp16);
976} 976}
977 977
978static int __devinit ad1889_probe(struct pci_dev *pcidev, const struct pci_device_id *ent) 978static int __devinit ad1889_probe(struct pci_dev *pcidev, const struct pci_device_id *ent)
@@ -1005,7 +1005,7 @@ static int __devinit ad1889_probe(struct pci_dev *pcidev, const struct pci_devic
1005 goto out1; 1005 goto out1;
1006 } 1006 }
1007 1007
1008 dev->regbase = ioremap_nocache(bar, AD_DSIOMEMSIZE); 1008 dev->regbase = ioremap_nocache(bar, AD_DS_IOMEMSIZE);
1009 if (!dev->regbase) { 1009 if (!dev->regbase) {
1010 printk(KERN_ERR DEVNAME ": unable to remap iomem\n"); 1010 printk(KERN_ERR DEVNAME ": unable to remap iomem\n");
1011 goto out2; 1011 goto out2;