diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2018-03-20 12:56:18 +0300 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2018-03-20 12:56:18 +0300 |
commit | edc39c9b4589a4ce9a69273b5a27a1459c3423d4 (patch) | |
tree | e5850fe4a533579b0de12c02e48f7dcdd60e8e38 /sound/soc/amd/acp-pcm-dma.c | |
parent | a06cc94f3f8dfab74fe7fac3a6e9f15d77566d00 (diff) | |
parent | 1b5f3ba415fe4cf8b8b39c8d104ed44cde330658 (diff) | |
download | linux-edc39c9b4589a4ce9a69273b5a27a1459c3423d4.tar.xz |
Merge branch 'linus' into x86/build to pick up dependencies
Diffstat (limited to 'sound/soc/amd/acp-pcm-dma.c')
-rw-r--r-- | sound/soc/amd/acp-pcm-dma.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c index c33a512283a4..9fb356db3ab2 100644 --- a/sound/soc/amd/acp-pcm-dma.c +++ b/sound/soc/amd/acp-pcm-dma.c @@ -579,13 +579,6 @@ static int acp_init(void __iomem *acp_mmio, u32 asic_type) for (bank = 1; bank < 48; bank++) acp_set_sram_bank_state(acp_mmio, bank, false); } - - /* Stoney supports 16bit resolution */ - if (asic_type == CHIP_STONEY) { - val = acp_reg_read(acp_mmio, mmACP_I2S_16BIT_RESOLUTION_EN); - val |= 0x03; - acp_reg_write(val, acp_mmio, mmACP_I2S_16BIT_RESOLUTION_EN); - } return 0; } @@ -774,6 +767,7 @@ static int acp_dma_hw_params(struct snd_pcm_substream *substream, { int status; uint64_t size; + u32 val = 0; struct page *pg; struct snd_pcm_runtime *runtime; struct audio_substream_data *rtd; @@ -786,6 +780,14 @@ static int acp_dma_hw_params(struct snd_pcm_substream *substream, if (WARN_ON(!rtd)) return -EINVAL; + if (adata->asic_type == CHIP_STONEY) { + val = acp_reg_read(adata->acp_mmio, mmACP_I2S_16BIT_RESOLUTION_EN); + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + val |= ACP_I2S_SP_16BIT_RESOLUTION_EN; + else + val |= ACP_I2S_MIC_16BIT_RESOLUTION_EN; + acp_reg_write(val, adata->acp_mmio, mmACP_I2S_16BIT_RESOLUTION_EN); + } size = params_buffer_bytes(params); status = snd_pcm_lib_malloc_pages(substream, size); if (status < 0) |