Skip to content

Commit

Permalink
ALSA: x86: Explicit specify 32bit DMA
Browse files Browse the repository at this point in the history
LPE audio is capable only up to 32bit address, as it seems.
Then we should limit the DMA addresses accordingly via dma-mapping
API.

Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tiwai committed Feb 5, 2017
1 parent c1a7c40 commit 412bbe7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sound/x86/intel_hdmi_audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/pm_runtime.h>
#include <linux/dma-mapping.h>
#include <asm/cacheflush.h>
#include <sound/core.h>
#include <sound/asoundef.h>
Expand Down Expand Up @@ -1825,8 +1826,6 @@ static int hdmi_lpe_audio_probe(struct platform_device *pdev)
struct resource *res_mmio;
int i, ret;

dev_dbg(&pdev->dev, "dma_mask: %p\n", pdev->dev.dma_mask);

pdata = pdev->dev.platform_data;
if (!pdata) {
dev_err(&pdev->dev, "%s: quit: pdata not allocated by i915!!\n", __func__);
Expand Down Expand Up @@ -1907,6 +1906,11 @@ static int hdmi_lpe_audio_probe(struct platform_device *pdev)
/* setup the ops for playabck */
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK,
&snd_intelhad_playback_ops);

/* only 32bit addressable */
dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));

/* allocate dma pages for ALSA stream operations
* memory allocated is based on size, not max value
* thus using same argument for max & size
Expand Down

0 comments on commit 412bbe7

Please sign in to comment.