diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-02-26 06:11:29 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-02-26 10:45:32 -0500 |
commit | 80c19b7513029a5da6542b4f8f22d415d659916d (patch) | |
tree | 67be98bfb50f9915751ac13e19cc07d9fa998313 | |
parent | 09ae539e4d8fda9729e44e57967f7133dadc3f1e (diff) |
ALSA: trident: Use standard printk helpers
Convert with dev_err() and co from snd_printk(), etc.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/trident/trident_main.c | 89 |
1 files changed, 48 insertions, 41 deletions
diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c index 4f3c4be30a48..1272c18a2544 100644 --- a/sound/pci/trident/trident_main.c +++ b/sound/pci/trident/trident_main.c | |||
@@ -69,40 +69,40 @@ static void snd_trident_print_voice_regs(struct snd_trident *trident, int voice) | |||
69 | { | 69 | { |
70 | unsigned int val, tmp; | 70 | unsigned int val, tmp; |
71 | 71 | ||
72 | printk(KERN_DEBUG "Trident voice %i:\n", voice); | 72 | dev_dbg(trident->card->dev, "Trident voice %i:\n", voice); |
73 | outb(voice, TRID_REG(trident, T4D_LFO_GC_CIR)); | 73 | outb(voice, TRID_REG(trident, T4D_LFO_GC_CIR)); |
74 | val = inl(TRID_REG(trident, CH_LBA)); | 74 | val = inl(TRID_REG(trident, CH_LBA)); |
75 | printk(KERN_DEBUG "LBA: 0x%x\n", val); | 75 | dev_dbg(trident->card->dev, "LBA: 0x%x\n", val); |
76 | val = inl(TRID_REG(trident, CH_GVSEL_PAN_VOL_CTRL_EC)); | 76 | val = inl(TRID_REG(trident, CH_GVSEL_PAN_VOL_CTRL_EC)); |
77 | printk(KERN_DEBUG "GVSel: %i\n", val >> 31); | 77 | dev_dbg(trident->card->dev, "GVSel: %i\n", val >> 31); |
78 | printk(KERN_DEBUG "Pan: 0x%x\n", (val >> 24) & 0x7f); | 78 | dev_dbg(trident->card->dev, "Pan: 0x%x\n", (val >> 24) & 0x7f); |
79 | printk(KERN_DEBUG "Vol: 0x%x\n", (val >> 16) & 0xff); | 79 | dev_dbg(trident->card->dev, "Vol: 0x%x\n", (val >> 16) & 0xff); |
80 | printk(KERN_DEBUG "CTRL: 0x%x\n", (val >> 12) & 0x0f); | 80 | dev_dbg(trident->card->dev, "CTRL: 0x%x\n", (val >> 12) & 0x0f); |
81 | printk(KERN_DEBUG "EC: 0x%x\n", val & 0x0fff); | 81 | dev_dbg(trident->card->dev, "EC: 0x%x\n", val & 0x0fff); |
82 | if (trident->device != TRIDENT_DEVICE_ID_NX) { | 82 | if (trident->device != TRIDENT_DEVICE_ID_NX) { |
83 | val = inl(TRID_REG(trident, CH_DX_CSO_ALPHA_FMS)); | 83 | val = inl(TRID_REG(trident, CH_DX_CSO_ALPHA_FMS)); |
84 | printk(KERN_DEBUG "CSO: 0x%x\n", val >> 16); | 84 | dev_dbg(trident->card->dev, "CSO: 0x%x\n", val >> 16); |
85 | printk("Alpha: 0x%x\n", (val >> 4) & 0x0fff); | 85 | dev_dbg(trident->card->dev, "Alpha: 0x%x\n", (val >> 4) & 0x0fff); |
86 | printk(KERN_DEBUG "FMS: 0x%x\n", val & 0x0f); | 86 | dev_dbg(trident->card->dev, "FMS: 0x%x\n", val & 0x0f); |
87 | val = inl(TRID_REG(trident, CH_DX_ESO_DELTA)); | 87 | val = inl(TRID_REG(trident, CH_DX_ESO_DELTA)); |
88 | printk(KERN_DEBUG "ESO: 0x%x\n", val >> 16); | 88 | dev_dbg(trident->card->dev, "ESO: 0x%x\n", val >> 16); |
89 | printk(KERN_DEBUG "Delta: 0x%x\n", val & 0xffff); | 89 | dev_dbg(trident->card->dev, "Delta: 0x%x\n", val & 0xffff); |
90 | val = inl(TRID_REG(trident, CH_DX_FMC_RVOL_CVOL)); | 90 | val = inl(TRID_REG(trident, CH_DX_FMC_RVOL_CVOL)); |
91 | } else { // TRIDENT_DEVICE_ID_NX | 91 | } else { // TRIDENT_DEVICE_ID_NX |
92 | val = inl(TRID_REG(trident, CH_NX_DELTA_CSO)); | 92 | val = inl(TRID_REG(trident, CH_NX_DELTA_CSO)); |
93 | tmp = (val >> 24) & 0xff; | 93 | tmp = (val >> 24) & 0xff; |
94 | printk(KERN_DEBUG "CSO: 0x%x\n", val & 0x00ffffff); | 94 | dev_dbg(trident->card->dev, "CSO: 0x%x\n", val & 0x00ffffff); |
95 | val = inl(TRID_REG(trident, CH_NX_DELTA_ESO)); | 95 | val = inl(TRID_REG(trident, CH_NX_DELTA_ESO)); |
96 | tmp |= (val >> 16) & 0xff00; | 96 | tmp |= (val >> 16) & 0xff00; |
97 | printk(KERN_DEBUG "Delta: 0x%x\n", tmp); | 97 | dev_dbg(trident->card->dev, "Delta: 0x%x\n", tmp); |
98 | printk(KERN_DEBUG "ESO: 0x%x\n", val & 0x00ffffff); | 98 | dev_dbg(trident->card->dev, "ESO: 0x%x\n", val & 0x00ffffff); |
99 | val = inl(TRID_REG(trident, CH_NX_ALPHA_FMS_FMC_RVOL_CVOL)); | 99 | val = inl(TRID_REG(trident, CH_NX_ALPHA_FMS_FMC_RVOL_CVOL)); |
100 | printk(KERN_DEBUG "Alpha: 0x%x\n", val >> 20); | 100 | dev_dbg(trident->card->dev, "Alpha: 0x%x\n", val >> 20); |
101 | printk(KERN_DEBUG "FMS: 0x%x\n", (val >> 16) & 0x0f); | 101 | dev_dbg(trident->card->dev, "FMS: 0x%x\n", (val >> 16) & 0x0f); |
102 | } | 102 | } |
103 | printk(KERN_DEBUG "FMC: 0x%x\n", (val >> 14) & 3); | 103 | dev_dbg(trident->card->dev, "FMC: 0x%x\n", (val >> 14) & 3); |
104 | printk(KERN_DEBUG "RVol: 0x%x\n", (val >> 7) & 0x7f); | 104 | dev_dbg(trident->card->dev, "RVol: 0x%x\n", (val >> 7) & 0x7f); |
105 | printk(KERN_DEBUG "CVol: 0x%x\n", val & 0x7f); | 105 | dev_dbg(trident->card->dev, "CVol: 0x%x\n", val & 0x7f); |
106 | } | 106 | } |
107 | #endif | 107 | #endif |
108 | 108 | ||
@@ -156,7 +156,8 @@ static unsigned short snd_trident_codec_read(struct snd_ac97 *ac97, unsigned sho | |||
156 | } | 156 | } |
157 | 157 | ||
158 | if (count == 0 && !trident->ac97_detect) { | 158 | if (count == 0 && !trident->ac97_detect) { |
159 | snd_printk(KERN_ERR "ac97 codec read TIMEOUT [0x%x/0x%x]!!!\n", | 159 | dev_err(trident->card->dev, |
160 | "ac97 codec read TIMEOUT [0x%x/0x%x]!!!\n", | ||
160 | reg, data); | 161 | reg, data); |
161 | data = 0; | 162 | data = 0; |
162 | } | 163 | } |
@@ -497,16 +498,16 @@ void snd_trident_write_voice_regs(struct snd_trident * trident, | |||
497 | outl(regs[4], TRID_REG(trident, CH_START + 16)); | 498 | outl(regs[4], TRID_REG(trident, CH_START + 16)); |
498 | 499 | ||
499 | #if 0 | 500 | #if 0 |
500 | printk(KERN_DEBUG "written %i channel:\n", voice->number); | 501 | dev_dbg(trident->card->dev, "written %i channel:\n", voice->number); |
501 | printk(KERN_DEBUG " regs[0] = 0x%x/0x%x\n", | 502 | dev_dbg(trident->card->dev, " regs[0] = 0x%x/0x%x\n", |
502 | regs[0], inl(TRID_REG(trident, CH_START + 0))); | 503 | regs[0], inl(TRID_REG(trident, CH_START + 0))); |
503 | printk(KERN_DEBUG " regs[1] = 0x%x/0x%x\n", | 504 | dev_dbg(trident->card->dev, " regs[1] = 0x%x/0x%x\n", |
504 | regs[1], inl(TRID_REG(trident, CH_START + 4))); | 505 | regs[1], inl(TRID_REG(trident, CH_START + 4))); |
505 | printk(KERN_DEBUG " regs[2] = 0x%x/0x%x\n", | 506 | dev_dbg(trident->card->dev, " regs[2] = 0x%x/0x%x\n", |
506 | regs[2], inl(TRID_REG(trident, CH_START + 8))); | 507 | regs[2], inl(TRID_REG(trident, CH_START + 8))); |
507 | printk(KERN_DEBUG " regs[3] = 0x%x/0x%x\n", | 508 | dev_dbg(trident->card->dev, " regs[3] = 0x%x/0x%x\n", |
508 | regs[3], inl(TRID_REG(trident, CH_START + 12))); | 509 | regs[3], inl(TRID_REG(trident, CH_START + 12))); |
509 | printk(KERN_DEBUG " regs[4] = 0x%x/0x%x\n", | 510 | dev_dbg(trident->card->dev, " regs[4] = 0x%x/0x%x\n", |
510 | regs[4], inl(TRID_REG(trident, CH_START + 16))); | 511 | regs[4], inl(TRID_REG(trident, CH_START + 16))); |
511 | #endif | 512 | #endif |
512 | } | 513 | } |
@@ -589,7 +590,7 @@ static void snd_trident_write_vol_reg(struct snd_trident * trident, | |||
589 | outb(voice->Vol >> 2, TRID_REG(trident, CH_GVSEL_PAN_VOL_CTRL_EC + 2)); | 590 | outb(voice->Vol >> 2, TRID_REG(trident, CH_GVSEL_PAN_VOL_CTRL_EC + 2)); |
590 | break; | 591 | break; |
591 | case TRIDENT_DEVICE_ID_SI7018: | 592 | case TRIDENT_DEVICE_ID_SI7018: |
592 | /* printk(KERN_DEBUG "voice->Vol = 0x%x\n", voice->Vol); */ | 593 | /* dev_dbg(trident->card->dev, "voice->Vol = 0x%x\n", voice->Vol); */ |
593 | outw((voice->CTRL << 12) | voice->Vol, | 594 | outw((voice->CTRL << 12) | voice->Vol, |
594 | TRID_REG(trident, CH_GVSEL_PAN_VOL_CTRL_EC)); | 595 | TRID_REG(trident, CH_GVSEL_PAN_VOL_CTRL_EC)); |
595 | break; | 596 | break; |
@@ -3013,13 +3014,15 @@ static int snd_trident_mixer(struct snd_trident *trident, int pcm_spdif_device) | |||
3013 | _ac97.num = 1; | 3014 | _ac97.num = 1; |
3014 | err = snd_ac97_mixer(trident->ac97_bus, &_ac97, &trident->ac97_sec); | 3015 | err = snd_ac97_mixer(trident->ac97_bus, &_ac97, &trident->ac97_sec); |
3015 | if (err < 0) | 3016 | if (err < 0) |
3016 | snd_printk(KERN_ERR "SI7018: the secondary codec - invalid access\n"); | 3017 | dev_err(trident->card->dev, |
3018 | "SI7018: the secondary codec - invalid access\n"); | ||
3017 | #if 0 // only for my testing purpose --jk | 3019 | #if 0 // only for my testing purpose --jk |
3018 | { | 3020 | { |
3019 | struct snd_ac97 *mc97; | 3021 | struct snd_ac97 *mc97; |
3020 | err = snd_ac97_modem(trident->card, &_ac97, &mc97); | 3022 | err = snd_ac97_modem(trident->card, &_ac97, &mc97); |
3021 | if (err < 0) | 3023 | if (err < 0) |
3022 | snd_printk(KERN_ERR "snd_ac97_modem returned error %i\n", err); | 3024 | dev_err(trident->card->dev, |
3025 | "snd_ac97_modem returned error %i\n", err); | ||
3023 | } | 3026 | } |
3024 | #endif | 3027 | #endif |
3025 | } | 3028 | } |
@@ -3197,7 +3200,8 @@ int snd_trident_create_gameport(struct snd_trident *chip) | |||
3197 | 3200 | ||
3198 | chip->gameport = gp = gameport_allocate_port(); | 3201 | chip->gameport = gp = gameport_allocate_port(); |
3199 | if (!gp) { | 3202 | if (!gp) { |
3200 | printk(KERN_ERR "trident: cannot allocate memory for gameport\n"); | 3203 | dev_err(chip->card->dev, |
3204 | "cannot allocate memory for gameport\n"); | ||
3201 | return -ENOMEM; | 3205 | return -ENOMEM; |
3202 | } | 3206 | } |
3203 | 3207 | ||
@@ -3270,7 +3274,8 @@ static int snd_trident_sis_reset(struct snd_trident *trident) | |||
3270 | goto __si7018_ok; | 3274 | goto __si7018_ok; |
3271 | do_delay(trident); | 3275 | do_delay(trident); |
3272 | } while (time_after_eq(end_time, jiffies)); | 3276 | } while (time_after_eq(end_time, jiffies)); |
3273 | snd_printk(KERN_ERR "AC'97 codec ready error [0x%x]\n", inl(TRID_REG(trident, SI_SERIAL_INTF_CTRL))); | 3277 | dev_err(trident->card->dev, "AC'97 codec ready error [0x%x]\n", |
3278 | inl(TRID_REG(trident, SI_SERIAL_INTF_CTRL))); | ||
3274 | if (r-- > 0) { | 3279 | if (r-- > 0) { |
3275 | end_time = jiffies + HZ; | 3280 | end_time = jiffies + HZ; |
3276 | do { | 3281 | do { |
@@ -3367,7 +3372,7 @@ static int snd_trident_tlb_alloc(struct snd_trident *trident) | |||
3367 | 3372 | ||
3368 | if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(trident->pci), | 3373 | if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(trident->pci), |
3369 | 2 * SNDRV_TRIDENT_MAX_PAGES * 4, &trident->tlb.buffer) < 0) { | 3374 | 2 * SNDRV_TRIDENT_MAX_PAGES * 4, &trident->tlb.buffer) < 0) { |
3370 | snd_printk(KERN_ERR "trident: unable to allocate TLB buffer\n"); | 3375 | dev_err(trident->card->dev, "unable to allocate TLB buffer\n"); |
3371 | return -ENOMEM; | 3376 | return -ENOMEM; |
3372 | } | 3377 | } |
3373 | trident->tlb.entries = (unsigned int*)ALIGN((unsigned long)trident->tlb.buffer.area, SNDRV_TRIDENT_MAX_PAGES * 4); | 3378 | trident->tlb.entries = (unsigned int*)ALIGN((unsigned long)trident->tlb.buffer.area, SNDRV_TRIDENT_MAX_PAGES * 4); |
@@ -3375,13 +3380,14 @@ static int snd_trident_tlb_alloc(struct snd_trident *trident) | |||
3375 | /* allocate shadow TLB page table (virtual addresses) */ | 3380 | /* allocate shadow TLB page table (virtual addresses) */ |
3376 | trident->tlb.shadow_entries = vmalloc(SNDRV_TRIDENT_MAX_PAGES*sizeof(unsigned long)); | 3381 | trident->tlb.shadow_entries = vmalloc(SNDRV_TRIDENT_MAX_PAGES*sizeof(unsigned long)); |
3377 | if (trident->tlb.shadow_entries == NULL) { | 3382 | if (trident->tlb.shadow_entries == NULL) { |
3378 | snd_printk(KERN_ERR "trident: unable to allocate shadow TLB entries\n"); | 3383 | dev_err(trident->card->dev, |
3384 | "unable to allocate shadow TLB entries\n"); | ||
3379 | return -ENOMEM; | 3385 | return -ENOMEM; |
3380 | } | 3386 | } |
3381 | /* allocate and setup silent page and initialise TLB entries */ | 3387 | /* allocate and setup silent page and initialise TLB entries */ |
3382 | if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(trident->pci), | 3388 | if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(trident->pci), |
3383 | SNDRV_TRIDENT_PAGE_SIZE, &trident->tlb.silent_page) < 0) { | 3389 | SNDRV_TRIDENT_PAGE_SIZE, &trident->tlb.silent_page) < 0) { |
3384 | snd_printk(KERN_ERR "trident: unable to allocate silent page\n"); | 3390 | dev_err(trident->card->dev, "unable to allocate silent page\n"); |
3385 | return -ENOMEM; | 3391 | return -ENOMEM; |
3386 | } | 3392 | } |
3387 | memset(trident->tlb.silent_page.area, 0, SNDRV_TRIDENT_PAGE_SIZE); | 3393 | memset(trident->tlb.silent_page.area, 0, SNDRV_TRIDENT_PAGE_SIZE); |
@@ -3439,7 +3445,7 @@ static int snd_trident_4d_dx_init(struct snd_trident *trident) | |||
3439 | goto __dx_ok; | 3445 | goto __dx_ok; |
3440 | do_delay(trident); | 3446 | do_delay(trident); |
3441 | } while (time_after_eq(end_time, jiffies)); | 3447 | } while (time_after_eq(end_time, jiffies)); |
3442 | snd_printk(KERN_ERR "AC'97 codec ready error\n"); | 3448 | dev_err(trident->card->dev, "AC'97 codec ready error\n"); |
3443 | return -EIO; | 3449 | return -EIO; |
3444 | 3450 | ||
3445 | __dx_ok: | 3451 | __dx_ok: |
@@ -3477,7 +3483,8 @@ static int snd_trident_4d_nx_init(struct snd_trident *trident) | |||
3477 | goto __nx_ok; | 3483 | goto __nx_ok; |
3478 | do_delay(trident); | 3484 | do_delay(trident); |
3479 | } while (time_after_eq(end_time, jiffies)); | 3485 | } while (time_after_eq(end_time, jiffies)); |
3480 | snd_printk(KERN_ERR "AC'97 codec ready error [0x%x]\n", inl(TRID_REG(trident, NX_ACR0_AC97_COM_STAT))); | 3486 | dev_err(trident->card->dev, "AC'97 codec ready error [0x%x]\n", |
3487 | inl(TRID_REG(trident, NX_ACR0_AC97_COM_STAT))); | ||
3481 | return -EIO; | 3488 | return -EIO; |
3482 | 3489 | ||
3483 | __nx_ok: | 3490 | __nx_ok: |
@@ -3562,7 +3569,8 @@ int snd_trident_create(struct snd_card *card, | |||
3562 | /* check, if we can restrict PCI DMA transfers to 30 bits */ | 3569 | /* check, if we can restrict PCI DMA transfers to 30 bits */ |
3563 | if (pci_set_dma_mask(pci, DMA_BIT_MASK(30)) < 0 || | 3570 | if (pci_set_dma_mask(pci, DMA_BIT_MASK(30)) < 0 || |
3564 | pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(30)) < 0) { | 3571 | pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(30)) < 0) { |
3565 | snd_printk(KERN_ERR "architecture does not support 30bit PCI busmaster DMA\n"); | 3572 | dev_err(card->dev, |
3573 | "architecture does not support 30bit PCI busmaster DMA\n"); | ||
3566 | pci_disable_device(pci); | 3574 | pci_disable_device(pci); |
3567 | return -ENXIO; | 3575 | return -ENXIO; |
3568 | } | 3576 | } |
@@ -3600,7 +3608,7 @@ int snd_trident_create(struct snd_card *card, | |||
3600 | 3608 | ||
3601 | if (request_irq(pci->irq, snd_trident_interrupt, IRQF_SHARED, | 3609 | if (request_irq(pci->irq, snd_trident_interrupt, IRQF_SHARED, |
3602 | KBUILD_MODNAME, trident)) { | 3610 | KBUILD_MODNAME, trident)) { |
3603 | snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq); | 3611 | dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq); |
3604 | snd_trident_free(trident); | 3612 | snd_trident_free(trident); |
3605 | return -EBUSY; | 3613 | return -EBUSY; |
3606 | } | 3614 | } |
@@ -3949,8 +3957,7 @@ static int snd_trident_resume(struct device *dev) | |||
3949 | pci_set_power_state(pci, PCI_D0); | 3957 | pci_set_power_state(pci, PCI_D0); |
3950 | pci_restore_state(pci); | 3958 | pci_restore_state(pci); |
3951 | if (pci_enable_device(pci) < 0) { | 3959 | if (pci_enable_device(pci) < 0) { |
3952 | printk(KERN_ERR "trident: pci_enable_device failed, " | 3960 | dev_err(dev, "pci_enable_device failed, disabling device\n"); |
3953 | "disabling device\n"); | ||
3954 | snd_card_disconnect(card); | 3961 | snd_card_disconnect(card); |
3955 | return -EIO; | 3962 | return -EIO; |
3956 | } | 3963 | } |