--- zzzz-none-000/linux-3.10.107/sound/pci/au88x0/au88x0_core.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/sound/pci/au88x0/au88x0_core.c 2021-02-04 17:41:59.000000000 +0000 @@ -285,8 +285,8 @@ temp = hwread(vortex->mmio, prev); //printk(KERN_INFO "vortex: mixAddWTD: while addr=%x, val=%x\n", prev, temp); if ((++lifeboat) > 0xf) { - printk(KERN_ERR - "vortex_mixer_addWTD: lifeboat overflow\n"); + dev_err(vortex->card->dev, + "vortex_mixer_addWTD: lifeboat overflow\n"); return 0; } } @@ -303,7 +303,7 @@ eax = hwread(vortex->mmio, VORTEX_MIXER_SR); if (((1 << ch) & eax) == 0) { - printk(KERN_ERR "mix ALARM %x\n", eax); + dev_err(vortex->card->dev, "mix ALARM %x\n", eax); return 0; } ebp = VORTEX_MIXER_CHNBASE + (ch << 2); @@ -324,8 +324,8 @@ //printk(KERN_INFO "vortex: mixdelWTD: 1 addr=%x, val=%x, src=%x\n", ebx, edx, src); while ((edx & 0xf) != mix) { if ((esi) > 0xf) { - printk(KERN_ERR - "vortex: mixdelWTD: error lifeboat overflow\n"); + dev_err(vortex->card->dev, + "mixdelWTD: error lifeboat overflow\n"); return 0; } esp14 = ebx; @@ -492,7 +492,7 @@ hwwrite(vortex->mmio, VORTEX_SRC_CONVRATIO + (src << 2), ratio); temp = hwread(vortex->mmio, VORTEX_SRC_CONVRATIO + (src << 2)); if ((++lifeboat) > 0x9) { - printk(KERN_ERR "Vortex: Src cvr fail\n"); + dev_err(vortex->card->dev, "Src cvr fail\n"); break; } } @@ -545,7 +545,7 @@ hwwrite(vortex->mmio, VORTEX_SRC_CONVRATIO + (src << 2), desired_ratio); if ((lifeboat++) > 15) { - printk(KERN_ERR "Vortex: could not set src-%d from %d to %d\n", + pr_err( "Vortex: could not set src-%d from %d to %d\n", src, hw_ratio, desired_ratio); break; } @@ -684,8 +684,8 @@ temp = hwread(vortex->mmio, prev); //printk(KERN_INFO "vortex: srcAddWTD: while addr=%x, val=%x\n", prev, temp); if ((++lifeboat) > 0xf) { - printk(KERN_ERR - "vortex_src_addWTD: lifeboat overflow\n"); + dev_err(vortex->card->dev, + "vortex_src_addWTD: lifeboat overflow\n"); return 0; } } @@ -703,7 +703,7 @@ eax = hwread(vortex->mmio, VORTEX_SRCBLOCK_SR); if (((1 << ch) & eax) == 0) { - printk(KERN_ERR "src alarm\n"); + dev_err(vortex->card->dev, "src alarm\n"); return 0; } ebp = VORTEX_SRC_CHNBASE + (ch << 2); @@ -724,8 +724,8 @@ //printk(KERN_INFO "vortex: srcdelWTD: 1 addr=%x, val=%x, src=%x\n", ebx, edx, src); while ((edx & 0xf) != src) { if ((esi) > 0xf) { - printk - ("vortex: srcdelWTD: error, lifeboat overflow\n"); + dev_warn(vortex->card->dev, + "srcdelWTD: error, lifeboat overflow\n"); return 0; } esp14 = ebx; @@ -819,8 +819,8 @@ do { temp = hwread(vortex->mmio, VORTEX_FIFO_ADBCTRL + (fifo << 2)); if (lifeboat++ > 0xbb8) { - printk(KERN_ERR - "Vortex: vortex_fifo_setadbctrl fail\n"); + dev_err(vortex->card->dev, + "vortex_fifo_setadbctrl fail\n"); break; } } @@ -915,7 +915,8 @@ do { temp = hwread(vortex->mmio, VORTEX_FIFO_WTCTRL + (fifo << 2)); if (lifeboat++ > 0xbb8) { - printk(KERN_ERR "Vortex: vortex_fifo_setwtctrl fail\n"); + dev_err(vortex->card->dev, + "vortex_fifo_setwtctrl fail\n"); break; } } @@ -970,7 +971,7 @@ do { temp = hwread(vortex->mmio, VORTEX_FIFO_WTCTRL + (fifo << 2)); if (lifeboat++ > 0xbb8) { - printk(KERN_ERR "Vortex: vortex_fifo_setwtctrl fail (hanging)\n"); + pr_err( "Vortex: vortex_fifo_setwtctrl fail (hanging)\n"); break; } } while ((temp & FIFO_RDONLY)&&(temp & FIFO_VALID)&&(temp != 0xFFFFFFFF)); @@ -1042,7 +1043,7 @@ for (x = NR_ADB - 1; x >= 0; x--) { hwwrite(vortex->mmio, addr, (FIFO_U0 | FIFO_U1)); if (hwread(vortex->mmio, addr) != (FIFO_U0 | FIFO_U1)) - printk(KERN_ERR "bad adb fifo reset!"); + dev_err(vortex->card->dev, "bad adb fifo reset!"); vortex_fifo_clearadbdata(vortex, x, FIFO_SIZE); addr -= 4; } @@ -1053,9 +1054,9 @@ for (x = NR_WT - 1; x >= 0; x--) { hwwrite(vortex->mmio, addr, FIFO_U0); if (hwread(vortex->mmio, addr) != FIFO_U0) - printk(KERN_ERR - "bad wt fifo reset (0x%08x, 0x%08x)!\n", - addr, hwread(vortex->mmio, addr)); + dev_err(vortex->card->dev, + "bad wt fifo reset (0x%08x, 0x%08x)!\n", + addr, hwread(vortex->mmio, addr)); vortex_fifo_clearwtdata(vortex, x, FIFO_SIZE); addr -= 4; } @@ -1136,7 +1137,7 @@ break; } /* - printk(KERN_DEBUG "vortex: cfg0 = 0x%x\nvortex: cfg1=0x%x\n", + pr_debug( "vortex: cfg0 = 0x%x\nvortex: cfg1=0x%x\n", dma->cfg0, dma->cfg1); */ hwwrite(vortex->mmio, VORTEX_ADBDMA_BUFCFG0 + (adbdma << 3), dma->cfg0); @@ -1213,8 +1214,9 @@ if (dma->period_virt >= dma->nr_periods) dma->period_virt -= dma->nr_periods; if (delta != 1) - printk(KERN_INFO "vortex: %d virt=%d, real=%d, delta=%d\n", - adbdma, dma->period_virt, dma->period_real, delta); + dev_info(vortex->card->dev, + "%d virt=%d, real=%d, delta=%d\n", + adbdma, dma->period_virt, dma->period_real, delta); return delta; } @@ -1481,8 +1483,8 @@ dma->period_real = page; if (delta != 1) - printk(KERN_WARNING "vortex: wt virt = %d, delta = %d\n", - dma->period_virt, delta); + dev_warn(vortex->card->dev, "wt virt = %d, delta = %d\n", + dma->period_virt, delta); return delta; } @@ -1666,9 +1668,9 @@ hwread(vortex->mmio, VORTEX_ADB_RTBASE + (temp << 2)) & ADB_MASK; if ((lifeboat++) > ADB_MASK) { - printk(KERN_ERR - "vortex_adb_addroutes: unending route! 0x%x\n", - *route); + dev_err(vortex->card->dev, + "vortex_adb_addroutes: unending route! 0x%x\n", + *route); return; } } @@ -1702,9 +1704,9 @@ hwread(vortex->mmio, VORTEX_ADB_RTBASE + (prev << 2)) & ADB_MASK; if (((lifeboat++) > ADB_MASK) || (temp == ADB_MASK)) { - printk(KERN_ERR - "vortex_adb_delroutes: route not found! 0x%x\n", - route0); + dev_err(vortex->card->dev, + "vortex_adb_delroutes: route not found! 0x%x\n", + route0); return; } } @@ -1966,7 +1968,7 @@ ADB_CODECOUT(0 + 4)); vortex_connection_mix_adb(vortex, en, 0x11, mixers[3], ADB_CODECOUT(1 + 4)); - /* printk(KERN_DEBUG "SDAC detected "); */ + /* pr_debug( "SDAC detected "); */ } #else // Use plain direct output to codec. @@ -2021,7 +2023,7 @@ else vortex->dma_adb[i].resources[restype] |= (1 << i); /* - printk(KERN_DEBUG + pr_debug( "vortex: ResManager: type %d out %d\n", restype, i); */ @@ -2036,7 +2038,7 @@ if (resmap[restype] & (1 << i)) { resmap[restype] &= ~(1 << i); /* - printk(KERN_DEBUG + pr_debug( "vortex: ResManager: type %d in %d\n", restype, i); */ @@ -2044,7 +2046,9 @@ } } } - printk(KERN_ERR "vortex: FATAL: ResManager: resource type %d exhausted.\n", restype); + dev_err(vortex->card->dev, + "FATAL: ResManager: resource type %d exhausted.\n", + restype); return -ENOMEM; } @@ -2172,11 +2176,13 @@ memset(stream->resources, 0, sizeof(unsigned char) * VORTEX_RESOURCE_LAST); - printk(KERN_ERR "vortex: out of A3D sources. Sorry\n"); + dev_err(vortex->card->dev, + "out of A3D sources. Sorry\n"); return -EBUSY; } /* (De)Initialize A3D hardware source. */ - vortex_Vort3D_InitializeSource(&(vortex->a3d[a3d]), en); + vortex_Vort3D_InitializeSource(&vortex->a3d[a3d], en, + vortex); } /* Make SPDIF out exclusive to "spdif" device when in use. */ if ((stream->type == VORTEX_PCM_SPDIF) && (en)) { @@ -2420,7 +2426,7 @@ hwread(vortex->mmio, VORTEX_IRQ_SOURCE); // Is at least one IRQ flag set? if (source == 0) { - printk(KERN_ERR "vortex: missing irq source\n"); + dev_err(vortex->card->dev, "missing irq source\n"); return IRQ_NONE; } @@ -2428,19 +2434,19 @@ // Attend every interrupt source. if (unlikely(source & IRQ_ERR_MASK)) { if (source & IRQ_FATAL) { - printk(KERN_ERR "vortex: IRQ fatal error\n"); + dev_err(vortex->card->dev, "IRQ fatal error\n"); } if (source & IRQ_PARITY) { - printk(KERN_ERR "vortex: IRQ parity error\n"); + dev_err(vortex->card->dev, "IRQ parity error\n"); } if (source & IRQ_REG) { - printk(KERN_ERR "vortex: IRQ reg error\n"); + dev_err(vortex->card->dev, "IRQ reg error\n"); } if (source & IRQ_FIFO) { - printk(KERN_ERR "vortex: IRQ fifo error\n"); + dev_err(vortex->card->dev, "IRQ fifo error\n"); } if (source & IRQ_DMA) { - printk(KERN_ERR "vortex: IRQ dma error\n"); + dev_err(vortex->card->dev, "IRQ dma error\n"); } handled = 1; } @@ -2488,7 +2494,7 @@ } if (!handled) { - printk(KERN_ERR "vortex: unknown irq source %x\n", source); + dev_err(vortex->card->dev, "unknown irq source %x\n", source); } return IRQ_RETVAL(handled); } @@ -2545,7 +2551,7 @@ while (!(hwread(card->mmio, VORTEX_CODEC_CTRL) & 0x100)) { udelay(100); if (lifeboat++ > POLL_COUNT) { - printk(KERN_ERR "vortex: ac97 codec stuck busy\n"); + dev_err(card->card->dev, "ac97 codec stuck busy\n"); return; } } @@ -2571,7 +2577,7 @@ while (!(hwread(card->mmio, VORTEX_CODEC_CTRL) & 0x100)) { udelay(100); if (lifeboat++ > POLL_COUNT) { - printk(KERN_ERR "vortex: ac97 codec stuck busy\n"); + dev_err(card->card->dev, "ac97 codec stuck busy\n"); return 0xffff; } } @@ -2585,7 +2591,8 @@ udelay(100); data = hwread(card->mmio, VORTEX_CODEC_IO); if (lifeboat++ > POLL_COUNT) { - printk(KERN_ERR "vortex: ac97 address never arrived\n"); + dev_err(card->card->dev, + "ac97 address never arrived\n"); return 0xffff; } } while ((data & VORTEX_CODEC_ADDMASK) != @@ -2682,7 +2689,7 @@ static int vortex_core_init(vortex_t *vortex) { - printk(KERN_INFO "Vortex: init.... "); + dev_info(vortex->card->dev, "init started\n"); /* Hardware Init. */ hwwrite(vortex->mmio, VORTEX_CTRL, 0xffffffff); msleep(5); @@ -2727,7 +2734,7 @@ //vortex_enable_timer_int(vortex); //vortex_disable_timer_int(vortex); - printk(KERN_INFO "done.\n"); + dev_info(vortex->card->dev, "init.... done.\n"); spin_lock_init(&vortex->lock); return 0; @@ -2736,7 +2743,7 @@ static int vortex_core_shutdown(vortex_t * vortex) { - printk(KERN_INFO "Vortex: shutdown..."); + dev_info(vortex->card->dev, "shutdown started\n"); #ifndef CHIP_AU8820 vortex_eq_free(vortex); vortex_Vort3D_disable(vortex); @@ -2758,13 +2765,13 @@ msleep(5); hwwrite(vortex->mmio, VORTEX_IRQ_SOURCE, 0xffff); - printk(KERN_INFO "done.\n"); + dev_info(vortex->card->dev, "shutdown.... done.\n"); return 0; } /* Alsa support. */ -static int vortex_alsafmt_aspfmt(int alsafmt) +static int vortex_alsafmt_aspfmt(int alsafmt, vortex_t *v) { int fmt; @@ -2792,7 +2799,8 @@ break; default: fmt = 0x8; - printk(KERN_ERR "vortex: format unsupported %d\n", alsafmt); + dev_err(v->card->dev, + "format unsupported %d\n", alsafmt); break; } return fmt;