ALSA: pcxhr: Use standard printk helpers
Convert with dev_err() and co from snd_printk(), etc. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
03d3ac2178
commit
b59bb8efd1
@ -284,7 +284,7 @@ static int pcxhr_get_clock_reg(struct pcxhr_mgr *mgr, unsigned int rate,
|
|||||||
rmh.cmd_len = 3;
|
rmh.cmd_len = 3;
|
||||||
err = pcxhr_send_msg(mgr, &rmh);
|
err = pcxhr_send_msg(mgr, &rmh);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
snd_printk(KERN_ERR
|
dev_err(&mgr->pci->dev,
|
||||||
"error CMD_ACCESS_IO_WRITE "
|
"error CMD_ACCESS_IO_WRITE "
|
||||||
"for PLL register : %x!\n", err);
|
"for PLL register : %x!\n", err);
|
||||||
return err;
|
return err;
|
||||||
@ -357,7 +357,7 @@ static int pcxhr_sub_set_clock(struct pcxhr_mgr *mgr,
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
/* set the new frequency */
|
/* set the new frequency */
|
||||||
snd_printdd("clock register : set %x\n", val);
|
dev_dbg(&mgr->pci->dev, "clock register : set %x\n", val);
|
||||||
err = pcxhr_write_io_num_reg_cont(mgr, PCXHR_FREQ_REG_MASK,
|
err = pcxhr_write_io_num_reg_cont(mgr, PCXHR_FREQ_REG_MASK,
|
||||||
val, changed);
|
val, changed);
|
||||||
if (err)
|
if (err)
|
||||||
@ -380,7 +380,7 @@ static int pcxhr_sub_set_clock(struct pcxhr_mgr *mgr,
|
|||||||
mgr->codec_speed = speed; /* save new codec speed */
|
mgr->codec_speed = speed; /* save new codec speed */
|
||||||
}
|
}
|
||||||
|
|
||||||
snd_printdd("pcxhr_sub_set_clock to %dHz (realfreq=%d)\n",
|
dev_dbg(&mgr->pci->dev, "pcxhr_sub_set_clock to %dHz (realfreq=%d)\n",
|
||||||
rate, realfreq);
|
rate, realfreq);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -480,7 +480,7 @@ static int pcxhr_sub_get_external_clock(struct pcxhr_mgr *mgr,
|
|||||||
case REG_STATUS_SYNC_192000 : rate = 192000; break;
|
case REG_STATUS_SYNC_192000 : rate = 192000; break;
|
||||||
default: rate = 0;
|
default: rate = 0;
|
||||||
}
|
}
|
||||||
snd_printdd("External clock is at %d Hz\n", rate);
|
dev_dbg(&mgr->pci->dev, "External clock is at %d Hz\n", rate);
|
||||||
*sample_rate = rate;
|
*sample_rate = rate;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -537,8 +537,8 @@ static int pcxhr_set_stream_state(struct pcxhr_stream *stream)
|
|||||||
|
|
||||||
err = pcxhr_send_msg(chip->mgr, &rmh);
|
err = pcxhr_send_msg(chip->mgr, &rmh);
|
||||||
if (err)
|
if (err)
|
||||||
snd_printk(KERN_ERR "ERROR pcxhr_set_stream_state err=%x;\n",
|
dev_err(chip->card->dev,
|
||||||
err);
|
"ERROR pcxhr_set_stream_state err=%x;\n", err);
|
||||||
stream->status =
|
stream->status =
|
||||||
start ? PCXHR_STREAM_STATUS_STARTED : PCXHR_STREAM_STATUS_STOPPED;
|
start ? PCXHR_STREAM_STATUS_STARTED : PCXHR_STREAM_STATUS_STOPPED;
|
||||||
return err;
|
return err;
|
||||||
@ -628,7 +628,8 @@ static int pcxhr_set_format(struct pcxhr_stream *stream)
|
|||||||
rmh.cmd[rmh.cmd_len++] = (header & 0xff) << 16;
|
rmh.cmd[rmh.cmd_len++] = (header & 0xff) << 16;
|
||||||
err = pcxhr_send_msg(chip->mgr, &rmh);
|
err = pcxhr_send_msg(chip->mgr, &rmh);
|
||||||
if (err)
|
if (err)
|
||||||
snd_printk(KERN_ERR "ERROR pcxhr_set_format err=%x;\n", err);
|
dev_err(chip->card->dev,
|
||||||
|
"ERROR pcxhr_set_format err=%x;\n", err);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -665,7 +666,7 @@ static int pcxhr_update_r_buffer(struct pcxhr_stream *stream)
|
|||||||
rmh.cmd_len = 4;
|
rmh.cmd_len = 4;
|
||||||
err = pcxhr_send_msg(chip->mgr, &rmh);
|
err = pcxhr_send_msg(chip->mgr, &rmh);
|
||||||
if (err)
|
if (err)
|
||||||
snd_printk(KERN_ERR
|
dev_err(chip->card->dev,
|
||||||
"ERROR CMD_UPDATE_R_BUFFERS err=%x;\n", err);
|
"ERROR CMD_UPDATE_R_BUFFERS err=%x;\n", err);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
@ -735,11 +736,11 @@ static void pcxhr_trigger_tasklet(unsigned long arg)
|
|||||||
}
|
}
|
||||||
if (capture_mask == 0 && playback_mask == 0) {
|
if (capture_mask == 0 && playback_mask == 0) {
|
||||||
mutex_unlock(&mgr->setup_mutex);
|
mutex_unlock(&mgr->setup_mutex);
|
||||||
snd_printk(KERN_ERR "pcxhr_trigger_tasklet : no pipes\n");
|
dev_err(&mgr->pci->dev, "pcxhr_trigger_tasklet : no pipes\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
snd_printdd("pcxhr_trigger_tasklet : "
|
dev_dbg(&mgr->pci->dev, "pcxhr_trigger_tasklet : "
|
||||||
"playback_mask=%x capture_mask=%x\n",
|
"playback_mask=%x capture_mask=%x\n",
|
||||||
playback_mask, capture_mask);
|
playback_mask, capture_mask);
|
||||||
|
|
||||||
@ -747,7 +748,7 @@ static void pcxhr_trigger_tasklet(unsigned long arg)
|
|||||||
err = pcxhr_set_pipe_state(mgr, playback_mask, capture_mask, 0);
|
err = pcxhr_set_pipe_state(mgr, playback_mask, capture_mask, 0);
|
||||||
if (err) {
|
if (err) {
|
||||||
mutex_unlock(&mgr->setup_mutex);
|
mutex_unlock(&mgr->setup_mutex);
|
||||||
snd_printk(KERN_ERR "pcxhr_trigger_tasklet : "
|
dev_err(&mgr->pci->dev, "pcxhr_trigger_tasklet : "
|
||||||
"error stop pipes (P%x C%x)\n",
|
"error stop pipes (P%x C%x)\n",
|
||||||
playback_mask, capture_mask);
|
playback_mask, capture_mask);
|
||||||
return;
|
return;
|
||||||
@ -792,7 +793,7 @@ static void pcxhr_trigger_tasklet(unsigned long arg)
|
|||||||
err = pcxhr_set_pipe_state(mgr, playback_mask, capture_mask, 1);
|
err = pcxhr_set_pipe_state(mgr, playback_mask, capture_mask, 1);
|
||||||
if (err) {
|
if (err) {
|
||||||
mutex_unlock(&mgr->setup_mutex);
|
mutex_unlock(&mgr->setup_mutex);
|
||||||
snd_printk(KERN_ERR "pcxhr_trigger_tasklet : "
|
dev_err(&mgr->pci->dev, "pcxhr_trigger_tasklet : "
|
||||||
"error start pipes (P%x C%x)\n",
|
"error start pipes (P%x C%x)\n",
|
||||||
playback_mask, capture_mask);
|
playback_mask, capture_mask);
|
||||||
return;
|
return;
|
||||||
@ -825,7 +826,7 @@ static void pcxhr_trigger_tasklet(unsigned long arg)
|
|||||||
|
|
||||||
#ifdef CONFIG_SND_DEBUG_VERBOSE
|
#ifdef CONFIG_SND_DEBUG_VERBOSE
|
||||||
do_gettimeofday(&my_tv2);
|
do_gettimeofday(&my_tv2);
|
||||||
snd_printdd("***TRIGGER TASKLET*** TIME = %ld (err = %x)\n",
|
dev_dbg(&mgr->pci->dev, "***TRIGGER TASKLET*** TIME = %ld (err = %x)\n",
|
||||||
(long)(my_tv2.tv_usec - my_tv1.tv_usec), err);
|
(long)(my_tv2.tv_usec - my_tv1.tv_usec), err);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -902,7 +903,7 @@ static int pcxhr_hardware_timer(struct pcxhr_mgr *mgr, int start)
|
|||||||
}
|
}
|
||||||
err = pcxhr_send_msg(mgr, &rmh);
|
err = pcxhr_send_msg(mgr, &rmh);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
snd_printk(KERN_ERR "error pcxhr_hardware_timer err(%x)\n",
|
dev_err(&mgr->pci->dev, "error pcxhr_hardware_timer err(%x)\n",
|
||||||
err);
|
err);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
@ -916,7 +917,8 @@ static int pcxhr_prepare(struct snd_pcm_substream *subs)
|
|||||||
struct pcxhr_mgr *mgr = chip->mgr;
|
struct pcxhr_mgr *mgr = chip->mgr;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
|
||||||
snd_printdd("pcxhr_prepare : period_size(%lx) periods(%x) buffer_size(%lx)\n",
|
dev_dbg(chip->card->dev,
|
||||||
|
"pcxhr_prepare : period_size(%lx) periods(%x) buffer_size(%lx)\n",
|
||||||
subs->runtime->period_size, subs->runtime->periods,
|
subs->runtime->period_size, subs->runtime->periods,
|
||||||
subs->runtime->buffer_size);
|
subs->runtime->buffer_size);
|
||||||
|
|
||||||
@ -1025,11 +1027,11 @@ static int pcxhr_open(struct snd_pcm_substream *subs)
|
|||||||
runtime->hw = pcxhr_caps;
|
runtime->hw = pcxhr_caps;
|
||||||
|
|
||||||
if( subs->stream == SNDRV_PCM_STREAM_PLAYBACK ) {
|
if( subs->stream == SNDRV_PCM_STREAM_PLAYBACK ) {
|
||||||
snd_printdd("pcxhr_open playback chip%d subs%d\n",
|
dev_dbg(chip->card->dev, "pcxhr_open playback chip%d subs%d\n",
|
||||||
chip->chip_idx, subs->number);
|
chip->chip_idx, subs->number);
|
||||||
stream = &chip->playback_stream[subs->number];
|
stream = &chip->playback_stream[subs->number];
|
||||||
} else {
|
} else {
|
||||||
snd_printdd("pcxhr_open capture chip%d subs%d\n",
|
dev_dbg(chip->card->dev, "pcxhr_open capture chip%d subs%d\n",
|
||||||
chip->chip_idx, subs->number);
|
chip->chip_idx, subs->number);
|
||||||
if (mgr->mono_capture)
|
if (mgr->mono_capture)
|
||||||
runtime->hw.channels_max = 1;
|
runtime->hw.channels_max = 1;
|
||||||
@ -1039,7 +1041,7 @@ static int pcxhr_open(struct snd_pcm_substream *subs)
|
|||||||
}
|
}
|
||||||
if (stream->status != PCXHR_STREAM_STATUS_FREE){
|
if (stream->status != PCXHR_STREAM_STATUS_FREE){
|
||||||
/* streams in use */
|
/* streams in use */
|
||||||
snd_printk(KERN_ERR "pcxhr_open chip%d subs%d in use\n",
|
dev_err(chip->card->dev, "pcxhr_open chip%d subs%d in use\n",
|
||||||
chip->chip_idx, subs->number);
|
chip->chip_idx, subs->number);
|
||||||
mutex_unlock(&mgr->setup_mutex);
|
mutex_unlock(&mgr->setup_mutex);
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
@ -1105,7 +1107,7 @@ static int pcxhr_close(struct snd_pcm_substream *subs)
|
|||||||
|
|
||||||
mutex_lock(&mgr->setup_mutex);
|
mutex_lock(&mgr->setup_mutex);
|
||||||
|
|
||||||
snd_printdd("pcxhr_close chip%d subs%d\n",
|
dev_dbg(chip->card->dev, "pcxhr_close chip%d subs%d\n",
|
||||||
chip->chip_idx, subs->number);
|
chip->chip_idx, subs->number);
|
||||||
|
|
||||||
/* sample rate released */
|
/* sample rate released */
|
||||||
@ -1168,7 +1170,7 @@ int pcxhr_create_pcm(struct snd_pcxhr *chip)
|
|||||||
if ((err = snd_pcm_new(chip->card, name, 0,
|
if ((err = snd_pcm_new(chip->card, name, 0,
|
||||||
chip->nb_streams_play,
|
chip->nb_streams_play,
|
||||||
chip->nb_streams_capt, &pcm)) < 0) {
|
chip->nb_streams_capt, &pcm)) < 0) {
|
||||||
snd_printk(KERN_ERR "cannot create pcm %s\n", name);
|
dev_err(chip->card->dev, "cannot create pcm %s\n", name);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
pcm->private_data = chip;
|
pcm->private_data = chip;
|
||||||
@ -1214,7 +1216,7 @@ static int pcxhr_create(struct pcxhr_mgr *mgr,
|
|||||||
|
|
||||||
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
|
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
|
||||||
if (! chip) {
|
if (! chip) {
|
||||||
snd_printk(KERN_ERR "cannot allocate chip\n");
|
dev_err(card->dev, "cannot allocate chip\n");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1487,7 +1489,7 @@ static int pcxhr_free(struct pcxhr_mgr *mgr)
|
|||||||
/* reset board if some firmware was loaded */
|
/* reset board if some firmware was loaded */
|
||||||
if(mgr->dsp_loaded) {
|
if(mgr->dsp_loaded) {
|
||||||
pcxhr_reset_board(mgr);
|
pcxhr_reset_board(mgr);
|
||||||
snd_printdd("reset pcxhr !\n");
|
dev_dbg(&mgr->pci->dev, "reset pcxhr !\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* release irq */
|
/* release irq */
|
||||||
@ -1536,8 +1538,8 @@ static int pcxhr_probe(struct pci_dev *pci,
|
|||||||
|
|
||||||
/* check if we can restrict PCI DMA transfers to 32 bits */
|
/* check if we can restrict PCI DMA transfers to 32 bits */
|
||||||
if (pci_set_dma_mask(pci, DMA_BIT_MASK(32)) < 0) {
|
if (pci_set_dma_mask(pci, DMA_BIT_MASK(32)) < 0) {
|
||||||
snd_printk(KERN_ERR "architecture does not support "
|
dev_err(&pci->dev,
|
||||||
"32bit PCI busmaster DMA\n");
|
"architecture does not support 32bit PCI busmaster DMA\n");
|
||||||
pci_disable_device(pci);
|
pci_disable_device(pci);
|
||||||
return -ENXIO;
|
return -ENXIO;
|
||||||
}
|
}
|
||||||
@ -1588,7 +1590,7 @@ static int pcxhr_probe(struct pci_dev *pci,
|
|||||||
|
|
||||||
if (request_irq(pci->irq, pcxhr_interrupt, IRQF_SHARED,
|
if (request_irq(pci->irq, pcxhr_interrupt, IRQF_SHARED,
|
||||||
KBUILD_MODNAME, mgr)) {
|
KBUILD_MODNAME, mgr)) {
|
||||||
snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
|
dev_err(&pci->dev, "unable to grab IRQ %d\n", pci->irq);
|
||||||
pcxhr_free(mgr);
|
pcxhr_free(mgr);
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
}
|
}
|
||||||
@ -1641,7 +1643,7 @@ static int pcxhr_probe(struct pci_dev *pci,
|
|||||||
0, &card);
|
0, &card);
|
||||||
|
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
snd_printk(KERN_ERR "cannot allocate the card %d\n", i);
|
dev_err(card->dev, "cannot allocate the card %d\n", i);
|
||||||
pcxhr_free(mgr);
|
pcxhr_free(mgr);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#include <linux/delay.h>
|
#include <linux/delay.h>
|
||||||
#include <linux/firmware.h>
|
#include <linux/firmware.h>
|
||||||
#include <linux/interrupt.h>
|
#include <linux/interrupt.h>
|
||||||
|
#include <linux/pci.h>
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
#include <sound/core.h>
|
#include <sound/core.h>
|
||||||
#include "pcxhr.h"
|
#include "pcxhr.h"
|
||||||
@ -132,14 +133,14 @@ static int pcxhr_check_reg_bit(struct pcxhr_mgr *mgr, unsigned int reg,
|
|||||||
*read = PCXHR_INPB(mgr, reg);
|
*read = PCXHR_INPB(mgr, reg);
|
||||||
if ((*read & mask) == bit) {
|
if ((*read & mask) == bit) {
|
||||||
if (i > 100)
|
if (i > 100)
|
||||||
snd_printdd("ATTENTION! check_reg(%x) "
|
dev_dbg(&mgr->pci->dev,
|
||||||
"loopcount=%d\n",
|
"ATTENTION! check_reg(%x) loopcount=%d\n",
|
||||||
reg, i);
|
reg, i);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
} while (time_after_eq(end_time, jiffies));
|
} while (time_after_eq(end_time, jiffies));
|
||||||
snd_printk(KERN_ERR
|
dev_err(&mgr->pci->dev,
|
||||||
"pcxhr_check_reg_bit: timeout, reg=%x, mask=0x%x, val=%x\n",
|
"pcxhr_check_reg_bit: timeout, reg=%x, mask=0x%x, val=%x\n",
|
||||||
reg, mask, *read);
|
reg, mask, *read);
|
||||||
return -EIO;
|
return -EIO;
|
||||||
@ -216,7 +217,7 @@ static int pcxhr_send_it_dsp(struct pcxhr_mgr *mgr,
|
|||||||
err = pcxhr_check_reg_bit(mgr, PCXHR_DSP_CVR, PCXHR_CVR_HI08_HC, 0,
|
err = pcxhr_check_reg_bit(mgr, PCXHR_DSP_CVR, PCXHR_CVR_HI08_HC, 0,
|
||||||
PCXHR_TIMEOUT_DSP, ®);
|
PCXHR_TIMEOUT_DSP, ®);
|
||||||
if (err) {
|
if (err) {
|
||||||
snd_printk(KERN_ERR "pcxhr_send_it_dsp : TIMEOUT CVR\n");
|
dev_err(&mgr->pci->dev, "pcxhr_send_it_dsp : TIMEOUT CVR\n");
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
if (itdsp & PCXHR_MASK_IT_MANAGE_HF5) {
|
if (itdsp & PCXHR_MASK_IT_MANAGE_HF5) {
|
||||||
@ -227,7 +228,7 @@ static int pcxhr_send_it_dsp(struct pcxhr_mgr *mgr,
|
|||||||
PCXHR_TIMEOUT_DSP,
|
PCXHR_TIMEOUT_DSP,
|
||||||
®);
|
®);
|
||||||
if (err) {
|
if (err) {
|
||||||
snd_printk(KERN_ERR
|
dev_err(&mgr->pci->dev,
|
||||||
"pcxhr_send_it_dsp : TIMEOUT HF5\n");
|
"pcxhr_send_it_dsp : TIMEOUT HF5\n");
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
@ -294,7 +295,7 @@ int pcxhr_load_xilinx_binary(struct pcxhr_mgr *mgr,
|
|||||||
*/
|
*/
|
||||||
if(second) {
|
if(second) {
|
||||||
if ((chipsc & PCXHR_CHIPSC_GPI_USERI) == 0) {
|
if ((chipsc & PCXHR_CHIPSC_GPI_USERI) == 0) {
|
||||||
snd_printk(KERN_ERR "error loading first xilinx\n");
|
dev_err(&mgr->pci->dev, "error loading first xilinx\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
/* activate second xilinx */
|
/* activate second xilinx */
|
||||||
@ -360,7 +361,7 @@ static int pcxhr_download_dsp(struct pcxhr_mgr *mgr, const struct firmware *dsp)
|
|||||||
PCXHR_ISR_HI08_TRDY,
|
PCXHR_ISR_HI08_TRDY,
|
||||||
PCXHR_TIMEOUT_DSP, &dummy);
|
PCXHR_TIMEOUT_DSP, &dummy);
|
||||||
if (err) {
|
if (err) {
|
||||||
snd_printk(KERN_ERR
|
dev_err(&mgr->pci->dev,
|
||||||
"dsp loading error at position %d\n", i);
|
"dsp loading error at position %d\n", i);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
@ -396,7 +397,7 @@ int pcxhr_load_eeprom_binary(struct pcxhr_mgr *mgr,
|
|||||||
msleep(PCXHR_WAIT_DEFAULT);
|
msleep(PCXHR_WAIT_DEFAULT);
|
||||||
PCXHR_OUTPB(mgr, PCXHR_DSP_ICR, reg);
|
PCXHR_OUTPB(mgr, PCXHR_DSP_ICR, reg);
|
||||||
msleep(PCXHR_WAIT_DEFAULT);
|
msleep(PCXHR_WAIT_DEFAULT);
|
||||||
snd_printdd("no need to load eeprom boot\n");
|
dev_dbg(&mgr->pci->dev, "no need to load eeprom boot\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
PCXHR_OUTPB(mgr, PCXHR_DSP_ICR, reg);
|
PCXHR_OUTPB(mgr, PCXHR_DSP_ICR, reg);
|
||||||
@ -561,9 +562,9 @@ static int pcxhr_read_rmh_status(struct pcxhr_mgr *mgr, struct pcxhr_rmh *rmh)
|
|||||||
PCXHR_ISR_HI08_RXDF,
|
PCXHR_ISR_HI08_RXDF,
|
||||||
PCXHR_TIMEOUT_DSP, ®);
|
PCXHR_TIMEOUT_DSP, ®);
|
||||||
if (err) {
|
if (err) {
|
||||||
snd_printk(KERN_ERR "ERROR RMH stat: "
|
dev_err(&mgr->pci->dev,
|
||||||
"ISR:RXDF=1 (ISR = %x; i=%d )\n",
|
"ERROR RMH stat: ISR:RXDF=1 (ISR = %x; i=%d )\n",
|
||||||
reg, i);
|
reg, i);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
/* read data */
|
/* read data */
|
||||||
@ -591,13 +592,13 @@ static int pcxhr_read_rmh_status(struct pcxhr_mgr *mgr, struct pcxhr_rmh *rmh)
|
|||||||
}
|
}
|
||||||
#ifdef CONFIG_SND_DEBUG_VERBOSE
|
#ifdef CONFIG_SND_DEBUG_VERBOSE
|
||||||
if (rmh->cmd_idx < CMD_LAST_INDEX)
|
if (rmh->cmd_idx < CMD_LAST_INDEX)
|
||||||
snd_printdd(" stat[%d]=%x\n", i, data);
|
dev_dbg(&mgr->pci->dev, " stat[%d]=%x\n", i, data);
|
||||||
#endif
|
#endif
|
||||||
if (i < max_stat_len)
|
if (i < max_stat_len)
|
||||||
rmh->stat[i] = data;
|
rmh->stat[i] = data;
|
||||||
}
|
}
|
||||||
if (rmh->stat_len > max_stat_len) {
|
if (rmh->stat_len > max_stat_len) {
|
||||||
snd_printdd("PCXHR : rmh->stat_len=%x too big\n",
|
dev_dbg(&mgr->pci->dev, "PCXHR : rmh->stat_len=%x too big\n",
|
||||||
rmh->stat_len);
|
rmh->stat_len);
|
||||||
rmh->stat_len = max_stat_len;
|
rmh->stat_len = max_stat_len;
|
||||||
}
|
}
|
||||||
@ -615,7 +616,8 @@ static int pcxhr_send_msg_nolock(struct pcxhr_mgr *mgr, struct pcxhr_rmh *rmh)
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
err = pcxhr_send_it_dsp(mgr, PCXHR_IT_MESSAGE, 1);
|
err = pcxhr_send_it_dsp(mgr, PCXHR_IT_MESSAGE, 1);
|
||||||
if (err) {
|
if (err) {
|
||||||
snd_printk(KERN_ERR "pcxhr_send_message : ED_DSP_CRASHED\n");
|
dev_err(&mgr->pci->dev,
|
||||||
|
"pcxhr_send_message : ED_DSP_CRASHED\n");
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
/* wait for chk bit */
|
/* wait for chk bit */
|
||||||
@ -641,7 +643,7 @@ static int pcxhr_send_msg_nolock(struct pcxhr_mgr *mgr, struct pcxhr_rmh *rmh)
|
|||||||
data &= 0xff7fff; /* MASK_1_WORD_COMMAND */
|
data &= 0xff7fff; /* MASK_1_WORD_COMMAND */
|
||||||
#ifdef CONFIG_SND_DEBUG_VERBOSE
|
#ifdef CONFIG_SND_DEBUG_VERBOSE
|
||||||
if (rmh->cmd_idx < CMD_LAST_INDEX)
|
if (rmh->cmd_idx < CMD_LAST_INDEX)
|
||||||
snd_printdd("MSG cmd[0]=%x (%s)\n",
|
dev_dbg(&mgr->pci->dev, "MSG cmd[0]=%x (%s)\n",
|
||||||
data, cmd_names[rmh->cmd_idx]);
|
data, cmd_names[rmh->cmd_idx]);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -671,7 +673,8 @@ static int pcxhr_send_msg_nolock(struct pcxhr_mgr *mgr, struct pcxhr_rmh *rmh)
|
|||||||
data = rmh->cmd[i];
|
data = rmh->cmd[i];
|
||||||
#ifdef CONFIG_SND_DEBUG_VERBOSE
|
#ifdef CONFIG_SND_DEBUG_VERBOSE
|
||||||
if (rmh->cmd_idx < CMD_LAST_INDEX)
|
if (rmh->cmd_idx < CMD_LAST_INDEX)
|
||||||
snd_printdd(" cmd[%d]=%x\n", i, data);
|
dev_dbg(&mgr->pci->dev,
|
||||||
|
" cmd[%d]=%x\n", i, data);
|
||||||
#endif
|
#endif
|
||||||
err = pcxhr_check_reg_bit(mgr, PCXHR_DSP_ISR,
|
err = pcxhr_check_reg_bit(mgr, PCXHR_DSP_ISR,
|
||||||
PCXHR_ISR_HI08_TRDY,
|
PCXHR_ISR_HI08_TRDY,
|
||||||
@ -697,14 +700,15 @@ static int pcxhr_send_msg_nolock(struct pcxhr_mgr *mgr, struct pcxhr_rmh *rmh)
|
|||||||
PCXHR_ISR_HI08_RXDF,
|
PCXHR_ISR_HI08_RXDF,
|
||||||
PCXHR_TIMEOUT_DSP, ®);
|
PCXHR_TIMEOUT_DSP, ®);
|
||||||
if (err) {
|
if (err) {
|
||||||
snd_printk(KERN_ERR "ERROR RMH: ISR:RXDF=1 (ISR = %x)\n", reg);
|
dev_err(&mgr->pci->dev,
|
||||||
|
"ERROR RMH: ISR:RXDF=1 (ISR = %x)\n", reg);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
/* read error code */
|
/* read error code */
|
||||||
data = PCXHR_INPB(mgr, PCXHR_DSP_TXH) << 16;
|
data = PCXHR_INPB(mgr, PCXHR_DSP_TXH) << 16;
|
||||||
data |= PCXHR_INPB(mgr, PCXHR_DSP_TXM) << 8;
|
data |= PCXHR_INPB(mgr, PCXHR_DSP_TXM) << 8;
|
||||||
data |= PCXHR_INPB(mgr, PCXHR_DSP_TXL);
|
data |= PCXHR_INPB(mgr, PCXHR_DSP_TXL);
|
||||||
snd_printk(KERN_ERR "ERROR RMH(%d): 0x%x\n",
|
dev_err(&mgr->pci->dev, "ERROR RMH(%d): 0x%x\n",
|
||||||
rmh->cmd_idx, data);
|
rmh->cmd_idx, data);
|
||||||
err = -EINVAL;
|
err = -EINVAL;
|
||||||
} else {
|
} else {
|
||||||
@ -780,7 +784,7 @@ static inline int pcxhr_pipes_running(struct pcxhr_mgr *mgr)
|
|||||||
* (PCXHR_PIPE_STATE_CAPTURE_OFFSET)
|
* (PCXHR_PIPE_STATE_CAPTURE_OFFSET)
|
||||||
*/
|
*/
|
||||||
start_mask &= 0xffffff;
|
start_mask &= 0xffffff;
|
||||||
snd_printdd("CMD_PIPE_STATE MBOX2=0x%06x\n", start_mask);
|
dev_dbg(&mgr->pci->dev, "CMD_PIPE_STATE MBOX2=0x%06x\n", start_mask);
|
||||||
return start_mask;
|
return start_mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -809,7 +813,7 @@ static int pcxhr_prepair_pipe_start(struct pcxhr_mgr *mgr,
|
|||||||
}
|
}
|
||||||
err = pcxhr_send_msg(mgr, &rmh);
|
err = pcxhr_send_msg(mgr, &rmh);
|
||||||
if (err) {
|
if (err) {
|
||||||
snd_printk(KERN_ERR
|
dev_err(&mgr->pci->dev,
|
||||||
"error pipe start "
|
"error pipe start "
|
||||||
"(CMD_CAN_START_PIPE) err=%x!\n",
|
"(CMD_CAN_START_PIPE) err=%x!\n",
|
||||||
err);
|
err);
|
||||||
@ -847,7 +851,7 @@ static int pcxhr_stop_pipes(struct pcxhr_mgr *mgr, int audio_mask)
|
|||||||
}
|
}
|
||||||
err = pcxhr_send_msg(mgr, &rmh);
|
err = pcxhr_send_msg(mgr, &rmh);
|
||||||
if (err) {
|
if (err) {
|
||||||
snd_printk(KERN_ERR
|
dev_err(&mgr->pci->dev,
|
||||||
"error pipe stop "
|
"error pipe stop "
|
||||||
"(CMD_STOP_PIPE) err=%x!\n", err);
|
"(CMD_STOP_PIPE) err=%x!\n", err);
|
||||||
return err;
|
return err;
|
||||||
@ -876,7 +880,7 @@ static int pcxhr_toggle_pipes(struct pcxhr_mgr *mgr, int audio_mask)
|
|||||||
1 << (audio - PCXHR_PIPE_STATE_CAPTURE_OFFSET));
|
1 << (audio - PCXHR_PIPE_STATE_CAPTURE_OFFSET));
|
||||||
err = pcxhr_send_msg(mgr, &rmh);
|
err = pcxhr_send_msg(mgr, &rmh);
|
||||||
if (err) {
|
if (err) {
|
||||||
snd_printk(KERN_ERR
|
dev_err(&mgr->pci->dev,
|
||||||
"error pipe start "
|
"error pipe start "
|
||||||
"(CMD_CONF_PIPE) err=%x!\n", err);
|
"(CMD_CONF_PIPE) err=%x!\n", err);
|
||||||
return err;
|
return err;
|
||||||
@ -889,7 +893,7 @@ static int pcxhr_toggle_pipes(struct pcxhr_mgr *mgr, int audio_mask)
|
|||||||
pcxhr_init_rmh(&rmh, CMD_SEND_IRQA);
|
pcxhr_init_rmh(&rmh, CMD_SEND_IRQA);
|
||||||
err = pcxhr_send_msg(mgr, &rmh);
|
err = pcxhr_send_msg(mgr, &rmh);
|
||||||
if (err) {
|
if (err) {
|
||||||
snd_printk(KERN_ERR
|
dev_err(&mgr->pci->dev,
|
||||||
"error pipe start (CMD_SEND_IRQA) err=%x!\n",
|
"error pipe start (CMD_SEND_IRQA) err=%x!\n",
|
||||||
err);
|
err);
|
||||||
return err;
|
return err;
|
||||||
@ -913,7 +917,8 @@ int pcxhr_set_pipe_state(struct pcxhr_mgr *mgr, int playback_mask,
|
|||||||
(capture_mask << PCXHR_PIPE_STATE_CAPTURE_OFFSET));
|
(capture_mask << PCXHR_PIPE_STATE_CAPTURE_OFFSET));
|
||||||
/* current pipe state (playback + record) */
|
/* current pipe state (playback + record) */
|
||||||
state = pcxhr_pipes_running(mgr);
|
state = pcxhr_pipes_running(mgr);
|
||||||
snd_printdd("pcxhr_set_pipe_state %s (mask %x current %x)\n",
|
dev_dbg(&mgr->pci->dev,
|
||||||
|
"pcxhr_set_pipe_state %s (mask %x current %x)\n",
|
||||||
start ? "START" : "STOP", audio_mask, state);
|
start ? "START" : "STOP", audio_mask, state);
|
||||||
if (start) {
|
if (start) {
|
||||||
/* start only pipes that are not yet started */
|
/* start only pipes that are not yet started */
|
||||||
@ -944,7 +949,7 @@ int pcxhr_set_pipe_state(struct pcxhr_mgr *mgr, int playback_mask,
|
|||||||
if ((state & audio_mask) == (start ? audio_mask : 0))
|
if ((state & audio_mask) == (start ? audio_mask : 0))
|
||||||
break;
|
break;
|
||||||
if (++i >= MAX_WAIT_FOR_DSP * 100) {
|
if (++i >= MAX_WAIT_FOR_DSP * 100) {
|
||||||
snd_printk(KERN_ERR "error pipe start/stop\n");
|
dev_err(&mgr->pci->dev, "error pipe start/stop\n");
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
}
|
}
|
||||||
udelay(10); /* wait 10 microseconds */
|
udelay(10); /* wait 10 microseconds */
|
||||||
@ -956,7 +961,7 @@ int pcxhr_set_pipe_state(struct pcxhr_mgr *mgr, int playback_mask,
|
|||||||
}
|
}
|
||||||
#ifdef CONFIG_SND_DEBUG_VERBOSE
|
#ifdef CONFIG_SND_DEBUG_VERBOSE
|
||||||
do_gettimeofday(&my_tv2);
|
do_gettimeofday(&my_tv2);
|
||||||
snd_printdd("***SET PIPE STATE*** TIME = %ld (err = %x)\n",
|
dev_dbg(&mgr->pci->dev, "***SET PIPE STATE*** TIME = %ld (err = %x)\n",
|
||||||
(long)(my_tv2.tv_usec - my_tv1.tv_usec), err);
|
(long)(my_tv2.tv_usec - my_tv1.tv_usec), err);
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
@ -971,7 +976,8 @@ int pcxhr_write_io_num_reg_cont(struct pcxhr_mgr *mgr, unsigned int mask,
|
|||||||
|
|
||||||
spin_lock_irqsave(&mgr->msg_lock, flags);
|
spin_lock_irqsave(&mgr->msg_lock, flags);
|
||||||
if ((mgr->io_num_reg_cont & mask) == value) {
|
if ((mgr->io_num_reg_cont & mask) == value) {
|
||||||
snd_printdd("IO_NUM_REG_CONT mask %x already is set to %x\n",
|
dev_dbg(&mgr->pci->dev,
|
||||||
|
"IO_NUM_REG_CONT mask %x already is set to %x\n",
|
||||||
mask, value);
|
mask, value);
|
||||||
if (changed)
|
if (changed)
|
||||||
*changed = 0;
|
*changed = 0;
|
||||||
@ -1024,7 +1030,7 @@ static int pcxhr_handle_async_err(struct pcxhr_mgr *mgr, u32 err,
|
|||||||
err = ((err >> 12) & 0xfff);
|
err = ((err >> 12) & 0xfff);
|
||||||
if (!err)
|
if (!err)
|
||||||
return 0;
|
return 0;
|
||||||
snd_printdd("CMD_ASYNC : Error %s %s Pipe %d err=%x\n",
|
dev_dbg(&mgr->pci->dev, "CMD_ASYNC : Error %s %s Pipe %d err=%x\n",
|
||||||
err_src_name[err_src],
|
err_src_name[err_src],
|
||||||
is_capture ? "Record" : "Play", pipe, err);
|
is_capture ? "Record" : "Play", pipe, err);
|
||||||
if (err == 0xe01)
|
if (err == 0xe01)
|
||||||
@ -1045,20 +1051,24 @@ void pcxhr_msg_tasklet(unsigned long arg)
|
|||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
if (mgr->src_it_dsp & PCXHR_IRQ_FREQ_CHANGE)
|
if (mgr->src_it_dsp & PCXHR_IRQ_FREQ_CHANGE)
|
||||||
snd_printdd("TASKLET : PCXHR_IRQ_FREQ_CHANGE event occurred\n");
|
dev_dbg(&mgr->pci->dev,
|
||||||
|
"TASKLET : PCXHR_IRQ_FREQ_CHANGE event occurred\n");
|
||||||
if (mgr->src_it_dsp & PCXHR_IRQ_TIME_CODE)
|
if (mgr->src_it_dsp & PCXHR_IRQ_TIME_CODE)
|
||||||
snd_printdd("TASKLET : PCXHR_IRQ_TIME_CODE event occurred\n");
|
dev_dbg(&mgr->pci->dev,
|
||||||
|
"TASKLET : PCXHR_IRQ_TIME_CODE event occurred\n");
|
||||||
if (mgr->src_it_dsp & PCXHR_IRQ_NOTIFY)
|
if (mgr->src_it_dsp & PCXHR_IRQ_NOTIFY)
|
||||||
snd_printdd("TASKLET : PCXHR_IRQ_NOTIFY event occurred\n");
|
dev_dbg(&mgr->pci->dev,
|
||||||
|
"TASKLET : PCXHR_IRQ_NOTIFY event occurred\n");
|
||||||
if (mgr->src_it_dsp & (PCXHR_IRQ_FREQ_CHANGE | PCXHR_IRQ_TIME_CODE)) {
|
if (mgr->src_it_dsp & (PCXHR_IRQ_FREQ_CHANGE | PCXHR_IRQ_TIME_CODE)) {
|
||||||
/* clear events FREQ_CHANGE and TIME_CODE */
|
/* clear events FREQ_CHANGE and TIME_CODE */
|
||||||
pcxhr_init_rmh(prmh, CMD_TEST_IT);
|
pcxhr_init_rmh(prmh, CMD_TEST_IT);
|
||||||
err = pcxhr_send_msg(mgr, prmh);
|
err = pcxhr_send_msg(mgr, prmh);
|
||||||
snd_printdd("CMD_TEST_IT : err=%x, stat=%x\n",
|
dev_dbg(&mgr->pci->dev, "CMD_TEST_IT : err=%x, stat=%x\n",
|
||||||
err, prmh->stat[0]);
|
err, prmh->stat[0]);
|
||||||
}
|
}
|
||||||
if (mgr->src_it_dsp & PCXHR_IRQ_ASYNC) {
|
if (mgr->src_it_dsp & PCXHR_IRQ_ASYNC) {
|
||||||
snd_printdd("TASKLET : PCXHR_IRQ_ASYNC event occurred\n");
|
dev_dbg(&mgr->pci->dev,
|
||||||
|
"TASKLET : PCXHR_IRQ_ASYNC event occurred\n");
|
||||||
|
|
||||||
pcxhr_init_rmh(prmh, CMD_ASYNC);
|
pcxhr_init_rmh(prmh, CMD_ASYNC);
|
||||||
prmh->cmd[0] |= 1; /* add SEL_ASYNC_EVENTS */
|
prmh->cmd[0] |= 1; /* add SEL_ASYNC_EVENTS */
|
||||||
@ -1066,7 +1076,7 @@ void pcxhr_msg_tasklet(unsigned long arg)
|
|||||||
prmh->stat_len = PCXHR_SIZE_MAX_LONG_STATUS;
|
prmh->stat_len = PCXHR_SIZE_MAX_LONG_STATUS;
|
||||||
err = pcxhr_send_msg(mgr, prmh);
|
err = pcxhr_send_msg(mgr, prmh);
|
||||||
if (err)
|
if (err)
|
||||||
snd_printk(KERN_ERR "ERROR pcxhr_msg_tasklet=%x;\n",
|
dev_err(&mgr->pci->dev, "ERROR pcxhr_msg_tasklet=%x;\n",
|
||||||
err);
|
err);
|
||||||
i = 1;
|
i = 1;
|
||||||
while (i < prmh->stat_len) {
|
while (i < prmh->stat_len) {
|
||||||
@ -1079,7 +1089,8 @@ void pcxhr_msg_tasklet(unsigned long arg)
|
|||||||
u32 err2;
|
u32 err2;
|
||||||
|
|
||||||
if (prmh->stat[i] & 0x800000) { /* if BIT_END */
|
if (prmh->stat[i] & 0x800000) { /* if BIT_END */
|
||||||
snd_printdd("TASKLET : End%sPipe %d\n",
|
dev_dbg(&mgr->pci->dev,
|
||||||
|
"TASKLET : End%sPipe %d\n",
|
||||||
is_capture ? "Record" : "Play",
|
is_capture ? "Record" : "Play",
|
||||||
pipe);
|
pipe);
|
||||||
}
|
}
|
||||||
@ -1136,7 +1147,8 @@ static u_int64_t pcxhr_stream_read_position(struct pcxhr_mgr *mgr,
|
|||||||
hw_sample_count = ((u_int64_t)rmh.stat[0]) << 24;
|
hw_sample_count = ((u_int64_t)rmh.stat[0]) << 24;
|
||||||
hw_sample_count += (u_int64_t)rmh.stat[1];
|
hw_sample_count += (u_int64_t)rmh.stat[1];
|
||||||
|
|
||||||
snd_printdd("stream %c%d : abs samples real(%llu) timer(%llu)\n",
|
dev_dbg(&mgr->pci->dev,
|
||||||
|
"stream %c%d : abs samples real(%llu) timer(%llu)\n",
|
||||||
stream->pipe->is_capture ? 'C' : 'P',
|
stream->pipe->is_capture ? 'C' : 'P',
|
||||||
stream->substream->number,
|
stream->substream->number,
|
||||||
hw_sample_count,
|
hw_sample_count,
|
||||||
@ -1202,7 +1214,7 @@ static void pcxhr_update_timer_pos(struct pcxhr_mgr *mgr,
|
|||||||
(u_int32_t)(new_sample_count -
|
(u_int32_t)(new_sample_count -
|
||||||
stream->timer_abs_periods);
|
stream->timer_abs_periods);
|
||||||
} else {
|
} else {
|
||||||
snd_printk(KERN_ERR
|
dev_err(&mgr->pci->dev,
|
||||||
"ERROR new_sample_count too small ??? %ld\n",
|
"ERROR new_sample_count too small ??? %ld\n",
|
||||||
(long unsigned int)new_sample_count);
|
(long unsigned int)new_sample_count);
|
||||||
}
|
}
|
||||||
@ -1247,33 +1259,39 @@ irqreturn_t pcxhr_interrupt(int irq, void *dev_id)
|
|||||||
(mgr->dsp_time_last != PCXHR_DSP_TIME_INVALID)) {
|
(mgr->dsp_time_last != PCXHR_DSP_TIME_INVALID)) {
|
||||||
/* handle dsp counter wraparound without resync */
|
/* handle dsp counter wraparound without resync */
|
||||||
int tmp_diff = dsp_time_diff + PCXHR_DSP_TIME_MASK + 1;
|
int tmp_diff = dsp_time_diff + PCXHR_DSP_TIME_MASK + 1;
|
||||||
snd_printdd("WARNING DSP timestamp old(%d) new(%d)",
|
dev_dbg(&mgr->pci->dev,
|
||||||
|
"WARNING DSP timestamp old(%d) new(%d)",
|
||||||
mgr->dsp_time_last, dsp_time_new);
|
mgr->dsp_time_last, dsp_time_new);
|
||||||
if (tmp_diff > 0 && tmp_diff <= (2*mgr->granularity)) {
|
if (tmp_diff > 0 && tmp_diff <= (2*mgr->granularity)) {
|
||||||
snd_printdd("-> timestamp wraparound OK: "
|
dev_dbg(&mgr->pci->dev,
|
||||||
|
"-> timestamp wraparound OK: "
|
||||||
"diff=%d\n", tmp_diff);
|
"diff=%d\n", tmp_diff);
|
||||||
dsp_time_diff = tmp_diff;
|
dsp_time_diff = tmp_diff;
|
||||||
} else {
|
} else {
|
||||||
snd_printdd("-> resynchronize all streams\n");
|
dev_dbg(&mgr->pci->dev,
|
||||||
|
"-> resynchronize all streams\n");
|
||||||
mgr->dsp_time_err++;
|
mgr->dsp_time_err++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef CONFIG_SND_DEBUG_VERBOSE
|
#ifdef CONFIG_SND_DEBUG_VERBOSE
|
||||||
if (dsp_time_diff == 0)
|
if (dsp_time_diff == 0)
|
||||||
snd_printdd("ERROR DSP TIME NO DIFF time(%d)\n",
|
dev_dbg(&mgr->pci->dev,
|
||||||
|
"ERROR DSP TIME NO DIFF time(%d)\n",
|
||||||
dsp_time_new);
|
dsp_time_new);
|
||||||
else if (dsp_time_diff >= (2*mgr->granularity))
|
else if (dsp_time_diff >= (2*mgr->granularity))
|
||||||
snd_printdd("ERROR DSP TIME TOO BIG old(%d) add(%d)\n",
|
dev_dbg(&mgr->pci->dev,
|
||||||
|
"ERROR DSP TIME TOO BIG old(%d) add(%d)\n",
|
||||||
mgr->dsp_time_last,
|
mgr->dsp_time_last,
|
||||||
dsp_time_new - mgr->dsp_time_last);
|
dsp_time_new - mgr->dsp_time_last);
|
||||||
else if (dsp_time_diff % mgr->granularity)
|
else if (dsp_time_diff % mgr->granularity)
|
||||||
snd_printdd("ERROR DSP TIME increased by %d\n",
|
dev_dbg(&mgr->pci->dev,
|
||||||
|
"ERROR DSP TIME increased by %d\n",
|
||||||
dsp_time_diff);
|
dsp_time_diff);
|
||||||
#endif
|
#endif
|
||||||
mgr->dsp_time_last = dsp_time_new;
|
mgr->dsp_time_last = dsp_time_new;
|
||||||
|
|
||||||
if (timer_toggle == mgr->timer_toggle) {
|
if (timer_toggle == mgr->timer_toggle) {
|
||||||
snd_printdd("ERROR TIMER TOGGLE\n");
|
dev_dbg(&mgr->pci->dev, "ERROR TIMER TOGGLE\n");
|
||||||
mgr->dsp_time_err++;
|
mgr->dsp_time_err++;
|
||||||
}
|
}
|
||||||
mgr->timer_toggle = timer_toggle;
|
mgr->timer_toggle = timer_toggle;
|
||||||
@ -1308,7 +1326,7 @@ irqreturn_t pcxhr_interrupt(int irq, void *dev_id)
|
|||||||
}
|
}
|
||||||
#ifdef CONFIG_SND_DEBUG_VERBOSE
|
#ifdef CONFIG_SND_DEBUG_VERBOSE
|
||||||
if (reg & PCXHR_FATAL_DSP_ERR)
|
if (reg & PCXHR_FATAL_DSP_ERR)
|
||||||
snd_printdd("FATAL DSP ERROR : %x\n", reg);
|
dev_dbg(&mgr->pci->dev, "FATAL DSP ERROR : %x\n", reg);
|
||||||
#endif
|
#endif
|
||||||
spin_unlock(&mgr->lock);
|
spin_unlock(&mgr->lock);
|
||||||
return IRQ_HANDLED; /* this device caused the interrupt */
|
return IRQ_HANDLED; /* this device caused the interrupt */
|
||||||
|
@ -72,7 +72,8 @@ static int pcxhr_init_board(struct pcxhr_mgr *mgr)
|
|||||||
/* test max nb substream per pipe */
|
/* test max nb substream per pipe */
|
||||||
if (((rmh.stat[1] >> 7) & 0x5F) < PCXHR_PLAYBACK_STREAMS)
|
if (((rmh.stat[1] >> 7) & 0x5F) < PCXHR_PLAYBACK_STREAMS)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
snd_printdd("supported formats : playback=%x capture=%x\n",
|
dev_dbg(&mgr->pci->dev,
|
||||||
|
"supported formats : playback=%x capture=%x\n",
|
||||||
rmh.stat[2], rmh.stat[3]);
|
rmh.stat[2], rmh.stat[3]);
|
||||||
|
|
||||||
pcxhr_init_rmh(&rmh, CMD_VERSION);
|
pcxhr_init_rmh(&rmh, CMD_VERSION);
|
||||||
@ -84,7 +85,8 @@ static int pcxhr_init_board(struct pcxhr_mgr *mgr)
|
|||||||
err = pcxhr_send_msg(mgr, &rmh);
|
err = pcxhr_send_msg(mgr, &rmh);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
snd_printdd("PCXHR DSP version is %d.%d.%d\n", (rmh.stat[0]>>16)&0xff,
|
dev_dbg(&mgr->pci->dev,
|
||||||
|
"PCXHR DSP version is %d.%d.%d\n", (rmh.stat[0]>>16)&0xff,
|
||||||
(rmh.stat[0]>>8)&0xff, rmh.stat[0]&0xff);
|
(rmh.stat[0]>>8)&0xff, rmh.stat[0]&0xff);
|
||||||
mgr->dsp_version = rmh.stat[0];
|
mgr->dsp_version = rmh.stat[0];
|
||||||
|
|
||||||
@ -179,7 +181,7 @@ static int pcxhr_dsp_allocate_pipe(struct pcxhr_mgr *mgr,
|
|||||||
stream_count = PCXHR_PLAYBACK_STREAMS;
|
stream_count = PCXHR_PLAYBACK_STREAMS;
|
||||||
audio_count = 2; /* always stereo */
|
audio_count = 2; /* always stereo */
|
||||||
}
|
}
|
||||||
snd_printdd("snd_add_ref_pipe pin(%d) pcm%c0\n",
|
dev_dbg(&mgr->pci->dev, "snd_add_ref_pipe pin(%d) pcm%c0\n",
|
||||||
pin, is_capture ? 'c' : 'p');
|
pin, is_capture ? 'c' : 'p');
|
||||||
pipe->is_capture = is_capture;
|
pipe->is_capture = is_capture;
|
||||||
pipe->first_audio = pin;
|
pipe->first_audio = pin;
|
||||||
@ -194,7 +196,7 @@ static int pcxhr_dsp_allocate_pipe(struct pcxhr_mgr *mgr,
|
|||||||
}
|
}
|
||||||
err = pcxhr_send_msg(mgr, &rmh);
|
err = pcxhr_send_msg(mgr, &rmh);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
snd_printk(KERN_ERR "error pipe allocation "
|
dev_err(&mgr->pci->dev, "error pipe allocation "
|
||||||
"(CMD_RES_PIPE) err=%x!\n", err);
|
"(CMD_RES_PIPE) err=%x!\n", err);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
@ -222,14 +224,14 @@ static int pcxhr_dsp_free_pipe( struct pcxhr_mgr *mgr, struct pcxhr_pipe *pipe)
|
|||||||
/* stop one pipe */
|
/* stop one pipe */
|
||||||
err = pcxhr_set_pipe_state(mgr, playback_mask, capture_mask, 0);
|
err = pcxhr_set_pipe_state(mgr, playback_mask, capture_mask, 0);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
snd_printk(KERN_ERR "error stopping pipe!\n");
|
dev_err(&mgr->pci->dev, "error stopping pipe!\n");
|
||||||
/* release the pipe */
|
/* release the pipe */
|
||||||
pcxhr_init_rmh(&rmh, CMD_FREE_PIPE);
|
pcxhr_init_rmh(&rmh, CMD_FREE_PIPE);
|
||||||
pcxhr_set_pipe_cmd_params(&rmh, pipe->is_capture, pipe->first_audio,
|
pcxhr_set_pipe_cmd_params(&rmh, pipe->is_capture, pipe->first_audio,
|
||||||
0, 0);
|
0, 0);
|
||||||
err = pcxhr_send_msg(mgr, &rmh);
|
err = pcxhr_send_msg(mgr, &rmh);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
snd_printk(KERN_ERR "error pipe release "
|
dev_err(&mgr->pci->dev, "error pipe release "
|
||||||
"(CMD_FREE_PIPE) err(%x)\n", err);
|
"(CMD_FREE_PIPE) err(%x)\n", err);
|
||||||
pipe->status = PCXHR_PIPE_UNDEFINED;
|
pipe->status = PCXHR_PIPE_UNDEFINED;
|
||||||
return err;
|
return err;
|
||||||
@ -289,7 +291,8 @@ static int pcxhr_dsp_load(struct pcxhr_mgr *mgr, int index,
|
|||||||
{
|
{
|
||||||
int err, card_index;
|
int err, card_index;
|
||||||
|
|
||||||
snd_printdd("loading dsp [%d] size = %Zd\n", index, dsp->size);
|
dev_dbg(&mgr->pci->dev,
|
||||||
|
"loading dsp [%d] size = %Zd\n", index, dsp->size);
|
||||||
|
|
||||||
switch (index) {
|
switch (index) {
|
||||||
case PCXHR_FIRMWARE_XLX_INT_INDEX:
|
case PCXHR_FIRMWARE_XLX_INT_INDEX:
|
||||||
@ -313,19 +316,19 @@ static int pcxhr_dsp_load(struct pcxhr_mgr *mgr, int index,
|
|||||||
return err;
|
return err;
|
||||||
break; /* continue with first init */
|
break; /* continue with first init */
|
||||||
default:
|
default:
|
||||||
snd_printk(KERN_ERR "wrong file index\n");
|
dev_err(&mgr->pci->dev, "wrong file index\n");
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
} /* end of switch file index*/
|
} /* end of switch file index*/
|
||||||
|
|
||||||
/* first communication with embedded */
|
/* first communication with embedded */
|
||||||
err = pcxhr_init_board(mgr);
|
err = pcxhr_init_board(mgr);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
snd_printk(KERN_ERR "pcxhr could not be set up\n");
|
dev_err(&mgr->pci->dev, "pcxhr could not be set up\n");
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
err = pcxhr_config_pipes(mgr);
|
err = pcxhr_config_pipes(mgr);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
snd_printk(KERN_ERR "pcxhr pipes could not be set up\n");
|
dev_err(&mgr->pci->dev, "pcxhr pipes could not be set up\n");
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
/* create devices and mixer in accordance with HW options*/
|
/* create devices and mixer in accordance with HW options*/
|
||||||
@ -344,10 +347,11 @@ static int pcxhr_dsp_load(struct pcxhr_mgr *mgr, int index,
|
|||||||
}
|
}
|
||||||
err = pcxhr_start_pipes(mgr);
|
err = pcxhr_start_pipes(mgr);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
snd_printk(KERN_ERR "pcxhr pipes could not be started\n");
|
dev_err(&mgr->pci->dev, "pcxhr pipes could not be started\n");
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
snd_printdd("pcxhr firmware downloaded and successfully set up\n");
|
dev_dbg(&mgr->pci->dev,
|
||||||
|
"pcxhr firmware downloaded and successfully set up\n");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -382,7 +386,8 @@ int pcxhr_setup_firmware(struct pcxhr_mgr *mgr)
|
|||||||
continue;
|
continue;
|
||||||
sprintf(path, "pcxhr/%s", fw_files[fw_set][i]);
|
sprintf(path, "pcxhr/%s", fw_files[fw_set][i]);
|
||||||
if (request_firmware(&fw_entry, path, &mgr->pci->dev)) {
|
if (request_firmware(&fw_entry, path, &mgr->pci->dev)) {
|
||||||
snd_printk(KERN_ERR "pcxhr: can't load firmware %s\n",
|
dev_err(&mgr->pci->dev,
|
||||||
|
"pcxhr: can't load firmware %s\n",
|
||||||
path);
|
path);
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
#include <linux/delay.h>
|
#include <linux/delay.h>
|
||||||
#include <linux/io.h>
|
#include <linux/io.h>
|
||||||
|
#include <linux/pci.h>
|
||||||
#include <sound/core.h>
|
#include <sound/core.h>
|
||||||
#include <sound/control.h>
|
#include <sound/control.h>
|
||||||
#include <sound/tlv.h>
|
#include <sound/tlv.h>
|
||||||
@ -290,7 +291,8 @@ int hr222_sub_init(struct pcxhr_mgr *mgr)
|
|||||||
reg = PCXHR_INPB(mgr, PCXHR_XLX_STATUS);
|
reg = PCXHR_INPB(mgr, PCXHR_XLX_STATUS);
|
||||||
if (reg & PCXHR_STAT_MIC_CAPS)
|
if (reg & PCXHR_STAT_MIC_CAPS)
|
||||||
mgr->board_has_mic = 1; /* microphone available */
|
mgr->board_has_mic = 1; /* microphone available */
|
||||||
snd_printdd("MIC input available = %d\n", mgr->board_has_mic);
|
dev_dbg(&mgr->pci->dev,
|
||||||
|
"MIC input available = %d\n", mgr->board_has_mic);
|
||||||
|
|
||||||
/* reset codec */
|
/* reset codec */
|
||||||
PCXHR_OUTPB(mgr, PCXHR_DSP_RESET,
|
PCXHR_OUTPB(mgr, PCXHR_DSP_RESET,
|
||||||
@ -405,7 +407,7 @@ int hr222_sub_set_clock(struct pcxhr_mgr *mgr,
|
|||||||
|
|
||||||
hr222_config_akm(mgr, AKM_UNMUTE_CMD);
|
hr222_config_akm(mgr, AKM_UNMUTE_CMD);
|
||||||
|
|
||||||
snd_printdd("set_clock to %dHz (realfreq=%d pllreg=%x)\n",
|
dev_dbg(&mgr->pci->dev, "set_clock to %dHz (realfreq=%d pllreg=%x)\n",
|
||||||
rate, realfreq, pllreg);
|
rate, realfreq, pllreg);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -431,13 +433,15 @@ int hr222_get_external_clock(struct pcxhr_mgr *mgr,
|
|||||||
reg = PCXHR_STAT_FREQ_UER1_MASK;
|
reg = PCXHR_STAT_FREQ_UER1_MASK;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
snd_printdd("get_external_clock : type %d not supported\n",
|
dev_dbg(&mgr->pci->dev,
|
||||||
|
"get_external_clock : type %d not supported\n",
|
||||||
clock_type);
|
clock_type);
|
||||||
return -EINVAL; /* other clocks not supported */
|
return -EINVAL; /* other clocks not supported */
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((PCXHR_INPB(mgr, PCXHR_XLX_CSUER) & mask) != mask) {
|
if ((PCXHR_INPB(mgr, PCXHR_XLX_CSUER) & mask) != mask) {
|
||||||
snd_printdd("get_external_clock(%d) = 0 Hz\n", clock_type);
|
dev_dbg(&mgr->pci->dev,
|
||||||
|
"get_external_clock(%d) = 0 Hz\n", clock_type);
|
||||||
*sample_rate = 0;
|
*sample_rate = 0;
|
||||||
return 0; /* no external clock locked */
|
return 0; /* no external clock locked */
|
||||||
}
|
}
|
||||||
@ -495,7 +499,7 @@ int hr222_get_external_clock(struct pcxhr_mgr *mgr,
|
|||||||
else
|
else
|
||||||
rate = 0;
|
rate = 0;
|
||||||
|
|
||||||
snd_printdd("External clock is at %d Hz (measured %d Hz)\n",
|
dev_dbg(&mgr->pci->dev, "External clock is at %d Hz (measured %d Hz)\n",
|
||||||
rate, calc_rate);
|
rate, calc_rate);
|
||||||
*sample_rate = rate;
|
*sample_rate = rate;
|
||||||
return 0;
|
return 0;
|
||||||
@ -542,7 +546,8 @@ int hr222_manage_timecode(struct pcxhr_mgr *mgr, int enable)
|
|||||||
int hr222_update_analog_audio_level(struct snd_pcxhr *chip,
|
int hr222_update_analog_audio_level(struct snd_pcxhr *chip,
|
||||||
int is_capture, int channel)
|
int is_capture, int channel)
|
||||||
{
|
{
|
||||||
snd_printdd("hr222_update_analog_audio_level(%s chan=%d)\n",
|
dev_dbg(chip->card->dev,
|
||||||
|
"hr222_update_analog_audio_level(%s chan=%d)\n",
|
||||||
is_capture ? "capture" : "playback", channel);
|
is_capture ? "capture" : "playback", channel);
|
||||||
if (is_capture) {
|
if (is_capture) {
|
||||||
int level_l, level_r, level_mic;
|
int level_l, level_r, level_mic;
|
||||||
@ -642,7 +647,7 @@ int hr222_iec958_capture_byte(struct snd_pcxhr *chip,
|
|||||||
if (PCXHR_INPB(chip->mgr, PCXHR_XLX_CSUER) & mask)
|
if (PCXHR_INPB(chip->mgr, PCXHR_XLX_CSUER) & mask)
|
||||||
temp |= 1;
|
temp |= 1;
|
||||||
}
|
}
|
||||||
snd_printdd("read iec958 AES %d byte %d = 0x%x\n",
|
dev_dbg(chip->card->dev, "read iec958 AES %d byte %d = 0x%x\n",
|
||||||
chip->chip_idx, aes_idx, temp);
|
chip->chip_idx, aes_idx, temp);
|
||||||
*aes_bits = temp;
|
*aes_bits = temp;
|
||||||
return 0;
|
return 0;
|
||||||
@ -684,7 +689,7 @@ static void hr222_micro_boost(struct pcxhr_mgr *mgr, int level)
|
|||||||
|
|
||||||
PCXHR_OUTPB(mgr, PCXHR_XLX_SELMIC, mgr->xlx_selmic);
|
PCXHR_OUTPB(mgr, PCXHR_XLX_SELMIC, mgr->xlx_selmic);
|
||||||
|
|
||||||
snd_printdd("hr222_micro_boost : set %x\n", boost_mask);
|
dev_dbg(&mgr->pci->dev, "hr222_micro_boost : set %x\n", boost_mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void hr222_phantom_power(struct pcxhr_mgr *mgr, int power)
|
static void hr222_phantom_power(struct pcxhr_mgr *mgr, int power)
|
||||||
@ -696,7 +701,7 @@ static void hr222_phantom_power(struct pcxhr_mgr *mgr, int power)
|
|||||||
|
|
||||||
PCXHR_OUTPB(mgr, PCXHR_XLX_SELMIC, mgr->xlx_selmic);
|
PCXHR_OUTPB(mgr, PCXHR_XLX_SELMIC, mgr->xlx_selmic);
|
||||||
|
|
||||||
snd_printdd("hr222_phantom_power : set %d\n", power);
|
dev_dbg(&mgr->pci->dev, "hr222_phantom_power : set %d\n", power);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -72,7 +72,8 @@ static int pcxhr_update_analog_audio_level(struct snd_pcxhr *chip,
|
|||||||
rmh.cmd_len = 3;
|
rmh.cmd_len = 3;
|
||||||
err = pcxhr_send_msg(chip->mgr, &rmh);
|
err = pcxhr_send_msg(chip->mgr, &rmh);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
snd_printk(KERN_DEBUG "error update_analog_audio_level card(%d)"
|
dev_dbg(chip->card->dev,
|
||||||
|
"error update_analog_audio_level card(%d)"
|
||||||
" is_capture(%d) err(%x)\n",
|
" is_capture(%d) err(%x)\n",
|
||||||
chip->chip_idx, is_capture, err);
|
chip->chip_idx, is_capture, err);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
@ -284,7 +285,7 @@ static int pcxhr_update_playback_stream_level(struct snd_pcxhr* chip, int idx)
|
|||||||
|
|
||||||
err = pcxhr_send_msg(chip->mgr, &rmh);
|
err = pcxhr_send_msg(chip->mgr, &rmh);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
snd_printk(KERN_DEBUG "error update_playback_stream_level "
|
dev_dbg(chip->card->dev, "error update_playback_stream_level "
|
||||||
"card(%d) err(%x)\n", chip->chip_idx, err);
|
"card(%d) err(%x)\n", chip->chip_idx, err);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
@ -335,7 +336,8 @@ static int pcxhr_update_audio_pipe_level(struct snd_pcxhr *chip,
|
|||||||
|
|
||||||
err = pcxhr_send_msg(chip->mgr, &rmh);
|
err = pcxhr_send_msg(chip->mgr, &rmh);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
snd_printk(KERN_DEBUG "error update_audio_level(%d) err=%x\n",
|
dev_dbg(chip->card->dev,
|
||||||
|
"error update_audio_level(%d) err=%x\n",
|
||||||
chip->chip_idx, err);
|
chip->chip_idx, err);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
@ -930,7 +932,7 @@ static int pcxhr_iec958_capture_byte(struct snd_pcxhr *chip,
|
|||||||
temp |= 1;
|
temp |= 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
snd_printdd("read iec958 AES %d byte %d = 0x%x\n",
|
dev_dbg(chip->card->dev, "read iec958 AES %d byte %d = 0x%x\n",
|
||||||
chip->chip_idx, aes_idx, temp);
|
chip->chip_idx, aes_idx, temp);
|
||||||
*aes_bits = temp;
|
*aes_bits = temp;
|
||||||
return 0;
|
return 0;
|
||||||
@ -992,7 +994,8 @@ static int pcxhr_iec958_update_byte(struct snd_pcxhr *chip,
|
|||||||
rmh.cmd[0] |= IO_NUM_REG_CUER;
|
rmh.cmd[0] |= IO_NUM_REG_CUER;
|
||||||
rmh.cmd[1] = cmd;
|
rmh.cmd[1] = cmd;
|
||||||
rmh.cmd_len = 2;
|
rmh.cmd_len = 2;
|
||||||
snd_printdd("write iec958 AES %d byte %d bit %d (cmd %x)\n",
|
dev_dbg(chip->card->dev,
|
||||||
|
"write iec958 AES %d byte %d bit %d (cmd %x)\n",
|
||||||
chip->chip_idx, aes_idx, i, cmd);
|
chip->chip_idx, aes_idx, i, cmd);
|
||||||
err = pcxhr_send_msg(chip->mgr, &rmh);
|
err = pcxhr_send_msg(chip->mgr, &rmh);
|
||||||
if (err)
|
if (err)
|
||||||
|
Loading…
Reference in New Issue
Block a user