ALSA: mixart: 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:
Takashi Iwai 2014-02-25 17:51:46 +01:00
parent be4e6d3c0f
commit 6414e35deb
4 changed files with 163 additions and 85 deletions

View file

@ -87,7 +87,8 @@ static int mixart_set_pipe_state(struct mixart_mgr *mgr,
if(!start) return 0; /* already stopped */
break;
default:
snd_printk(KERN_ERR "error mixart_set_pipe_state called with wrong pipe->status!\n");
dev_err(&mgr->pci->dev,
"error mixart_set_pipe_state called with wrong pipe->status!\n");
return -EINVAL; /* function called with wrong pipe status */
}
@ -102,7 +103,8 @@ static int mixart_set_pipe_state(struct mixart_mgr *mgr,
err = snd_mixart_send_msg_wait_notif(mgr, &request, system_msg_uid);
if(err) {
snd_printk(KERN_ERR "error : MSG_SYSTEM_WAIT_SYNCHRO_CMD was not notified !\n");
dev_err(&mgr->pci->dev,
"error : MSG_SYSTEM_WAIT_SYNCHRO_CMD was not notified !\n");
return err;
}
@ -123,7 +125,9 @@ static int mixart_set_pipe_state(struct mixart_mgr *mgr,
err = snd_mixart_send_msg(mgr, &request, sizeof(group_state_resp), &group_state_resp);
if (err < 0 || group_state_resp.txx_status != 0) {
snd_printk(KERN_ERR "error MSG_STREAM_ST***_STREAM_GRP_PACKET err=%x stat=%x !\n", err, group_state_resp.txx_status);
dev_err(&mgr->pci->dev,
"error MSG_STREAM_ST***_STREAM_GRP_PACKET err=%x stat=%x !\n",
err, group_state_resp.txx_status);
return -EINVAL;
}
@ -134,7 +138,9 @@ static int mixart_set_pipe_state(struct mixart_mgr *mgr,
err = snd_mixart_send_msg(mgr, &request, sizeof(group_state_resp), &group_state_resp);
if (err < 0 || group_state_resp.txx_status != 0) {
snd_printk(KERN_ERR "error MSG_STREAM_START_STREAM_GRP_PACKET err=%x stat=%x !\n", err, group_state_resp.txx_status);
dev_err(&mgr->pci->dev,
"error MSG_STREAM_START_STREAM_GRP_PACKET err=%x stat=%x !\n",
err, group_state_resp.txx_status);
return -EINVAL;
}
@ -147,7 +153,9 @@ static int mixart_set_pipe_state(struct mixart_mgr *mgr,
err = snd_mixart_send_msg(mgr, &request, sizeof(stat), &stat);
if (err < 0 || stat != 0) {
snd_printk(KERN_ERR "error MSG_SYSTEM_SEND_SYNCHRO_CMD err=%x stat=%x !\n", err, stat);
dev_err(&mgr->pci->dev,
"error MSG_SYSTEM_SEND_SYNCHRO_CMD err=%x stat=%x !\n",
err, stat);
return -EINVAL;
}
@ -178,7 +186,9 @@ static int mixart_set_clock(struct mixart_mgr *mgr,
if(rate == 0)
return 0; /* nothing to do */
else {
snd_printk(KERN_ERR "error mixart_set_clock(%d) called with wrong pipe->status !\n", rate);
dev_err(&mgr->pci->dev,
"error mixart_set_clock(%d) called with wrong pipe->status !\n",
rate);
return -EINVAL;
}
}
@ -190,7 +200,7 @@ static int mixart_set_clock(struct mixart_mgr *mgr,
clock_properties.nb_callers = 1; /* only one entry in uid_caller ! */
clock_properties.uid_caller[0] = pipe->group_uid;
snd_printdd("mixart_set_clock to %d kHz\n", rate);
dev_dbg(&mgr->pci->dev, "mixart_set_clock to %d kHz\n", rate);
request.message_id = MSG_CLOCK_SET_PROPERTIES;
request.uid = mgr->uid_console_manager;
@ -199,7 +209,9 @@ static int mixart_set_clock(struct mixart_mgr *mgr,
err = snd_mixart_send_msg(mgr, &request, sizeof(clock_prop_resp), &clock_prop_resp);
if (err < 0 || clock_prop_resp.status != 0 || clock_prop_resp.clock_mode != CM_STANDALONE) {
snd_printk(KERN_ERR "error MSG_CLOCK_SET_PROPERTIES err=%x stat=%x mod=%x !\n", err, clock_prop_resp.status, clock_prop_resp.clock_mode);
dev_err(&mgr->pci->dev,
"error MSG_CLOCK_SET_PROPERTIES err=%x stat=%x mod=%x !\n",
err, clock_prop_resp.status, clock_prop_resp.clock_mode);
return -EINVAL;
}
@ -252,7 +264,9 @@ snd_mixart_add_ref_pipe(struct snd_mixart *chip, int pcm_number, int capture,
struct mixart_streaming_group sgroup_resp;
} *buf;
snd_printdd("add_ref_pipe audio chip(%d) pcm(%d)\n", chip->chip_idx, pcm_number);
dev_dbg(chip->card->dev,
"add_ref_pipe audio chip(%d) pcm(%d)\n",
chip->chip_idx, pcm_number);
buf = kmalloc(sizeof(*buf), GFP_KERNEL);
if (!buf)
@ -302,7 +316,9 @@ snd_mixart_add_ref_pipe(struct snd_mixart *chip, int pcm_number, int capture,
err = snd_mixart_send_msg(chip->mgr, &request, sizeof(buf->sgroup_resp), &buf->sgroup_resp);
if((err < 0) || (buf->sgroup_resp.status != 0)) {
snd_printk(KERN_ERR "error MSG_STREAM_ADD_**PUT_GROUP err=%x stat=%x !\n", err, buf->sgroup_resp.status);
dev_err(chip->card->dev,
"error MSG_STREAM_ADD_**PUT_GROUP err=%x stat=%x !\n",
err, buf->sgroup_resp.status);
kfree(buf);
return NULL;
}
@ -343,13 +359,14 @@ int snd_mixart_kill_ref_pipe(struct mixart_mgr *mgr,
/* release the clock */
err = mixart_set_clock( mgr, pipe, 0);
if( err < 0 ) {
snd_printk(KERN_ERR "mixart_set_clock(0) return error!\n");
dev_err(&mgr->pci->dev,
"mixart_set_clock(0) return error!\n");
}
/* stop the pipe */
err = mixart_set_pipe_state(mgr, pipe, 0);
if( err < 0 ) {
snd_printk(KERN_ERR "error stopping pipe!\n");
dev_err(&mgr->pci->dev, "error stopping pipe!\n");
}
request.message_id = MSG_STREAM_DELETE_GROUP;
@ -360,7 +377,9 @@ int snd_mixart_kill_ref_pipe(struct mixart_mgr *mgr,
/* delete the pipe */
err = snd_mixart_send_msg(mgr, &request, sizeof(delete_resp), &delete_resp);
if ((err < 0) || (delete_resp.status != 0)) {
snd_printk(KERN_ERR "error MSG_STREAM_DELETE_GROUP err(%x), status(%x)\n", err, delete_resp.status);
dev_err(&mgr->pci->dev,
"error MSG_STREAM_DELETE_GROUP err(%x), status(%x)\n",
err, delete_resp.status);
}
pipe->group_uid = (struct mixart_uid){0,0};
@ -414,7 +433,7 @@ static int snd_mixart_trigger(struct snd_pcm_substream *subs, int cmd)
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
snd_printdd("SNDRV_PCM_TRIGGER_START\n");
dev_dbg(subs->pcm->card->dev, "SNDRV_PCM_TRIGGER_START\n");
/* START_STREAM */
if( mixart_set_stream_state(stream, 1) )
@ -431,19 +450,19 @@ static int snd_mixart_trigger(struct snd_pcm_substream *subs, int cmd)
stream->status = MIXART_STREAM_STATUS_OPEN;
snd_printdd("SNDRV_PCM_TRIGGER_STOP\n");
dev_dbg(subs->pcm->card->dev, "SNDRV_PCM_TRIGGER_STOP\n");
break;
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
/* TODO */
stream->status = MIXART_STREAM_STATUS_PAUSE;
snd_printdd("SNDRV_PCM_PAUSE_PUSH\n");
dev_dbg(subs->pcm->card->dev, "SNDRV_PCM_PAUSE_PUSH\n");
break;
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
/* TODO */
stream->status = MIXART_STREAM_STATUS_RUNNING;
snd_printdd("SNDRV_PCM_PAUSE_RELEASE\n");
dev_dbg(subs->pcm->card->dev, "SNDRV_PCM_PAUSE_RELEASE\n");
break;
default:
return -EINVAL;
@ -456,7 +475,8 @@ static int mixart_sync_nonblock_events(struct mixart_mgr *mgr)
unsigned long timeout = jiffies + HZ;
while (atomic_read(&mgr->msg_processed) > 0) {
if (time_after(jiffies, timeout)) {
snd_printk(KERN_ERR "mixart: cannot process nonblock events!\n");
dev_err(&mgr->pci->dev,
"mixart: cannot process nonblock events!\n");
return -EBUSY;
}
schedule_timeout_uninterruptible(1);
@ -474,7 +494,7 @@ static int snd_mixart_prepare(struct snd_pcm_substream *subs)
/* TODO de façon non bloquante, réappliquer les hw_params (rate, bits, codec) */
snd_printdd("snd_mixart_prepare\n");
dev_dbg(chip->card->dev, "snd_mixart_prepare\n");
mixart_sync_nonblock_events(chip->mgr);
@ -542,11 +562,13 @@ static int mixart_set_format(struct mixart_stream *stream, snd_pcm_format_t form
stream_param.sample_size = 32;
break;
default:
snd_printk(KERN_ERR "error mixart_set_format() : unknown format\n");
dev_err(chip->card->dev,
"error mixart_set_format() : unknown format\n");
return -EINVAL;
}
snd_printdd("set SNDRV_PCM_FORMAT sample_type(%d) sample_size(%d) freq(%d) channels(%d)\n",
dev_dbg(chip->card->dev,
"set SNDRV_PCM_FORMAT sample_type(%d) sample_size(%d) freq(%d) channels(%d)\n",
stream_param.sample_type, stream_param.sample_size, stream_param.sampling_freq, stream->channels);
/* TODO: what else to configure ? */
@ -566,7 +588,9 @@ static int mixart_set_format(struct mixart_stream *stream, snd_pcm_format_t form
err = snd_mixart_send_msg(chip->mgr, &request, sizeof(resp), &resp);
if((err < 0) || resp.error_code) {
snd_printk(KERN_ERR "MSG_STREAM_SET_INPUT_STAGE_PARAM err=%x; resp=%x\n", err, resp.error_code);
dev_err(chip->card->dev,
"MSG_STREAM_SET_INPUT_STAGE_PARAM err=%x; resp=%x\n",
err, resp.error_code);
return -EINVAL;
}
return 0;
@ -627,8 +651,9 @@ static int snd_mixart_hw_params(struct snd_pcm_substream *subs,
bufferinfo[i].available_length = subs->runtime->dma_bytes;
/* bufferinfo[i].buffer_id is already defined */
snd_printdd("snd_mixart_hw_params(pcm %d) : dma_addr(%x) dma_bytes(%x) subs-number(%d)\n", i,
bufferinfo[i].buffer_address,
dev_dbg(chip->card->dev,
"snd_mixart_hw_params(pcm %d) : dma_addr(%x) dma_bytes(%x) subs-number(%d)\n",
i, bufferinfo[i].buffer_address,
bufferinfo[i].available_length,
subs->number);
}
@ -714,14 +739,18 @@ static int snd_mixart_playback_open(struct snd_pcm_substream *subs)
pcm_number = MIXART_PCM_DIGITAL;
runtime->hw = snd_mixart_digital_caps;
}
snd_printdd("snd_mixart_playback_open C%d/P%d/Sub%d\n", chip->chip_idx, pcm_number, subs->number);
dev_dbg(chip->card->dev,
"snd_mixart_playback_open C%d/P%d/Sub%d\n",
chip->chip_idx, pcm_number, subs->number);
/* get stream info */
stream = &(chip->playback_stream[pcm_number][subs->number]);
if (stream->status != MIXART_STREAM_STATUS_FREE){
/* streams in use */
snd_printk(KERN_ERR "snd_mixart_playback_open C%d/P%d/Sub%d in use\n", chip->chip_idx, pcm_number, subs->number);
dev_err(chip->card->dev,
"snd_mixart_playback_open C%d/P%d/Sub%d in use\n",
chip->chip_idx, pcm_number, subs->number);
err = -EBUSY;
goto _exit_open;
}
@ -737,7 +766,7 @@ static int snd_mixart_playback_open(struct snd_pcm_substream *subs)
/* start the pipe if necessary */
err = mixart_set_pipe_state(chip->mgr, pipe, 1);
if( err < 0 ) {
snd_printk(KERN_ERR "error starting pipe!\n");
dev_err(chip->card->dev, "error starting pipe!\n");
snd_mixart_kill_ref_pipe(chip->mgr, pipe, 0);
err = -EINVAL;
goto _exit_open;
@ -792,14 +821,17 @@ static int snd_mixart_capture_open(struct snd_pcm_substream *subs)
runtime->hw.channels_min = 2; /* for instance, no mono */
snd_printdd("snd_mixart_capture_open C%d/P%d/Sub%d\n", chip->chip_idx, pcm_number, subs->number);
dev_dbg(chip->card->dev, "snd_mixart_capture_open C%d/P%d/Sub%d\n",
chip->chip_idx, pcm_number, subs->number);
/* get stream info */
stream = &(chip->capture_stream[pcm_number]);
if (stream->status != MIXART_STREAM_STATUS_FREE){
/* streams in use */
snd_printk(KERN_ERR "snd_mixart_capture_open C%d/P%d/Sub%d in use\n", chip->chip_idx, pcm_number, subs->number);
dev_err(chip->card->dev,
"snd_mixart_capture_open C%d/P%d/Sub%d in use\n",
chip->chip_idx, pcm_number, subs->number);
err = -EBUSY;
goto _exit_open;
}
@ -815,7 +847,7 @@ static int snd_mixart_capture_open(struct snd_pcm_substream *subs)
/* start the pipe if necessary */
err = mixart_set_pipe_state(chip->mgr, pipe, 1);
if( err < 0 ) {
snd_printk(KERN_ERR "error starting pipe!\n");
dev_err(chip->card->dev, "error starting pipe!\n");
snd_mixart_kill_ref_pipe(chip->mgr, pipe, 0);
err = -EINVAL;
goto _exit_open;
@ -855,7 +887,8 @@ static int snd_mixart_close(struct snd_pcm_substream *subs)
mutex_lock(&mgr->setup_mutex);
snd_printdd("snd_mixart_close C%d/P%d/Sub%d\n", chip->chip_idx, stream->pcm_number, subs->number);
dev_dbg(chip->card->dev, "snd_mixart_close C%d/P%d/Sub%d\n",
chip->chip_idx, stream->pcm_number, subs->number);
/* sample rate released */
if(--mgr->ref_count_rate == 0) {
@ -865,7 +898,9 @@ static int snd_mixart_close(struct snd_pcm_substream *subs)
/* delete pipe */
if (snd_mixart_kill_ref_pipe(mgr, stream->pipe, 0 ) < 0) {
snd_printk(KERN_ERR "error snd_mixart_kill_ref_pipe C%dP%d\n", chip->chip_idx, stream->pcm_number);
dev_err(chip->card->dev,
"error snd_mixart_kill_ref_pipe C%dP%d\n",
chip->chip_idx, stream->pcm_number);
}
stream->pipe = NULL;
@ -940,7 +975,8 @@ static int snd_mixart_pcm_analog(struct snd_mixart *chip)
if ((err = snd_pcm_new(chip->card, name, MIXART_PCM_ANALOG,
MIXART_PLAYBACK_STREAMS,
MIXART_CAPTURE_STREAMS, &pcm)) < 0) {
snd_printk(KERN_ERR "cannot create the analog pcm %d\n", chip->chip_idx);
dev_err(chip->card->dev,
"cannot create the analog pcm %d\n", chip->chip_idx);
return err;
}
@ -971,7 +1007,8 @@ static int snd_mixart_pcm_digital(struct snd_mixart *chip)
if ((err = snd_pcm_new(chip->card, name, MIXART_PCM_DIGITAL,
MIXART_PLAYBACK_STREAMS,
MIXART_CAPTURE_STREAMS, &pcm)) < 0) {
snd_printk(KERN_ERR "cannot create the digital pcm %d\n", chip->chip_idx);
dev_err(chip->card->dev,
"cannot create the digital pcm %d\n", chip->chip_idx);
return err;
}
@ -1014,7 +1051,7 @@ static int snd_mixart_create(struct mixart_mgr *mgr, struct snd_card *card, int
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
if (! chip) {
snd_printk(KERN_ERR "cannot allocate chip\n");
dev_err(card->dev, "cannot allocate chip\n");
return -ENOMEM;
}
@ -1071,7 +1108,7 @@ static int snd_mixart_free(struct mixart_mgr *mgr)
/* reset board if some firmware was loaded */
if(mgr->dsp_loaded) {
snd_mixart_reset_board(mgr);
snd_printdd("reset miXart !\n");
dev_dbg(&mgr->pci->dev, "reset miXart !\n");
}
/* release the i/o ports */
@ -1232,7 +1269,8 @@ static int snd_mixart_probe(struct pci_dev *pci,
/* check if we can restrict PCI DMA transfers to 32 bits */
if (pci_set_dma_mask(pci, DMA_BIT_MASK(32)) < 0) {
snd_printk(KERN_ERR "architecture does not support 32bit PCI busmaster DMA\n");
dev_err(&pci->dev,
"architecture does not support 32bit PCI busmaster DMA\n");
pci_disable_device(pci);
return -ENXIO;
}
@ -1258,7 +1296,7 @@ static int snd_mixart_probe(struct pci_dev *pci,
mgr->mem[i].phys = pci_resource_start(pci, i);
mgr->mem[i].virt = pci_ioremap_bar(pci, i);
if (!mgr->mem[i].virt) {
printk(KERN_ERR "unable to remap resource 0x%lx\n",
dev_err(&pci->dev, "unable to remap resource 0x%lx\n",
mgr->mem[i].phys);
snd_mixart_free(mgr);
return -EBUSY;
@ -1267,7 +1305,7 @@ static int snd_mixart_probe(struct pci_dev *pci,
if (request_irq(pci->irq, snd_mixart_interrupt, IRQF_SHARED,
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);
snd_mixart_free(mgr);
return -EBUSY;
}
@ -1310,7 +1348,7 @@ static int snd_mixart_probe(struct pci_dev *pci,
0, &card);
if (err < 0) {
snd_printk(KERN_ERR "cannot allocate the card %d\n", i);
dev_err(&pci->dev, "cannot allocate the card %d\n", i);
snd_mixart_free(mgr);
return err;
}

View file

@ -22,6 +22,7 @@
#include <linux/interrupt.h>
#include <linux/mutex.h>
#include <linux/pci.h>
#include <asm/io.h>
#include <sound/core.h>
@ -94,7 +95,8 @@ static int get_msg(struct mixart_mgr *mgr, struct mixart_msg *resp,
if( (size < MSG_DESCRIPTOR_SIZE) || (resp->size < (size - MSG_DESCRIPTOR_SIZE))) {
err = -EINVAL;
snd_printk(KERN_ERR "problem with response size = %d\n", size);
dev_err(&mgr->pci->dev,
"problem with response size = %d\n", size);
goto _clean_exit;
}
size -= MSG_DESCRIPTOR_SIZE;
@ -161,7 +163,7 @@ static int send_msg( struct mixart_mgr *mgr,
headptr = readl_be(MIXART_MEM(mgr, MSG_INBOUND_FREE_HEAD));
if (tailptr == headptr) {
snd_printk(KERN_ERR "error: no message frame available\n");
dev_err(&mgr->pci->dev, "error: no message frame available\n");
return -EBUSY;
}
@ -265,7 +267,8 @@ int snd_mixart_send_msg(struct mixart_mgr *mgr, struct mixart_msg *request, int
if (! timeout) {
/* error - no ack */
mutex_unlock(&mgr->msg_mutex);
snd_printk(KERN_ERR "error: no response on msg %x\n", msg_frame);
dev_err(&mgr->pci->dev,
"error: no response on msg %x\n", msg_frame);
return -EIO;
}
@ -278,7 +281,7 @@ int snd_mixart_send_msg(struct mixart_mgr *mgr, struct mixart_msg *request, int
err = get_msg(mgr, &resp, msg_frame);
if( request->message_id != resp.message_id )
snd_printk(KERN_ERR "RESPONSE ERROR!\n");
dev_err(&mgr->pci->dev, "RESPONSE ERROR!\n");
mutex_unlock(&mgr->msg_mutex);
return err;
@ -321,7 +324,8 @@ int snd_mixart_send_msg_wait_notif(struct mixart_mgr *mgr,
if (! timeout) {
/* error - no ack */
mutex_unlock(&mgr->msg_mutex);
snd_printk(KERN_ERR "error: notification %x not received\n", notif_event);
dev_err(&mgr->pci->dev,
"error: notification %x not received\n", notif_event);
return -EIO;
}
@ -378,7 +382,9 @@ void snd_mixart_msg_tasklet(unsigned long arg)
resp.size = sizeof(mixart_msg_data);
err = get_msg(mgr, &resp, addr);
if( err < 0 ) {
snd_printk(KERN_ERR "tasklet: error(%d) reading mf %x\n", err, msg);
dev_err(&mgr->pci->dev,
"tasklet: error(%d) reading mf %x\n",
err, msg);
break;
}
@ -388,10 +394,13 @@ void snd_mixart_msg_tasklet(unsigned long arg)
case MSG_STREAM_STOP_INPUT_STAGE_PACKET:
case MSG_STREAM_STOP_OUTPUT_STAGE_PACKET:
if(mixart_msg_data[0])
snd_printk(KERN_ERR "tasklet : error MSG_STREAM_ST***_***PUT_STAGE_PACKET status=%x\n", mixart_msg_data[0]);
dev_err(&mgr->pci->dev,
"tasklet : error MSG_STREAM_ST***_***PUT_STAGE_PACKET status=%x\n",
mixart_msg_data[0]);
break;
default:
snd_printdd("tasklet received mf(%x) : msg_id(%x) uid(%x, %x) size(%zd)\n",
dev_dbg(&mgr->pci->dev,
"tasklet received mf(%x) : msg_id(%x) uid(%x, %x) size(%zd)\n",
msg, resp.message_id, resp.uid.object_id, resp.uid.desc, resp.size);
break;
}
@ -401,7 +410,9 @@ void snd_mixart_msg_tasklet(unsigned long arg)
case MSG_TYPE_COMMAND:
/* get_msg() necessary */
default:
snd_printk(KERN_ERR "tasklet doesn't know what to do with message %x\n", msg);
dev_err(&mgr->pci->dev,
"tasklet doesn't know what to do with message %x\n",
msg);
} /* switch type */
/* decrement counter */
@ -451,7 +462,9 @@ irqreturn_t snd_mixart_interrupt(int irq, void *dev_id)
resp.size = sizeof(mixart_msg_data);
err = get_msg(mgr, &resp, msg & ~MSG_TYPE_MASK);
if( err < 0 ) {
snd_printk(KERN_ERR "interrupt: error(%d) reading mf %x\n", err, msg);
dev_err(&mgr->pci->dev,
"interrupt: error(%d) reading mf %x\n",
err, msg);
break;
}
@ -472,7 +485,8 @@ irqreturn_t snd_mixart_interrupt(int irq, void *dev_id)
struct mixart_stream *stream;
if ((chip_number >= mgr->num_cards) || (pcm_number >= MIXART_PCM_TOTAL) || (sub_number >= MIXART_PLAYBACK_STREAMS)) {
snd_printk(KERN_ERR "error MSG_SERVICES_TIMER_NOTIFY buffer_id (%x) pos(%d)\n",
dev_err(&mgr->pci->dev,
"error MSG_SERVICES_TIMER_NOTIFY buffer_id (%x) pos(%d)\n",
buffer_id, notify->streams[i].sample_pos_low_part);
break;
}
@ -524,18 +538,22 @@ irqreturn_t snd_mixart_interrupt(int irq, void *dev_id)
}
#endif
((char*)mixart_msg_data)[resp.size - 1] = 0;
snd_printdd("MIXART TRACE : %s\n", (char*)mixart_msg_data);
dev_dbg(&mgr->pci->dev,
"MIXART TRACE : %s\n",
(char *)mixart_msg_data);
}
break;
}
snd_printdd("command %x not handled\n", resp.message_id);
dev_dbg(&mgr->pci->dev, "command %x not handled\n",
resp.message_id);
break;
case MSG_TYPE_NOTIFY:
if(msg & MSG_CANCEL_NOTIFY_MASK) {
msg &= ~MSG_CANCEL_NOTIFY_MASK;
snd_printk(KERN_ERR "canceled notification %x !\n", msg);
dev_err(&mgr->pci->dev,
"canceled notification %x !\n", msg);
}
/* no break, continue ! */
case MSG_TYPE_ANSWER:
@ -556,7 +574,8 @@ irqreturn_t snd_mixart_interrupt(int irq, void *dev_id)
break;
case MSG_TYPE_REQUEST:
default:
snd_printdd("interrupt received request %x\n", msg);
dev_dbg(&mgr->pci->dev,
"interrupt received request %x\n", msg);
/* TODO : are there things to do here ? */
break;
} /* switch on msg type */

View file

@ -165,7 +165,8 @@ static int mixart_enum_connectors(struct mixart_mgr *mgr)
err = snd_mixart_send_msg(mgr, &request, sizeof(*connector), connector);
if((err < 0) || (connector->error_code) || (connector->uid_count > MIXART_MAX_PHYS_CONNECTORS)) {
snd_printk(KERN_ERR "error MSG_SYSTEM_ENUM_PLAY_CONNECTOR\n");
dev_err(&mgr->pci->dev,
"error MSG_SYSTEM_ENUM_PLAY_CONNECTOR\n");
err = -EINVAL;
goto __error;
}
@ -184,7 +185,7 @@ static int mixart_enum_connectors(struct mixart_mgr *mgr)
pipe->uid_left_connector = connector->uid[k]; /* even */
}
/* snd_printk(KERN_DEBUG "playback connector[%d].object_id = %x\n", k, connector->uid[k].object_id); */
/* dev_dbg(&mgr->pci->dev, "playback connector[%d].object_id = %x\n", k, connector->uid[k].object_id); */
/* TODO: really need send_msg MSG_CONNECTOR_GET_AUDIO_INFO for each connector ? perhaps for analog level caps ? */
request.message_id = MSG_CONNECTOR_GET_AUDIO_INFO;
@ -194,10 +195,11 @@ static int mixart_enum_connectors(struct mixart_mgr *mgr)
err = snd_mixart_send_msg(mgr, &request, sizeof(*audio_info), audio_info);
if( err < 0 ) {
snd_printk(KERN_ERR "error MSG_CONNECTOR_GET_AUDIO_INFO\n");
dev_err(&mgr->pci->dev,
"error MSG_CONNECTOR_GET_AUDIO_INFO\n");
goto __error;
}
/*snd_printk(KERN_DEBUG "play analog_info.analog_level_present = %x\n", audio_info->info.analog_info.analog_level_present);*/
/*dev_dbg(&mgr->pci->dev, "play analog_info.analog_level_present = %x\n", audio_info->info.analog_info.analog_level_present);*/
}
request.message_id = MSG_SYSTEM_ENUM_RECORD_CONNECTOR;
@ -207,7 +209,8 @@ static int mixart_enum_connectors(struct mixart_mgr *mgr)
err = snd_mixart_send_msg(mgr, &request, sizeof(*connector), connector);
if((err < 0) || (connector->error_code) || (connector->uid_count > MIXART_MAX_PHYS_CONNECTORS)) {
snd_printk(KERN_ERR "error MSG_SYSTEM_ENUM_RECORD_CONNECTOR\n");
dev_err(&mgr->pci->dev,
"error MSG_SYSTEM_ENUM_RECORD_CONNECTOR\n");
err = -EINVAL;
goto __error;
}
@ -226,7 +229,7 @@ static int mixart_enum_connectors(struct mixart_mgr *mgr)
pipe->uid_left_connector = connector->uid[k]; /* even */
}
/* snd_printk(KERN_DEBUG "capture connector[%d].object_id = %x\n", k, connector->uid[k].object_id); */
/* dev_dbg(&mgr->pci->dev, "capture connector[%d].object_id = %x\n", k, connector->uid[k].object_id); */
/* TODO: really need send_msg MSG_CONNECTOR_GET_AUDIO_INFO for each connector ? perhaps for analog level caps ? */
request.message_id = MSG_CONNECTOR_GET_AUDIO_INFO;
@ -236,10 +239,11 @@ static int mixart_enum_connectors(struct mixart_mgr *mgr)
err = snd_mixart_send_msg(mgr, &request, sizeof(*audio_info), audio_info);
if( err < 0 ) {
snd_printk(KERN_ERR "error MSG_CONNECTOR_GET_AUDIO_INFO\n");
dev_err(&mgr->pci->dev,
"error MSG_CONNECTOR_GET_AUDIO_INFO\n");
goto __error;
}
/*snd_printk(KERN_DEBUG "rec analog_info.analog_level_present = %x\n", audio_info->info.analog_info.analog_level_present);*/
/*dev_dbg(&mgr->pci->dev, "rec analog_info.analog_level_present = %x\n", audio_info->info.analog_info.analog_level_present);*/
}
err = 0;
@ -272,7 +276,9 @@ static int mixart_enum_physio(struct mixart_mgr *mgr)
err = snd_mixart_send_msg(mgr, &request, sizeof(console_mgr), &console_mgr);
if( (err < 0) || (console_mgr.error_code != 0) ) {
snd_printk(KERN_DEBUG "error MSG_CONSOLE_GET_CLOCK_UID : err=%x\n", console_mgr.error_code);
dev_dbg(&mgr->pci->dev,
"error MSG_CONSOLE_GET_CLOCK_UID : err=%x\n",
console_mgr.error_code);
return -EINVAL;
}
@ -286,7 +292,9 @@ static int mixart_enum_physio(struct mixart_mgr *mgr)
err = snd_mixart_send_msg(mgr, &request, sizeof(phys_io), &phys_io);
if( (err < 0) || ( phys_io.error_code != 0 ) ) {
snd_printk(KERN_ERR "error MSG_SYSTEM_ENUM_PHYSICAL_IO err(%x) error_code(%x)\n", err, phys_io.error_code );
dev_err(&mgr->pci->dev,
"error MSG_SYSTEM_ENUM_PHYSICAL_IO err(%x) error_code(%x)\n",
err, phys_io.error_code);
return -EINVAL;
}
@ -322,7 +330,7 @@ static int mixart_first_init(struct mixart_mgr *mgr)
/* this command has no data. response is a 32 bit status */
err = snd_mixart_send_msg(mgr, &request, sizeof(k), &k);
if( (err < 0) || (k != 0) ) {
snd_printk(KERN_ERR "error MSG_SYSTEM_SEND_SYNCHRO_CMD\n");
dev_err(&mgr->pci->dev, "error MSG_SYSTEM_SEND_SYNCHRO_CMD\n");
return err == 0 ? -EINVAL : err;
}
@ -348,7 +356,7 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
/* motherboard xilinx status 5 will say that the board is performing a reset */
if (status_xilinx == 5) {
snd_printk(KERN_ERR "miXart is resetting !\n");
dev_err(&mgr->pci->dev, "miXart is resetting !\n");
return -EAGAIN; /* try again later */
}
@ -357,12 +365,13 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
/* xilinx already loaded ? */
if (status_xilinx == 4) {
snd_printk(KERN_DEBUG "xilinx is already loaded !\n");
dev_dbg(&mgr->pci->dev, "xilinx is already loaded !\n");
return 0;
}
/* the status should be 0 == "idle" */
if (status_xilinx != 0) {
snd_printk(KERN_ERR "xilinx load error ! status = %d\n",
dev_err(&mgr->pci->dev,
"xilinx load error ! status = %d\n",
status_xilinx);
return -EIO; /* modprob -r may help ? */
}
@ -393,13 +402,14 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
case MIXART_MOTHERBOARD_ELF_INDEX:
if (status_elf == 4) {
snd_printk(KERN_DEBUG "elf file already loaded !\n");
dev_dbg(&mgr->pci->dev, "elf file already loaded !\n");
return 0;
}
/* the status should be 0 == "idle" */
if (status_elf != 0) {
snd_printk(KERN_ERR "elf load error ! status = %d\n",
dev_err(&mgr->pci->dev,
"elf load error ! status = %d\n",
status_elf);
return -EIO; /* modprob -r may help ? */
}
@ -407,7 +417,7 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
/* wait for xilinx status == 4 */
err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_MXLX_STATUS_OFFSET, 1, 4, 500); /* 5sec */
if (err < 0) {
snd_printk(KERN_ERR "xilinx was not loaded or "
dev_err(&mgr->pci->dev, "xilinx was not loaded or "
"could not be started\n");
return err;
}
@ -429,7 +439,7 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
/* wait for elf status == 4 */
err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_ELF_STATUS_OFFSET, 1, 4, 300); /* 3sec */
if (err < 0) {
snd_printk(KERN_ERR "elf could not be started\n");
dev_err(&mgr->pci->dev, "elf could not be started\n");
return err;
}
@ -443,7 +453,7 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
/* elf and xilinx should be loaded */
if (status_elf != 4 || status_xilinx != 4) {
printk(KERN_ERR "xilinx or elf not "
dev_err(&mgr->pci->dev, "xilinx or elf not "
"successfully loaded\n");
return -EIO; /* modprob -r may help ? */
}
@ -451,7 +461,7 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
/* wait for daughter detection != 0 */
err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_DBRD_PRESENCE_OFFSET, 0, 0, 30); /* 300msec */
if (err < 0) {
snd_printk(KERN_ERR "error starting elf file\n");
dev_err(&mgr->pci->dev, "error starting elf file\n");
return err;
}
@ -467,7 +477,8 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
/* daughter should be idle */
if (status_daught != 0) {
printk(KERN_ERR "daughter load error ! status = %d\n",
dev_err(&mgr->pci->dev,
"daughter load error ! status = %d\n",
status_daught);
return -EIO; /* modprob -r may help ? */
}
@ -487,7 +498,7 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
/* wait for status == 2 */
err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_DXLX_STATUS_OFFSET, 1, 2, 30); /* 300msec */
if (err < 0) {
snd_printk(KERN_ERR "daughter board load error\n");
dev_err(&mgr->pci->dev, "daughter board load error\n");
return err;
}
@ -509,7 +520,7 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
/* wait for daughter status == 3 */
err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_DXLX_STATUS_OFFSET, 1, 3, 300); /* 3sec */
if (err < 0) {
snd_printk(KERN_ERR
dev_err(&mgr->pci->dev,
"daughter board could not be initialised\n");
return err;
}
@ -520,7 +531,7 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
/* first communication with embedded */
err = mixart_first_init(mgr);
if (err < 0) {
snd_printk(KERN_ERR "miXart could not be set up\n");
dev_err(&mgr->pci->dev, "miXart could not be set up\n");
return err;
}
@ -540,7 +551,8 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
return err;
}
snd_printdd("miXart firmware downloaded and successfully set up\n");
dev_dbg(&mgr->pci->dev,
"miXart firmware downloaded and successfully set up\n");
return 0;
}
@ -559,7 +571,8 @@ int snd_mixart_setup_firmware(struct mixart_mgr *mgr)
for (i = 0; i < 3; i++) {
sprintf(path, "mixart/%s", fw_files[i]);
if (request_firmware(&fw_entry, path, &mgr->pci->dev)) {
snd_printk(KERN_ERR "miXart: can't load firmware %s\n", path);
dev_err(&mgr->pci->dev,
"miXart: can't load firmware %s\n", path);
return -ENOENT;
}
/* fake hwdep dsp record */

View file

@ -329,7 +329,9 @@ static int mixart_update_analog_audio_level(struct snd_mixart* chip, int is_capt
err = snd_mixart_send_msg(chip->mgr, &request, sizeof(resp), &resp);
if((err<0) || (resp.error_code)) {
snd_printk(KERN_DEBUG "error MSG_PHYSICALIO_SET_LEVEL card(%d) is_capture(%d) error_code(%x)\n", chip->chip_idx, is_capture, resp.error_code);
dev_dbg(chip->card->dev,
"error MSG_PHYSICALIO_SET_LEVEL card(%d) is_capture(%d) error_code(%x)\n",
chip->chip_idx, is_capture, resp.error_code);
return -EINVAL;
}
return 0;
@ -762,7 +764,9 @@ int mixart_update_playback_stream_level(struct snd_mixart* chip, int is_aes, int
err = snd_mixart_send_msg(chip->mgr, &request, sizeof(status), &status);
if((err<0) || status) {
snd_printk(KERN_DEBUG "error MSG_STREAM_SET_OUT_STREAM_LEVEL card(%d) status(%x)\n", chip->chip_idx, status);
dev_dbg(chip->card->dev,
"error MSG_STREAM_SET_OUT_STREAM_LEVEL card(%d) status(%x)\n",
chip->chip_idx, status);
return -EINVAL;
}
return 0;
@ -805,7 +809,9 @@ int mixart_update_capture_stream_level(struct snd_mixart* chip, int is_aes)
err = snd_mixart_send_msg(chip->mgr, &request, sizeof(status), &status);
if((err<0) || status) {
snd_printk(KERN_DEBUG "error MSG_STREAM_SET_IN_AUDIO_LEVEL card(%d) status(%x)\n", chip->chip_idx, status);
dev_dbg(chip->card->dev,
"error MSG_STREAM_SET_IN_AUDIO_LEVEL card(%d) status(%x)\n",
chip->chip_idx, status);
return -EINVAL;
}
return 0;
@ -977,7 +983,9 @@ static int mixart_update_monitoring(struct snd_mixart* chip, int channel)
err = snd_mixart_send_msg(chip->mgr, &request, sizeof(resp), &resp);
if((err<0) || resp) {
snd_printk(KERN_DEBUG "error MSG_CONNECTOR_SET_OUT_AUDIO_LEVEL card(%d) resp(%x)\n", chip->chip_idx, resp);
dev_dbg(chip->card->dev,
"error MSG_CONNECTOR_SET_OUT_AUDIO_LEVEL card(%d) resp(%x)\n",
chip->chip_idx, resp);
return -EINVAL;
}
return 0;