aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/emu10k1/p16v.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-02-05 10:08:14 -0500
committerTakashi Iwai <tiwai@suse.de>2009-02-05 10:08:14 -0500
commit28a97c194cec477073ae341f15b836437d8ef8e5 (patch)
tree9b6aef945d6356ec562d7ab2d2d533218969265d /sound/pci/emu10k1/p16v.c
parent18e352e4a73465349711a9324767e1b2453383e2 (diff)
ALSA: emu10k1 - Add missing KERN_* prefix to printk
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/emu10k1/p16v.c')
-rw-r--r--sound/pci/emu10k1/p16v.c100
1 files changed, 73 insertions, 27 deletions
diff --git a/sound/pci/emu10k1/p16v.c b/sound/pci/emu10k1/p16v.c
index 749a21b6bd06..e617acaf10e3 100644
--- a/sound/pci/emu10k1/p16v.c
+++ b/sound/pci/emu10k1/p16v.c
@@ -168,7 +168,7 @@ static void snd_p16v_pcm_free_substream(struct snd_pcm_runtime *runtime)
168 struct snd_emu10k1_pcm *epcm = runtime->private_data; 168 struct snd_emu10k1_pcm *epcm = runtime->private_data;
169 169
170 if (epcm) { 170 if (epcm) {
171 //snd_printk("epcm free: %p\n", epcm); 171 /* snd_printk(KERN_DEBUG "epcm free: %p\n", epcm); */
172 kfree(epcm); 172 kfree(epcm);
173 } 173 }
174} 174}
@@ -183,14 +183,16 @@ static int snd_p16v_pcm_open_playback_channel(struct snd_pcm_substream *substrea
183 int err; 183 int err;
184 184
185 epcm = kzalloc(sizeof(*epcm), GFP_KERNEL); 185 epcm = kzalloc(sizeof(*epcm), GFP_KERNEL);
186 //snd_printk("epcm kcalloc: %p\n", epcm); 186 /* snd_printk(KERN_DEBUG "epcm kcalloc: %p\n", epcm); */
187 187
188 if (epcm == NULL) 188 if (epcm == NULL)
189 return -ENOMEM; 189 return -ENOMEM;
190 epcm->emu = emu; 190 epcm->emu = emu;
191 epcm->substream = substream; 191 epcm->substream = substream;
192 //snd_printk("epcm device=%d, channel_id=%d\n", substream->pcm->device, channel_id); 192 /*
193 193 snd_printk(KERN_DEBUG "epcm device=%d, channel_id=%d\n",
194 substream->pcm->device, channel_id);
195 */
194 runtime->private_data = epcm; 196 runtime->private_data = epcm;
195 runtime->private_free = snd_p16v_pcm_free_substream; 197 runtime->private_free = snd_p16v_pcm_free_substream;
196 198
@@ -200,10 +202,15 @@ static int snd_p16v_pcm_open_playback_channel(struct snd_pcm_substream *substrea
200 channel->number = channel_id; 202 channel->number = channel_id;
201 203
202 channel->use=1; 204 channel->use=1;
203 //snd_printk("p16v: open channel_id=%d, channel=%p, use=0x%x\n", channel_id, channel, channel->use); 205#if 0 /* debug */
204 //printk("open:channel_id=%d, chip=%p, channel=%p\n",channel_id, chip, channel); 206 snd_printk(KERN_DEBUG
205 //channel->interrupt = snd_p16v_pcm_channel_interrupt; 207 "p16v: open channel_id=%d, channel=%p, use=0x%x\n",
206 channel->epcm=epcm; 208 channel_id, channel, channel->use);
209 printk(KERN_DEBUG "open:channel_id=%d, chip=%p, channel=%p\n",
210 channel_id, chip, channel);
211#endif /* debug */
212 /* channel->interrupt = snd_p16v_pcm_channel_interrupt; */
213 channel->epcm = epcm;
207 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) 214 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
208 return err; 215 return err;
209 216
@@ -224,14 +231,16 @@ static int snd_p16v_pcm_open_capture_channel(struct snd_pcm_substream *substream
224 int err; 231 int err;
225 232
226 epcm = kzalloc(sizeof(*epcm), GFP_KERNEL); 233 epcm = kzalloc(sizeof(*epcm), GFP_KERNEL);
227 //snd_printk("epcm kcalloc: %p\n", epcm); 234 /* snd_printk(KERN_DEBUG "epcm kcalloc: %p\n", epcm); */
228 235
229 if (epcm == NULL) 236 if (epcm == NULL)
230 return -ENOMEM; 237 return -ENOMEM;
231 epcm->emu = emu; 238 epcm->emu = emu;
232 epcm->substream = substream; 239 epcm->substream = substream;
233 //snd_printk("epcm device=%d, channel_id=%d\n", substream->pcm->device, channel_id); 240 /*
234 241 snd_printk(KERN_DEBUG "epcm device=%d, channel_id=%d\n",
242 substream->pcm->device, channel_id);
243 */
235 runtime->private_data = epcm; 244 runtime->private_data = epcm;
236 runtime->private_free = snd_p16v_pcm_free_substream; 245 runtime->private_free = snd_p16v_pcm_free_substream;
237 246
@@ -241,10 +250,15 @@ static int snd_p16v_pcm_open_capture_channel(struct snd_pcm_substream *substream
241 channel->number = channel_id; 250 channel->number = channel_id;
242 251
243 channel->use=1; 252 channel->use=1;
244 //snd_printk("p16v: open channel_id=%d, channel=%p, use=0x%x\n", channel_id, channel, channel->use); 253#if 0 /* debug */
245 //printk("open:channel_id=%d, chip=%p, channel=%p\n",channel_id, chip, channel); 254 snd_printk(KERN_DEBUG
246 //channel->interrupt = snd_p16v_pcm_channel_interrupt; 255 "p16v: open channel_id=%d, channel=%p, use=0x%x\n",
247 channel->epcm=epcm; 256 channel_id, channel, channel->use);
257 printk(KERN_DEBUG "open:channel_id=%d, chip=%p, channel=%p\n",
258 channel_id, chip, channel);
259#endif /* debug */
260 /* channel->interrupt = snd_p16v_pcm_channel_interrupt; */
261 channel->epcm = epcm;
248 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) 262 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
249 return err; 263 return err;
250 264
@@ -334,9 +348,19 @@ static int snd_p16v_pcm_prepare_playback(struct snd_pcm_substream *substream)
334 int i; 348 int i;
335 u32 tmp; 349 u32 tmp;
336 350
337 //snd_printk("prepare:channel_number=%d, rate=%d, format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, periods=%u, frames_to_bytes=%d\n",channel, runtime->rate, runtime->format, runtime->channels, runtime->buffer_size, runtime->period_size, runtime->periods, frames_to_bytes(runtime, 1)); 351#if 0 /* debug */
338 //snd_printk("dma_addr=%x, dma_area=%p, table_base=%p\n",runtime->dma_addr, runtime->dma_area, table_base); 352 snd_printk(KERN_DEBUG "prepare:channel_number=%d, rate=%d, "
339 //snd_printk("dma_addr=%x, dma_area=%p, dma_bytes(size)=%x\n",emu->p16v_buffer.addr, emu->p16v_buffer.area, emu->p16v_buffer.bytes); 353 "format=0x%x, channels=%d, buffer_size=%ld, "
354 "period_size=%ld, periods=%u, frames_to_bytes=%d\n",
355 channel, runtime->rate, runtime->format, runtime->channels,
356 runtime->buffer_size, runtime->period_size,
357 runtime->periods, frames_to_bytes(runtime, 1));
358 snd_printk(KERN_DEBUG "dma_addr=%x, dma_area=%p, table_base=%p\n",
359 runtime->dma_addr, runtime->dma_area, table_base);
360 snd_printk(KERN_DEBUG "dma_addr=%x, dma_area=%p, dma_bytes(size)=%x\n",
361 emu->p16v_buffer.addr, emu->p16v_buffer.area,
362 emu->p16v_buffer.bytes);
363#endif /* debug */
340 tmp = snd_emu10k1_ptr_read(emu, A_SPDIF_SAMPLERATE, channel); 364 tmp = snd_emu10k1_ptr_read(emu, A_SPDIF_SAMPLERATE, channel);
341 switch (runtime->rate) { 365 switch (runtime->rate) {
342 case 44100: 366 case 44100:
@@ -379,7 +403,15 @@ static int snd_p16v_pcm_prepare_capture(struct snd_pcm_substream *substream)
379 struct snd_pcm_runtime *runtime = substream->runtime; 403 struct snd_pcm_runtime *runtime = substream->runtime;
380 int channel = substream->pcm->device - emu->p16v_device_offset; 404 int channel = substream->pcm->device - emu->p16v_device_offset;
381 u32 tmp; 405 u32 tmp;
382 //printk("prepare capture:channel_number=%d, rate=%d, format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, frames_to_bytes=%d\n",channel, runtime->rate, runtime->format, runtime->channels, runtime->buffer_size, runtime->period_size, frames_to_bytes(runtime, 1)); 406
407 /*
408 printk(KERN_DEBUG "prepare capture:channel_number=%d, rate=%d, "
409 "format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, "
410 "frames_to_bytes=%d\n",
411 channel, runtime->rate, runtime->format, runtime->channels,
412 runtime->buffer_size, runtime->period_size,
413 frames_to_bytes(runtime, 1));
414 */
383 tmp = snd_emu10k1_ptr_read(emu, A_SPDIF_SAMPLERATE, channel); 415 tmp = snd_emu10k1_ptr_read(emu, A_SPDIF_SAMPLERATE, channel);
384 switch (runtime->rate) { 416 switch (runtime->rate) {
385 case 44100: 417 case 44100:
@@ -459,13 +491,13 @@ static int snd_p16v_pcm_trigger_playback(struct snd_pcm_substream *substream,
459 runtime = s->runtime; 491 runtime = s->runtime;
460 epcm = runtime->private_data; 492 epcm = runtime->private_data;
461 channel = substream->pcm->device-emu->p16v_device_offset; 493 channel = substream->pcm->device-emu->p16v_device_offset;
462 //snd_printk("p16v channel=%d\n",channel); 494 /* snd_printk(KERN_DEBUG "p16v channel=%d\n", channel); */
463 epcm->running = running; 495 epcm->running = running;
464 basic |= (0x1<<channel); 496 basic |= (0x1<<channel);
465 inte |= (INTE2_PLAYBACK_CH_0_LOOP<<channel); 497 inte |= (INTE2_PLAYBACK_CH_0_LOOP<<channel);
466 snd_pcm_trigger_done(s, substream); 498 snd_pcm_trigger_done(s, substream);
467 } 499 }
468 //snd_printk("basic=0x%x, inte=0x%x\n",basic, inte); 500 /* snd_printk(KERN_DEBUG "basic=0x%x, inte=0x%x\n", basic, inte); */
469 501
470 switch (cmd) { 502 switch (cmd) {
471 case SNDRV_PCM_TRIGGER_START: 503 case SNDRV_PCM_TRIGGER_START:
@@ -558,8 +590,13 @@ snd_p16v_pcm_pointer_capture(struct snd_pcm_substream *substream)
558 ptr -= runtime->buffer_size; 590 ptr -= runtime->buffer_size;
559 printk(KERN_WARNING "buffer capture limited!\n"); 591 printk(KERN_WARNING "buffer capture limited!\n");
560 } 592 }
561 //printk("ptr1 = 0x%lx, ptr2=0x%lx, ptr=0x%lx, buffer_size = 0x%x, period_size = 0x%x, bits=%d, rate=%d\n", ptr1, ptr2, ptr, (int)runtime->buffer_size, (int)runtime->period_size, (int)runtime->frame_bits, (int)runtime->rate); 593 /*
562 594 printk(KERN_DEBUG "ptr1 = 0x%lx, ptr2=0x%lx, ptr=0x%lx, "
595 "buffer_size = 0x%x, period_size = 0x%x, bits=%d, rate=%d\n",
596 ptr1, ptr2, ptr, (int)runtime->buffer_size,
597 (int)runtime->period_size, (int)runtime->frame_bits,
598 (int)runtime->rate);
599 */
563 return ptr; 600 return ptr;
564} 601}
565 602
@@ -592,7 +629,10 @@ int snd_p16v_free(struct snd_emu10k1 *chip)
592 // release the data 629 // release the data
593 if (chip->p16v_buffer.area) { 630 if (chip->p16v_buffer.area) {
594 snd_dma_free_pages(&chip->p16v_buffer); 631 snd_dma_free_pages(&chip->p16v_buffer);
595 //snd_printk("period lables free: %p\n", &chip->p16v_buffer); 632 /*
633 snd_printk(KERN_DEBUG "period lables free: %p\n",
634 &chip->p16v_buffer);
635 */
596 } 636 }
597 return 0; 637 return 0;
598} 638}
@@ -604,7 +644,7 @@ int __devinit snd_p16v_pcm(struct snd_emu10k1 *emu, int device, struct snd_pcm *
604 int err; 644 int err;
605 int capture=1; 645 int capture=1;
606 646
607 //snd_printk("snd_p16v_pcm called. device=%d\n", device); 647 /* snd_printk("KERN_DEBUG snd_p16v_pcm called. device=%d\n", device); */
608 emu->p16v_device_offset = device; 648 emu->p16v_device_offset = device;
609 if (rpcm) 649 if (rpcm)
610 *rpcm = NULL; 650 *rpcm = NULL;
@@ -631,7 +671,10 @@ int __devinit snd_p16v_pcm(struct snd_emu10k1 *emu, int device, struct snd_pcm *
631 snd_dma_pci_data(emu->pci), 671 snd_dma_pci_data(emu->pci),
632 ((65536 - 64) * 8), ((65536 - 64) * 8))) < 0) 672 ((65536 - 64) * 8), ((65536 - 64) * 8))) < 0)
633 return err; 673 return err;
634 //snd_printk("preallocate playback substream: err=%d\n", err); 674 /*
675 snd_printk(KERN_DEBUG
676 "preallocate playback substream: err=%d\n", err);
677 */
635 } 678 }
636 679
637 for (substream = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream; 680 for (substream = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream;
@@ -642,7 +685,10 @@ int __devinit snd_p16v_pcm(struct snd_emu10k1 *emu, int device, struct snd_pcm *
642 snd_dma_pci_data(emu->pci), 685 snd_dma_pci_data(emu->pci),
643 65536 - 64, 65536 - 64)) < 0) 686 65536 - 64, 65536 - 64)) < 0)
644 return err; 687 return err;
645 //snd_printk("preallocate capture substream: err=%d\n", err); 688 /*
689 snd_printk(KERN_DEBUG
690 "preallocate capture substream: err=%d\n", err);
691 */
646 } 692 }
647 693
648 if (rpcm) 694 if (rpcm)