aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/pci/au88x0/au88x0.c33
-rw-r--r--sound/pci/au88x0/au88x0.h4
-rw-r--r--sound/pci/au88x0/au88x0_a3d.c21
-rw-r--r--sound/pci/au88x0/au88x0_core.c102
-rw-r--r--sound/pci/au88x0/au88x0_eq.c3
-rw-r--r--sound/pci/au88x0/au88x0_game.c3
-rw-r--r--sound/pci/au88x0/au88x0_mpu401.c2
-rw-r--r--sound/pci/au88x0/au88x0_pcm.c8
-rw-r--r--sound/pci/au88x0/au88x0_synth.c17
-rw-r--r--sound/usb/mixer.c9
10 files changed, 107 insertions, 95 deletions
diff --git a/sound/pci/au88x0/au88x0.c b/sound/pci/au88x0/au88x0.c
index 21ce31f636bc..e9c3833f6d44 100644
--- a/sound/pci/au88x0/au88x0.c
+++ b/sound/pci/au88x0/au88x0.c
@@ -48,11 +48,10 @@ static void vortex_fix_latency(struct pci_dev *vortex)
48{ 48{
49 int rc; 49 int rc;
50 if (!(rc = pci_write_config_byte(vortex, 0x40, 0xff))) { 50 if (!(rc = pci_write_config_byte(vortex, 0x40, 0xff))) {
51 pr_info( CARD_NAME 51 dev_info(&vortex->dev, "vortex latency is 0xff\n");
52 ": vortex latency is 0xff\n");
53 } else { 52 } else {
54 pr_warn( CARD_NAME 53 dev_warn(&vortex->dev,
55 ": could not set vortex latency: pci error 0x%x\n", rc); 54 "could not set vortex latency: pci error 0x%x\n", rc);
56 } 55 }
57} 56}
58 57
@@ -70,11 +69,10 @@ static void vortex_fix_agp_bridge(struct pci_dev *via)
70 if (!(rc = pci_read_config_byte(via, 0x42, &value)) 69 if (!(rc = pci_read_config_byte(via, 0x42, &value))
71 && ((value & 0x10) 70 && ((value & 0x10)
72 || !(rc = pci_write_config_byte(via, 0x42, value | 0x10)))) { 71 || !(rc = pci_write_config_byte(via, 0x42, value | 0x10)))) {
73 pr_info( CARD_NAME 72 dev_info(&via->dev, "bridge config is 0x%x\n", value | 0x10);
74 ": bridge config is 0x%x\n", value | 0x10);
75 } else { 73 } else {
76 pr_warn( CARD_NAME 74 dev_warn(&via->dev,
77 ": could not set vortex latency: pci error 0x%x\n", rc); 75 "could not set vortex latency: pci error 0x%x\n", rc);
78 } 76 }
79} 77}
80 78
@@ -97,7 +95,8 @@ static void snd_vortex_workaround(struct pci_dev *vortex, int fix)
97 PCI_DEVICE_ID_AMD_FE_GATE_7007, NULL); 95 PCI_DEVICE_ID_AMD_FE_GATE_7007, NULL);
98 } 96 }
99 if (via) { 97 if (via) {
100 pr_info( CARD_NAME ": Activating latency workaround...\n"); 98 dev_info(&vortex->dev,
99 "Activating latency workaround...\n");
101 vortex_fix_latency(vortex); 100 vortex_fix_latency(vortex);
102 vortex_fix_agp_bridge(via); 101 vortex_fix_agp_bridge(via);
103 } 102 }
@@ -153,7 +152,7 @@ snd_vortex_create(struct snd_card *card, struct pci_dev *pci, vortex_t ** rchip)
153 return err; 152 return err;
154 if (pci_set_dma_mask(pci, DMA_BIT_MASK(32)) < 0 || 153 if (pci_set_dma_mask(pci, DMA_BIT_MASK(32)) < 0 ||
155 pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(32)) < 0) { 154 pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(32)) < 0) {
156 pr_err( "error to set DMA mask\n"); 155 dev_err(card->dev, "error to set DMA mask\n");
157 pci_disable_device(pci); 156 pci_disable_device(pci);
158 return -ENXIO; 157 return -ENXIO;
159 } 158 }
@@ -182,7 +181,7 @@ snd_vortex_create(struct snd_card *card, struct pci_dev *pci, vortex_t ** rchip)
182 181
183 chip->mmio = pci_ioremap_bar(pci, 0); 182 chip->mmio = pci_ioremap_bar(pci, 0);
184 if (!chip->mmio) { 183 if (!chip->mmio) {
185 pr_err( "MMIO area remap failed.\n"); 184 dev_err(card->dev, "MMIO area remap failed.\n");
186 err = -ENOMEM; 185 err = -ENOMEM;
187 goto ioremap_out; 186 goto ioremap_out;
188 } 187 }
@@ -191,14 +190,14 @@ snd_vortex_create(struct snd_card *card, struct pci_dev *pci, vortex_t ** rchip)
191 * This must be done before we do request_irq otherwise we can get spurious 190 * This must be done before we do request_irq otherwise we can get spurious
192 * interrupts that we do not handle properly and make a mess of things */ 191 * interrupts that we do not handle properly and make a mess of things */
193 if ((err = vortex_core_init(chip)) != 0) { 192 if ((err = vortex_core_init(chip)) != 0) {
194 pr_err( "hw core init failed\n"); 193 dev_err(card->dev, "hw core init failed\n");
195 goto core_out; 194 goto core_out;
196 } 195 }
197 196
198 if ((err = request_irq(pci->irq, vortex_interrupt, 197 if ((err = request_irq(pci->irq, vortex_interrupt,
199 IRQF_SHARED, KBUILD_MODNAME, 198 IRQF_SHARED, KBUILD_MODNAME,
200 chip)) != 0) { 199 chip)) != 0) {
201 pr_err( "cannot grab irq\n"); 200 dev_err(card->dev, "cannot grab irq\n");
202 goto irq_out; 201 goto irq_out;
203 } 202 }
204 chip->irq = pci->irq; 203 chip->irq = pci->irq;
@@ -342,11 +341,11 @@ snd_vortex_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
342 chip->rev = pci->revision; 341 chip->rev = pci->revision;
343#ifdef CHIP_AU8830 342#ifdef CHIP_AU8830
344 if ((chip->rev) != 0xfe && (chip->rev) != 0xfa) { 343 if ((chip->rev) != 0xfe && (chip->rev) != 0xfa) {
345 pr_alert( 344 dev_alert(card->dev,
346 "vortex: The revision (%x) of your card has not been seen before.\n", 345 "The revision (%x) of your card has not been seen before.\n",
347 chip->rev); 346 chip->rev);
348 pr_alert( 347 dev_alert(card->dev,
349 "vortex: Please email the results of 'lspci -vv' to openvortex-dev@nongnu.org.\n"); 348 "Please email the results of 'lspci -vv' to openvortex-dev@nongnu.org.\n");
350 snd_card_free(card); 349 snd_card_free(card);
351 err = -ENODEV; 350 err = -ENODEV;
352 return err; 351 return err;
diff --git a/sound/pci/au88x0/au88x0.h b/sound/pci/au88x0/au88x0.h
index 466a5c8e8354..3a8fefefea77 100644
--- a/sound/pci/au88x0/au88x0.h
+++ b/sound/pci/au88x0/au88x0.h
@@ -243,7 +243,7 @@ static int vortex_core_init(vortex_t * card);
243static int vortex_core_shutdown(vortex_t * card); 243static int vortex_core_shutdown(vortex_t * card);
244static void vortex_enable_int(vortex_t * card); 244static void vortex_enable_int(vortex_t * card);
245static irqreturn_t vortex_interrupt(int irq, void *dev_id); 245static irqreturn_t vortex_interrupt(int irq, void *dev_id);
246static int vortex_alsafmt_aspfmt(int alsafmt); 246static int vortex_alsafmt_aspfmt(int alsafmt, vortex_t *v);
247 247
248/* Connection stuff. */ 248/* Connection stuff. */
249static void vortex_connect_default(vortex_t * vortex, int en); 249static void vortex_connect_default(vortex_t * vortex, int en);
@@ -278,7 +278,7 @@ static void vortex_mix_setvolumebyte(vortex_t * vortex, unsigned char mix,
278static void vortex_Vort3D_enable(vortex_t * v); 278static void vortex_Vort3D_enable(vortex_t * v);
279static void vortex_Vort3D_disable(vortex_t * v); 279static void vortex_Vort3D_disable(vortex_t * v);
280static void vortex_Vort3D_connect(vortex_t * vortex, int en); 280static void vortex_Vort3D_connect(vortex_t * vortex, int en);
281static void vortex_Vort3D_InitializeSource(a3dsrc_t * a, int en); 281static void vortex_Vort3D_InitializeSource(a3dsrc_t *a, int en, vortex_t *v);
282#endif 282#endif
283 283
284/* Driver stuff. */ 284/* Driver stuff. */
diff --git a/sound/pci/au88x0/au88x0_a3d.c b/sound/pci/au88x0/au88x0_a3d.c
index 30f760e3d2c0..ab0f87312911 100644
--- a/sound/pci/au88x0/au88x0_a3d.c
+++ b/sound/pci/au88x0/au88x0_a3d.c
@@ -484,12 +484,13 @@ static void a3dsrc_ZeroState(a3dsrc_t * a)
484} 484}
485 485
486/* Reset entire A3D engine */ 486/* Reset entire A3D engine */
487static void a3dsrc_ZeroStateA3D(a3dsrc_t * a) 487static void a3dsrc_ZeroStateA3D(a3dsrc_t *a, vortex_t *v)
488{ 488{
489 int i, var, var2; 489 int i, var, var2;
490 490
491 if ((a->vortex) == NULL) { 491 if ((a->vortex) == NULL) {
492 pr_err( "vortex: ZeroStateA3D: ERROR: a->vortex is NULL\n"); 492 dev_err(v->card->dev,
493 "ZeroStateA3D: ERROR: a->vortex is NULL\n");
493 return; 494 return;
494 } 495 }
495 496
@@ -601,7 +602,7 @@ static void vortex_Vort3D_enable(vortex_t *v)
601 Vort3DRend_Initialize(v, XT_HEADPHONE); 602 Vort3DRend_Initialize(v, XT_HEADPHONE);
602 for (i = 0; i < NR_A3D; i++) { 603 for (i = 0; i < NR_A3D; i++) {
603 vortex_A3dSourceHw_Initialize(v, i % 4, i >> 2); 604 vortex_A3dSourceHw_Initialize(v, i % 4, i >> 2);
604 a3dsrc_ZeroStateA3D(&(v->a3d[0])); 605 a3dsrc_ZeroStateA3D(&v->a3d[0], v);
605 } 606 }
606 /* Register ALSA controls */ 607 /* Register ALSA controls */
607 vortex_a3d_register_controls(v); 608 vortex_a3d_register_controls(v);
@@ -628,15 +629,15 @@ static void vortex_Vort3D_connect(vortex_t * v, int en)
628 v->mixxtlk[0] = 629 v->mixxtlk[0] =
629 vortex_adb_checkinout(v, v->fixed_res, en, VORTEX_RESOURCE_MIXIN); 630 vortex_adb_checkinout(v, v->fixed_res, en, VORTEX_RESOURCE_MIXIN);
630 if (v->mixxtlk[0] < 0) { 631 if (v->mixxtlk[0] < 0) {
631 pr_warn 632 dev_warn(v->card->dev,
632 ("vortex: vortex_Vort3D: ERROR: not enough free mixer resources.\n"); 633 "vortex_Vort3D: ERROR: not enough free mixer resources.\n");
633 return; 634 return;
634 } 635 }
635 v->mixxtlk[1] = 636 v->mixxtlk[1] =
636 vortex_adb_checkinout(v, v->fixed_res, en, VORTEX_RESOURCE_MIXIN); 637 vortex_adb_checkinout(v, v->fixed_res, en, VORTEX_RESOURCE_MIXIN);
637 if (v->mixxtlk[1] < 0) { 638 if (v->mixxtlk[1] < 0) {
638 pr_warn 639 dev_warn(v->card->dev,
639 ("vortex: vortex_Vort3D: ERROR: not enough free mixer resources.\n"); 640 "vortex_Vort3D: ERROR: not enough free mixer resources.\n");
640 return; 641 return;
641 } 642 }
642#endif 643#endif
@@ -676,11 +677,11 @@ static void vortex_Vort3D_connect(vortex_t * v, int en)
676} 677}
677 678
678/* Initialize one single A3D source. */ 679/* Initialize one single A3D source. */
679static void vortex_Vort3D_InitializeSource(a3dsrc_t * a, int en) 680static void vortex_Vort3D_InitializeSource(a3dsrc_t *a, int en, vortex_t *v)
680{ 681{
681 if (a->vortex == NULL) { 682 if (a->vortex == NULL) {
682 pr_warn 683 dev_warn(v->card->dev,
683 ("vortex: Vort3D_InitializeSource: A3D source not initialized\n"); 684 "Vort3D_InitializeSource: A3D source not initialized\n");
684 return; 685 return;
685 } 686 }
686 if (en) { 687 if (en) {
diff --git a/sound/pci/au88x0/au88x0_core.c b/sound/pci/au88x0/au88x0_core.c
index 72e81286b70e..4667c3232b7f 100644
--- a/sound/pci/au88x0/au88x0_core.c
+++ b/sound/pci/au88x0/au88x0_core.c
@@ -285,8 +285,8 @@ vortex_mixer_addWTD(vortex_t * vortex, unsigned char mix, unsigned char ch)
285 temp = hwread(vortex->mmio, prev); 285 temp = hwread(vortex->mmio, prev);
286 //printk(KERN_INFO "vortex: mixAddWTD: while addr=%x, val=%x\n", prev, temp); 286 //printk(KERN_INFO "vortex: mixAddWTD: while addr=%x, val=%x\n", prev, temp);
287 if ((++lifeboat) > 0xf) { 287 if ((++lifeboat) > 0xf) {
288 pr_err( 288 dev_err(vortex->card->dev,
289 "vortex_mixer_addWTD: lifeboat overflow\n"); 289 "vortex_mixer_addWTD: lifeboat overflow\n");
290 return 0; 290 return 0;
291 } 291 }
292 } 292 }
@@ -303,7 +303,7 @@ vortex_mixer_delWTD(vortex_t * vortex, unsigned char mix, unsigned char ch)
303 303
304 eax = hwread(vortex->mmio, VORTEX_MIXER_SR); 304 eax = hwread(vortex->mmio, VORTEX_MIXER_SR);
305 if (((1 << ch) & eax) == 0) { 305 if (((1 << ch) & eax) == 0) {
306 pr_err( "mix ALARM %x\n", eax); 306 dev_err(vortex->card->dev, "mix ALARM %x\n", eax);
307 return 0; 307 return 0;
308 } 308 }
309 ebp = VORTEX_MIXER_CHNBASE + (ch << 2); 309 ebp = VORTEX_MIXER_CHNBASE + (ch << 2);
@@ -324,8 +324,8 @@ vortex_mixer_delWTD(vortex_t * vortex, unsigned char mix, unsigned char ch)
324 //printk(KERN_INFO "vortex: mixdelWTD: 1 addr=%x, val=%x, src=%x\n", ebx, edx, src); 324 //printk(KERN_INFO "vortex: mixdelWTD: 1 addr=%x, val=%x, src=%x\n", ebx, edx, src);
325 while ((edx & 0xf) != mix) { 325 while ((edx & 0xf) != mix) {
326 if ((esi) > 0xf) { 326 if ((esi) > 0xf) {
327 pr_err( 327 dev_err(vortex->card->dev,
328 "vortex: mixdelWTD: error lifeboat overflow\n"); 328 "mixdelWTD: error lifeboat overflow\n");
329 return 0; 329 return 0;
330 } 330 }
331 esp14 = ebx; 331 esp14 = ebx;
@@ -492,7 +492,7 @@ vortex_src_persist_convratio(vortex_t * vortex, unsigned char src, int ratio)
492 hwwrite(vortex->mmio, VORTEX_SRC_CONVRATIO + (src << 2), ratio); 492 hwwrite(vortex->mmio, VORTEX_SRC_CONVRATIO + (src << 2), ratio);
493 temp = hwread(vortex->mmio, VORTEX_SRC_CONVRATIO + (src << 2)); 493 temp = hwread(vortex->mmio, VORTEX_SRC_CONVRATIO + (src << 2));
494 if ((++lifeboat) > 0x9) { 494 if ((++lifeboat) > 0x9) {
495 pr_err( "Vortex: Src cvr fail\n"); 495 dev_err(vortex->card->dev, "Src cvr fail\n");
496 break; 496 break;
497 } 497 }
498 } 498 }
@@ -684,8 +684,8 @@ vortex_src_addWTD(vortex_t * vortex, unsigned char src, unsigned char ch)
684 temp = hwread(vortex->mmio, prev); 684 temp = hwread(vortex->mmio, prev);
685 //printk(KERN_INFO "vortex: srcAddWTD: while addr=%x, val=%x\n", prev, temp); 685 //printk(KERN_INFO "vortex: srcAddWTD: while addr=%x, val=%x\n", prev, temp);
686 if ((++lifeboat) > 0xf) { 686 if ((++lifeboat) > 0xf) {
687 pr_err( 687 dev_err(vortex->card->dev,
688 "vortex_src_addWTD: lifeboat overflow\n"); 688 "vortex_src_addWTD: lifeboat overflow\n");
689 return 0; 689 return 0;
690 } 690 }
691 } 691 }
@@ -703,7 +703,7 @@ vortex_src_delWTD(vortex_t * vortex, unsigned char src, unsigned char ch)
703 703
704 eax = hwread(vortex->mmio, VORTEX_SRCBLOCK_SR); 704 eax = hwread(vortex->mmio, VORTEX_SRCBLOCK_SR);
705 if (((1 << ch) & eax) == 0) { 705 if (((1 << ch) & eax) == 0) {
706 pr_err( "src alarm\n"); 706 dev_err(vortex->card->dev, "src alarm\n");
707 return 0; 707 return 0;
708 } 708 }
709 ebp = VORTEX_SRC_CHNBASE + (ch << 2); 709 ebp = VORTEX_SRC_CHNBASE + (ch << 2);
@@ -724,8 +724,8 @@ vortex_src_delWTD(vortex_t * vortex, unsigned char src, unsigned char ch)
724 //printk(KERN_INFO "vortex: srcdelWTD: 1 addr=%x, val=%x, src=%x\n", ebx, edx, src); 724 //printk(KERN_INFO "vortex: srcdelWTD: 1 addr=%x, val=%x, src=%x\n", ebx, edx, src);
725 while ((edx & 0xf) != src) { 725 while ((edx & 0xf) != src) {
726 if ((esi) > 0xf) { 726 if ((esi) > 0xf) {
727 pr_warn 727 dev_warn(vortex->card->dev,
728 ("vortex: srcdelWTD: error, lifeboat overflow\n"); 728 "srcdelWTD: error, lifeboat overflow\n");
729 return 0; 729 return 0;
730 } 730 }
731 esp14 = ebx; 731 esp14 = ebx;
@@ -819,8 +819,8 @@ vortex_fifo_setadbctrl(vortex_t * vortex, int fifo, int stereo, int priority,
819 do { 819 do {
820 temp = hwread(vortex->mmio, VORTEX_FIFO_ADBCTRL + (fifo << 2)); 820 temp = hwread(vortex->mmio, VORTEX_FIFO_ADBCTRL + (fifo << 2));
821 if (lifeboat++ > 0xbb8) { 821 if (lifeboat++ > 0xbb8) {
822 pr_err( 822 dev_err(vortex->card->dev,
823 "Vortex: vortex_fifo_setadbctrl fail\n"); 823 "vortex_fifo_setadbctrl fail\n");
824 break; 824 break;
825 } 825 }
826 } 826 }
@@ -915,7 +915,8 @@ vortex_fifo_setwtctrl(vortex_t * vortex, int fifo, int ctrl, int priority,
915 do { 915 do {
916 temp = hwread(vortex->mmio, VORTEX_FIFO_WTCTRL + (fifo << 2)); 916 temp = hwread(vortex->mmio, VORTEX_FIFO_WTCTRL + (fifo << 2));
917 if (lifeboat++ > 0xbb8) { 917 if (lifeboat++ > 0xbb8) {
918 pr_err( "Vortex: vortex_fifo_setwtctrl fail\n"); 918 dev_err(vortex->card->dev,
919 "vortex_fifo_setwtctrl fail\n");
919 break; 920 break;
920 } 921 }
921 } 922 }
@@ -1042,7 +1043,7 @@ static void vortex_fifo_init(vortex_t * vortex)
1042 for (x = NR_ADB - 1; x >= 0; x--) { 1043 for (x = NR_ADB - 1; x >= 0; x--) {
1043 hwwrite(vortex->mmio, addr, (FIFO_U0 | FIFO_U1)); 1044 hwwrite(vortex->mmio, addr, (FIFO_U0 | FIFO_U1));
1044 if (hwread(vortex->mmio, addr) != (FIFO_U0 | FIFO_U1)) 1045 if (hwread(vortex->mmio, addr) != (FIFO_U0 | FIFO_U1))
1045 pr_err( "bad adb fifo reset!"); 1046 dev_err(vortex->card->dev, "bad adb fifo reset!");
1046 vortex_fifo_clearadbdata(vortex, x, FIFO_SIZE); 1047 vortex_fifo_clearadbdata(vortex, x, FIFO_SIZE);
1047 addr -= 4; 1048 addr -= 4;
1048 } 1049 }
@@ -1053,9 +1054,9 @@ static void vortex_fifo_init(vortex_t * vortex)
1053 for (x = NR_WT - 1; x >= 0; x--) { 1054 for (x = NR_WT - 1; x >= 0; x--) {
1054 hwwrite(vortex->mmio, addr, FIFO_U0); 1055 hwwrite(vortex->mmio, addr, FIFO_U0);
1055 if (hwread(vortex->mmio, addr) != FIFO_U0) 1056 if (hwread(vortex->mmio, addr) != FIFO_U0)
1056 pr_err( 1057 dev_err(vortex->card->dev,
1057 "bad wt fifo reset (0x%08x, 0x%08x)!\n", 1058 "bad wt fifo reset (0x%08x, 0x%08x)!\n",
1058 addr, hwread(vortex->mmio, addr)); 1059 addr, hwread(vortex->mmio, addr));
1059 vortex_fifo_clearwtdata(vortex, x, FIFO_SIZE); 1060 vortex_fifo_clearwtdata(vortex, x, FIFO_SIZE);
1060 addr -= 4; 1061 addr -= 4;
1061 } 1062 }
@@ -1213,8 +1214,9 @@ static int vortex_adbdma_bufshift(vortex_t * vortex, int adbdma)
1213 if (dma->period_virt >= dma->nr_periods) 1214 if (dma->period_virt >= dma->nr_periods)
1214 dma->period_virt -= dma->nr_periods; 1215 dma->period_virt -= dma->nr_periods;
1215 if (delta != 1) 1216 if (delta != 1)
1216 pr_info( "vortex: %d virt=%d, real=%d, delta=%d\n", 1217 dev_info(vortex->card->dev,
1217 adbdma, dma->period_virt, dma->period_real, delta); 1218 "%d virt=%d, real=%d, delta=%d\n",
1219 adbdma, dma->period_virt, dma->period_real, delta);
1218 1220
1219 return delta; 1221 return delta;
1220} 1222}
@@ -1482,8 +1484,8 @@ static int vortex_wtdma_bufshift(vortex_t * vortex, int wtdma)
1482 dma->period_real = page; 1484 dma->period_real = page;
1483 1485
1484 if (delta != 1) 1486 if (delta != 1)
1485 pr_warn( "vortex: wt virt = %d, delta = %d\n", 1487 dev_warn(vortex->card->dev, "wt virt = %d, delta = %d\n",
1486 dma->period_virt, delta); 1488 dma->period_virt, delta);
1487 1489
1488 return delta; 1490 return delta;
1489} 1491}
@@ -1667,9 +1669,9 @@ vortex_adb_addroutes(vortex_t * vortex, unsigned char channel,
1667 hwread(vortex->mmio, 1669 hwread(vortex->mmio,
1668 VORTEX_ADB_RTBASE + (temp << 2)) & ADB_MASK; 1670 VORTEX_ADB_RTBASE + (temp << 2)) & ADB_MASK;
1669 if ((lifeboat++) > ADB_MASK) { 1671 if ((lifeboat++) > ADB_MASK) {
1670 pr_err( 1672 dev_err(vortex->card->dev,
1671 "vortex_adb_addroutes: unending route! 0x%x\n", 1673 "vortex_adb_addroutes: unending route! 0x%x\n",
1672 *route); 1674 *route);
1673 return; 1675 return;
1674 } 1676 }
1675 } 1677 }
@@ -1703,9 +1705,9 @@ vortex_adb_delroutes(vortex_t * vortex, unsigned char channel,
1703 hwread(vortex->mmio, 1705 hwread(vortex->mmio,
1704 VORTEX_ADB_RTBASE + (prev << 2)) & ADB_MASK; 1706 VORTEX_ADB_RTBASE + (prev << 2)) & ADB_MASK;
1705 if (((lifeboat++) > ADB_MASK) || (temp == ADB_MASK)) { 1707 if (((lifeboat++) > ADB_MASK) || (temp == ADB_MASK)) {
1706 pr_err( 1708 dev_err(vortex->card->dev,
1707 "vortex_adb_delroutes: route not found! 0x%x\n", 1709 "vortex_adb_delroutes: route not found! 0x%x\n",
1708 route0); 1710 route0);
1709 return; 1711 return;
1710 } 1712 }
1711 } 1713 }
@@ -2045,7 +2047,9 @@ vortex_adb_checkinout(vortex_t * vortex, int resmap[], int out, int restype)
2045 } 2047 }
2046 } 2048 }
2047 } 2049 }
2048 pr_err( "vortex: FATAL: ResManager: resource type %d exhausted.\n", restype); 2050 dev_err(vortex->card->dev,
2051 "FATAL: ResManager: resource type %d exhausted.\n",
2052 restype);
2049 return -ENOMEM; 2053 return -ENOMEM;
2050} 2054}
2051 2055
@@ -2173,11 +2177,13 @@ vortex_adb_allocroute(vortex_t *vortex, int dma, int nr_ch, int dir,
2173 memset(stream->resources, 0, 2177 memset(stream->resources, 0,
2174 sizeof(unsigned char) * 2178 sizeof(unsigned char) *
2175 VORTEX_RESOURCE_LAST); 2179 VORTEX_RESOURCE_LAST);
2176 pr_err( "vortex: out of A3D sources. Sorry\n"); 2180 dev_err(vortex->card->dev,
2181 "out of A3D sources. Sorry\n");
2177 return -EBUSY; 2182 return -EBUSY;
2178 } 2183 }
2179 /* (De)Initialize A3D hardware source. */ 2184 /* (De)Initialize A3D hardware source. */
2180 vortex_Vort3D_InitializeSource(&(vortex->a3d[a3d]), en); 2185 vortex_Vort3D_InitializeSource(&vortex->a3d[a3d], en,
2186 vortex);
2181 } 2187 }
2182 /* Make SPDIF out exclusive to "spdif" device when in use. */ 2188 /* Make SPDIF out exclusive to "spdif" device when in use. */
2183 if ((stream->type == VORTEX_PCM_SPDIF) && (en)) { 2189 if ((stream->type == VORTEX_PCM_SPDIF) && (en)) {
@@ -2421,7 +2427,7 @@ static irqreturn_t vortex_interrupt(int irq, void *dev_id)
2421 hwread(vortex->mmio, VORTEX_IRQ_SOURCE); 2427 hwread(vortex->mmio, VORTEX_IRQ_SOURCE);
2422 // Is at least one IRQ flag set? 2428 // Is at least one IRQ flag set?
2423 if (source == 0) { 2429 if (source == 0) {
2424 pr_err( "vortex: missing irq source\n"); 2430 dev_err(vortex->card->dev, "missing irq source\n");
2425 return IRQ_NONE; 2431 return IRQ_NONE;
2426 } 2432 }
2427 2433
@@ -2429,19 +2435,19 @@ static irqreturn_t vortex_interrupt(int irq, void *dev_id)
2429 // Attend every interrupt source. 2435 // Attend every interrupt source.
2430 if (unlikely(source & IRQ_ERR_MASK)) { 2436 if (unlikely(source & IRQ_ERR_MASK)) {
2431 if (source & IRQ_FATAL) { 2437 if (source & IRQ_FATAL) {
2432 pr_err( "vortex: IRQ fatal error\n"); 2438 dev_err(vortex->card->dev, "IRQ fatal error\n");
2433 } 2439 }
2434 if (source & IRQ_PARITY) { 2440 if (source & IRQ_PARITY) {
2435 pr_err( "vortex: IRQ parity error\n"); 2441 dev_err(vortex->card->dev, "IRQ parity error\n");
2436 } 2442 }
2437 if (source & IRQ_REG) { 2443 if (source & IRQ_REG) {
2438 pr_err( "vortex: IRQ reg error\n"); 2444 dev_err(vortex->card->dev, "IRQ reg error\n");
2439 } 2445 }
2440 if (source & IRQ_FIFO) { 2446 if (source & IRQ_FIFO) {
2441 pr_err( "vortex: IRQ fifo error\n"); 2447 dev_err(vortex->card->dev, "IRQ fifo error\n");
2442 } 2448 }
2443 if (source & IRQ_DMA) { 2449 if (source & IRQ_DMA) {
2444 pr_err( "vortex: IRQ dma error\n"); 2450 dev_err(vortex->card->dev, "IRQ dma error\n");
2445 } 2451 }
2446 handled = 1; 2452 handled = 1;
2447 } 2453 }
@@ -2489,7 +2495,7 @@ static irqreturn_t vortex_interrupt(int irq, void *dev_id)
2489 } 2495 }
2490 2496
2491 if (!handled) { 2497 if (!handled) {
2492 pr_err( "vortex: unknown irq source %x\n", source); 2498 dev_err(vortex->card->dev, "unknown irq source %x\n", source);
2493 } 2499 }
2494 return IRQ_RETVAL(handled); 2500 return IRQ_RETVAL(handled);
2495} 2501}
@@ -2546,7 +2552,7 @@ vortex_codec_write(struct snd_ac97 * codec, unsigned short addr, unsigned short
2546 while (!(hwread(card->mmio, VORTEX_CODEC_CTRL) & 0x100)) { 2552 while (!(hwread(card->mmio, VORTEX_CODEC_CTRL) & 0x100)) {
2547 udelay(100); 2553 udelay(100);
2548 if (lifeboat++ > POLL_COUNT) { 2554 if (lifeboat++ > POLL_COUNT) {
2549 pr_err( "vortex: ac97 codec stuck busy\n"); 2555 dev_err(card->card->dev, "ac97 codec stuck busy\n");
2550 return; 2556 return;
2551 } 2557 }
2552 } 2558 }
@@ -2572,7 +2578,7 @@ static unsigned short vortex_codec_read(struct snd_ac97 * codec, unsigned short
2572 while (!(hwread(card->mmio, VORTEX_CODEC_CTRL) & 0x100)) { 2578 while (!(hwread(card->mmio, VORTEX_CODEC_CTRL) & 0x100)) {
2573 udelay(100); 2579 udelay(100);
2574 if (lifeboat++ > POLL_COUNT) { 2580 if (lifeboat++ > POLL_COUNT) {
2575 pr_err( "vortex: ac97 codec stuck busy\n"); 2581 dev_err(card->card->dev, "ac97 codec stuck busy\n");
2576 return 0xffff; 2582 return 0xffff;
2577 } 2583 }
2578 } 2584 }
@@ -2586,7 +2592,8 @@ static unsigned short vortex_codec_read(struct snd_ac97 * codec, unsigned short
2586 udelay(100); 2592 udelay(100);
2587 data = hwread(card->mmio, VORTEX_CODEC_IO); 2593 data = hwread(card->mmio, VORTEX_CODEC_IO);
2588 if (lifeboat++ > POLL_COUNT) { 2594 if (lifeboat++ > POLL_COUNT) {
2589 pr_err( "vortex: ac97 address never arrived\n"); 2595 dev_err(card->card->dev,
2596 "ac97 address never arrived\n");
2590 return 0xffff; 2597 return 0xffff;
2591 } 2598 }
2592 } while ((data & VORTEX_CODEC_ADDMASK) != 2599 } while ((data & VORTEX_CODEC_ADDMASK) !=
@@ -2683,7 +2690,7 @@ static void vortex_spdif_init(vortex_t * vortex, int spdif_sr, int spdif_mode)
2683static int vortex_core_init(vortex_t *vortex) 2690static int vortex_core_init(vortex_t *vortex)
2684{ 2691{
2685 2692
2686 pr_info( "Vortex: init.... "); 2693 dev_info(vortex->card->dev, "init started\n");
2687 /* Hardware Init. */ 2694 /* Hardware Init. */
2688 hwwrite(vortex->mmio, VORTEX_CTRL, 0xffffffff); 2695 hwwrite(vortex->mmio, VORTEX_CTRL, 0xffffffff);
2689 msleep(5); 2696 msleep(5);
@@ -2728,7 +2735,7 @@ static int vortex_core_init(vortex_t *vortex)
2728 //vortex_enable_timer_int(vortex); 2735 //vortex_enable_timer_int(vortex);
2729 //vortex_disable_timer_int(vortex); 2736 //vortex_disable_timer_int(vortex);
2730 2737
2731 pr_info( "done.\n"); 2738 dev_info(vortex->card->dev, "init.... done.\n");
2732 spin_lock_init(&vortex->lock); 2739 spin_lock_init(&vortex->lock);
2733 2740
2734 return 0; 2741 return 0;
@@ -2737,7 +2744,7 @@ static int vortex_core_init(vortex_t *vortex)
2737static int vortex_core_shutdown(vortex_t * vortex) 2744static int vortex_core_shutdown(vortex_t * vortex)
2738{ 2745{
2739 2746
2740 pr_info( "Vortex: shutdown..."); 2747 dev_info(vortex->card->dev, "shutdown started\n");
2741#ifndef CHIP_AU8820 2748#ifndef CHIP_AU8820
2742 vortex_eq_free(vortex); 2749 vortex_eq_free(vortex);
2743 vortex_Vort3D_disable(vortex); 2750 vortex_Vort3D_disable(vortex);
@@ -2759,13 +2766,13 @@ static int vortex_core_shutdown(vortex_t * vortex)
2759 msleep(5); 2766 msleep(5);
2760 hwwrite(vortex->mmio, VORTEX_IRQ_SOURCE, 0xffff); 2767 hwwrite(vortex->mmio, VORTEX_IRQ_SOURCE, 0xffff);
2761 2768
2762 pr_info( "done.\n"); 2769 dev_info(vortex->card->dev, "shutdown.... done.\n");
2763 return 0; 2770 return 0;
2764} 2771}
2765 2772
2766/* Alsa support. */ 2773/* Alsa support. */
2767 2774
2768static int vortex_alsafmt_aspfmt(int alsafmt) 2775static int vortex_alsafmt_aspfmt(int alsafmt, vortex_t *v)
2769{ 2776{
2770 int fmt; 2777 int fmt;
2771 2778
@@ -2793,7 +2800,8 @@ static int vortex_alsafmt_aspfmt(int alsafmt)
2793 break; 2800 break;
2794 default: 2801 default:
2795 fmt = 0x8; 2802 fmt = 0x8;
2796 pr_err( "vortex: format unsupported %d\n", alsafmt); 2803 dev_err(v->card->dev,
2804 "format unsupported %d\n", alsafmt);
2797 break; 2805 break;
2798 } 2806 }
2799 return fmt; 2807 return fmt;
diff --git a/sound/pci/au88x0/au88x0_eq.c b/sound/pci/au88x0/au88x0_eq.c
index 9404ba73eaf6..9585c5c63b96 100644
--- a/sound/pci/au88x0/au88x0_eq.c
+++ b/sound/pci/au88x0/au88x0_eq.c
@@ -845,7 +845,8 @@ snd_vortex_peaks_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *u
845 845
846 vortex_Eqlzr_GetAllPeaks(vortex, peaks, &count); 846 vortex_Eqlzr_GetAllPeaks(vortex, peaks, &count);
847 if (count != 20) { 847 if (count != 20) {
848 pr_err( "vortex: peak count error 20 != %d \n", count); 848 dev_err(vortex->card->dev,
849 "peak count error 20 != %d\n", count);
849 return -1; 850 return -1;
850 } 851 }
851 for (i = 0; i < 20; i++) 852 for (i = 0; i < 20; i++)
diff --git a/sound/pci/au88x0/au88x0_game.c b/sound/pci/au88x0/au88x0_game.c
index 72daf6cf8169..151815b857a0 100644
--- a/sound/pci/au88x0/au88x0_game.c
+++ b/sound/pci/au88x0/au88x0_game.c
@@ -98,7 +98,8 @@ static int vortex_gameport_register(vortex_t *vortex)
98 98
99 vortex->gameport = gp = gameport_allocate_port(); 99 vortex->gameport = gp = gameport_allocate_port();
100 if (!gp) { 100 if (!gp) {
101 pr_err( "vortex: cannot allocate memory for gameport\n"); 101 dev_err(vortex->card->dev,
102 "cannot allocate memory for gameport\n");
102 return -ENOMEM; 103 return -ENOMEM;
103 } 104 }
104 105
diff --git a/sound/pci/au88x0/au88x0_mpu401.c b/sound/pci/au88x0/au88x0_mpu401.c
index 328c1943c0c3..1025e55ca854 100644
--- a/sound/pci/au88x0/au88x0_mpu401.c
+++ b/sound/pci/au88x0/au88x0_mpu401.c
@@ -73,7 +73,7 @@ static int snd_vortex_midi(vortex_t *vortex)
73 /* Check if anything is OK. */ 73 /* Check if anything is OK. */
74 temp = hwread(vortex->mmio, VORTEX_MIDI_DATA); 74 temp = hwread(vortex->mmio, VORTEX_MIDI_DATA);
75 if (temp != MPU401_ACK /*0xfe */ ) { 75 if (temp != MPU401_ACK /*0xfe */ ) {
76 pr_err( "midi port doesn't acknowledge!\n"); 76 dev_err(vortex->card->dev, "midi port doesn't acknowledge!\n");
77 return -ENODEV; 77 return -ENODEV;
78 } 78 }
79 /* Enable MPU401 interrupts. */ 79 /* Enable MPU401 interrupts. */
diff --git a/sound/pci/au88x0/au88x0_pcm.c b/sound/pci/au88x0/au88x0_pcm.c
index 5adc6b92ffab..a6d6d8d0867a 100644
--- a/sound/pci/au88x0/au88x0_pcm.c
+++ b/sound/pci/au88x0/au88x0_pcm.c
@@ -227,7 +227,7 @@ snd_vortex_pcm_hw_params(struct snd_pcm_substream *substream,
227 err = 227 err =
228 snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); 228 snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));
229 if (err < 0) { 229 if (err < 0) {
230 pr_err( "Vortex: pcm page alloc failed!\n"); 230 dev_err(chip->card->dev, "Vortex: pcm page alloc failed!\n");
231 return err; 231 return err;
232 } 232 }
233 /* 233 /*
@@ -332,7 +332,7 @@ static int snd_vortex_pcm_prepare(struct snd_pcm_substream *substream)
332 dir = 1; 332 dir = 1;
333 else 333 else
334 dir = 0; 334 dir = 0;
335 fmt = vortex_alsafmt_aspfmt(runtime->format); 335 fmt = vortex_alsafmt_aspfmt(runtime->format, chip);
336 spin_lock_irq(&chip->lock); 336 spin_lock_irq(&chip->lock);
337 if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) { 337 if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) {
338 vortex_adbdma_setmode(chip, dma, 1, dir, fmt, 338 vortex_adbdma_setmode(chip, dma, 1, dir, fmt,
@@ -371,7 +371,7 @@ static int snd_vortex_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
371 } 371 }
372#ifndef CHIP_AU8810 372#ifndef CHIP_AU8810
373 else { 373 else {
374 pr_info( "vortex: wt start %d\n", dma); 374 dev_info(chip->card->dev, "wt start %d\n", dma);
375 vortex_wtdma_startfifo(chip, dma); 375 vortex_wtdma_startfifo(chip, dma);
376 } 376 }
377#endif 377#endif
@@ -384,7 +384,7 @@ static int snd_vortex_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
384 vortex_adbdma_stopfifo(chip, dma); 384 vortex_adbdma_stopfifo(chip, dma);
385#ifndef CHIP_AU8810 385#ifndef CHIP_AU8810
386 else { 386 else {
387 pr_info( "vortex: wt stop %d\n", dma); 387 dev_info(chip->card->dev, "wt stop %d\n", dma);
388 vortex_wtdma_stopfifo(chip, dma); 388 vortex_wtdma_stopfifo(chip, dma);
389 } 389 }
390#endif 390#endif
diff --git a/sound/pci/au88x0/au88x0_synth.c b/sound/pci/au88x0/au88x0_synth.c
index f094bac24291..78e12f4796f3 100644
--- a/sound/pci/au88x0/au88x0_synth.c
+++ b/sound/pci/au88x0/au88x0_synth.c
@@ -90,7 +90,7 @@ static int vortex_wt_allocroute(vortex_t * vortex, int wt, int nr_ch)
90 hwwrite(vortex->mmio, WT_PARM(wt, 2), 0); 90 hwwrite(vortex->mmio, WT_PARM(wt, 2), 0);
91 91
92 temp = hwread(vortex->mmio, WT_PARM(wt, 3)); 92 temp = hwread(vortex->mmio, WT_PARM(wt, 3));
93 pr_debug( "vortex: WT PARM3: %x\n", temp); 93 dev_dbg(vortex->card->dev, "WT PARM3: %x\n", temp);
94 //hwwrite(vortex->mmio, WT_PARM(wt, 3), temp); 94 //hwwrite(vortex->mmio, WT_PARM(wt, 3), temp);
95 95
96 hwwrite(vortex->mmio, WT_DELAY(wt, 0), 0); 96 hwwrite(vortex->mmio, WT_DELAY(wt, 0), 0);
@@ -98,7 +98,8 @@ static int vortex_wt_allocroute(vortex_t * vortex, int wt, int nr_ch)
98 hwwrite(vortex->mmio, WT_DELAY(wt, 2), 0); 98 hwwrite(vortex->mmio, WT_DELAY(wt, 2), 0);
99 hwwrite(vortex->mmio, WT_DELAY(wt, 3), 0); 99 hwwrite(vortex->mmio, WT_DELAY(wt, 3), 0);
100 100
101 pr_debug( "vortex: WT GMODE: %x\n", hwread(vortex->mmio, WT_GMODE(wt))); 101 dev_dbg(vortex->card->dev, "WT GMODE: %x\n",
102 hwread(vortex->mmio, WT_GMODE(wt)));
102 103
103 hwwrite(vortex->mmio, WT_PARM(wt, 2), 0xffffffff); 104 hwwrite(vortex->mmio, WT_PARM(wt, 2), 0xffffffff);
104 hwwrite(vortex->mmio, WT_PARM(wt, 3), 0xcff1c810); 105 hwwrite(vortex->mmio, WT_PARM(wt, 3), 0xcff1c810);
@@ -106,7 +107,8 @@ static int vortex_wt_allocroute(vortex_t * vortex, int wt, int nr_ch)
106 voice->parm0 = voice->parm1 = 0xcfb23e2f; 107 voice->parm0 = voice->parm1 = 0xcfb23e2f;
107 hwwrite(vortex->mmio, WT_PARM(wt, 0), voice->parm0); 108 hwwrite(vortex->mmio, WT_PARM(wt, 0), voice->parm0);
108 hwwrite(vortex->mmio, WT_PARM(wt, 1), voice->parm1); 109 hwwrite(vortex->mmio, WT_PARM(wt, 1), voice->parm1);
109 pr_debug( "vortex: WT GMODE 2 : %x\n", hwread(vortex->mmio, WT_GMODE(wt))); 110 dev_dbg(vortex->card->dev, "WT GMODE 2 : %x\n",
111 hwread(vortex->mmio, WT_GMODE(wt)));
110 return 0; 112 return 0;
111} 113}
112 114
@@ -196,14 +198,15 @@ vortex_wt_SetReg(vortex_t * vortex, unsigned char reg, int wt,
196 198
197 if ((reg == 5) || ((reg >= 7) && (reg <= 10)) || (reg == 0xc)) { 199 if ((reg == 5) || ((reg >= 7) && (reg <= 10)) || (reg == 0xc)) {
198 if (wt >= (NR_WT / NR_WT_PB)) { 200 if (wt >= (NR_WT / NR_WT_PB)) {
199 pr_warn 201 dev_warn(vortex->card->dev,
200 ("vortex: WT SetReg: bank out of range. reg=0x%x, wt=%d\n", 202 "WT SetReg: bank out of range. reg=0x%x, wt=%d\n",
201 reg, wt); 203 reg, wt);
202 return 0; 204 return 0;
203 } 205 }
204 } else { 206 } else {
205 if (wt >= NR_WT) { 207 if (wt >= NR_WT) {
206 pr_err( "vortex: WT SetReg: voice out of range\n"); 208 dev_err(vortex->card->dev,
209 "WT SetReg: voice out of range\n");
207 return 0; 210 return 0;
208 } 211 }
209 } 212 }
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index 2e4a9dbc51fa..63a8adb1705e 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -1290,9 +1290,8 @@ static void build_feature_ctl(struct mixer_build *state, void *raw_desc,
1290 kctl->id.name, 1290 kctl->id.name,
1291 sizeof(kctl->id.name), 1); 1291 sizeof(kctl->id.name), 1);
1292 if (!len) 1292 if (!len)
1293 len = snprintf(kctl->id.name, 1293 snprintf(kctl->id.name, sizeof(kctl->id.name),
1294 sizeof(kctl->id.name), 1294 "Feature %d", unitid);
1295 "Feature %d", unitid);
1296 } 1295 }
1297 1296
1298 if (!mapped_name) 1297 if (!mapped_name)
@@ -1305,9 +1304,9 @@ static void build_feature_ctl(struct mixer_build *state, void *raw_desc,
1305 */ 1304 */
1306 if (!mapped_name && !(state->oterm.type >> 16)) { 1305 if (!mapped_name && !(state->oterm.type >> 16)) {
1307 if ((state->oterm.type & 0xff00) == 0x0100) 1306 if ((state->oterm.type & 0xff00) == 0x0100)
1308 len = append_ctl_name(kctl, " Capture"); 1307 append_ctl_name(kctl, " Capture");
1309 else 1308 else
1310 len = append_ctl_name(kctl, " Playback"); 1309 append_ctl_name(kctl, " Playback");
1311 } 1310 }
1312 append_ctl_name(kctl, control == UAC_FU_MUTE ? 1311 append_ctl_name(kctl, control == UAC_FU_MUTE ?
1313 " Switch" : " Volume"); 1312 " Switch" : " Volume");