@@ -567,28 +567,19 @@ static int
567
567
snd_harmony_hw_params (struct snd_pcm_substream * ss ,
568
568
struct snd_pcm_hw_params * hw )
569
569
{
570
- int err ;
571
570
struct snd_harmony * h = snd_pcm_substream_chip (ss );
572
571
573
- err = snd_pcm_lib_malloc_pages (ss , params_buffer_bytes (hw ));
574
- if (err > 0 && h -> dma .type == SNDRV_DMA_TYPE_CONTINUOUS )
572
+ if (h -> dma .type == SNDRV_DMA_TYPE_CONTINUOUS )
575
573
ss -> runtime -> dma_addr = __pa (ss -> runtime -> dma_area );
576
-
577
- return err ;
578
- }
579
574
580
- static int
581
- snd_harmony_hw_free (struct snd_pcm_substream * ss )
582
- {
583
- return snd_pcm_lib_free_pages (ss );
575
+ return 0 ;
584
576
}
585
577
586
578
static const struct snd_pcm_ops snd_harmony_playback_ops = {
587
579
.open = snd_harmony_playback_open ,
588
580
.close = snd_harmony_playback_close ,
589
581
.ioctl = snd_pcm_lib_ioctl ,
590
582
.hw_params = snd_harmony_hw_params ,
591
- .hw_free = snd_harmony_hw_free ,
592
583
.prepare = snd_harmony_playback_prepare ,
593
584
.trigger = snd_harmony_playback_trigger ,
594
585
.pointer = snd_harmony_playback_pointer ,
@@ -599,7 +590,6 @@ static const struct snd_pcm_ops snd_harmony_capture_ops = {
599
590
.close = snd_harmony_capture_close ,
600
591
.ioctl = snd_pcm_lib_ioctl ,
601
592
.hw_params = snd_harmony_hw_params ,
602
- .hw_free = snd_harmony_hw_free ,
603
593
.prepare = snd_harmony_capture_prepare ,
604
594
.trigger = snd_harmony_capture_trigger ,
605
595
.pointer = snd_harmony_capture_pointer ,
@@ -656,8 +646,8 @@ snd_harmony_pcm_init(struct snd_harmony *h)
656
646
}
657
647
658
648
/* pre-allocate space for DMA */
659
- snd_pcm_lib_preallocate_pages_for_all (pcm , h -> dma .type , h -> dma .dev ,
660
- MAX_BUF_SIZE , MAX_BUF_SIZE );
649
+ snd_pcm_set_managed_buffer_all (pcm , h -> dma .type , h -> dma .dev ,
650
+ MAX_BUF_SIZE , MAX_BUF_SIZE );
661
651
662
652
h -> st .format = snd_harmony_set_data_format (h ,
663
653
SNDRV_PCM_FORMAT_S16_BE , 1 );
0 commit comments