Merge tag 'dma-mapping-5.4' of git://git.infradead.org/users/hch/dma-mapping
[linux-2.6-block.git] / sound / core / pcm_native.c
index 703857aab00fc17e6ca667fdcaf27e94200bc84f..91c6ad58729fe7c8d6856a8f74b5ed547d19b179 100644 (file)
@@ -220,13 +220,12 @@ static bool hw_support_mmap(struct snd_pcm_substream *substream)
 {
        if (!(substream->runtime->hw.info & SNDRV_PCM_INFO_MMAP))
                return false;
-       /* architecture supports dma_mmap_coherent()? */
-#if defined(CONFIG_ARCH_NO_COHERENT_DMA_MMAP) || !defined(CONFIG_HAS_DMA)
-       if (!substream->ops->mmap &&
-           substream->dma_buffer.dev.type == SNDRV_DMA_TYPE_DEV)
-               return false;
-#endif
-       return true;
+
+       if (substream->ops->mmap ||
+           substream->dma_buffer.dev.type != SNDRV_DMA_TYPE_DEV)
+               return true;
+
+       return dma_can_mmap(substream->dma_buffer.dev.dev);
 }
 
 static int constrain_mask_params(struct snd_pcm_substream *substream,
@@ -2170,7 +2169,7 @@ static int snd_pcm_hw_rule_sample_bits(struct snd_pcm_hw_params *params,
 
 static const unsigned int rates[] = {
        5512, 8000, 11025, 16000, 22050, 32000, 44100,
-       48000, 64000, 88200, 96000, 176400, 192000
+       48000, 64000, 88200, 96000, 176400, 192000, 352800, 384000
 };
 
 const struct snd_pcm_hw_constraint_list snd_pcm_known_rates = {