Moved 16bit resolution condition check for stoney platform to acp_hw_params.Depending upon substream required register value need to be programmed rather than enabling 16bit resolution support all time in acp init.
Unified · Split
| @@ -579,13 +579,6 @@ static int acp_init(void __iomem *acp_mmio, u32 asic_type) · 578 unmodified lines | |||
| 579 | for (bank = 1; bank < 48; bank++) | 579 | for (bank = 1; bank < 48; bank++) |
| 580 | acp_set_sram_bank_state(acp_mmio, bank, false); | 580 | acp_set_sram_bank_state(acp_mmio, bank, false); |
| 581 | } | 581 | } |
| 582 | |||
| 583 | /* Stoney supports 16bit resolution */ | ||
| 584 | if (asic_type == CHIP_STONEY) { | ||
| 585 | val = acp_reg_read(acp_mmio, mmACP_I2S_16BIT_RESOLUTION_EN); | ||
| 586 | val |= 0x03; | ||
| 587 | acp_reg_write(val, acp_mmio, mmACP_I2S_16BIT_RESOLUTION_EN); | ||
| 588 | } | ||
| 589 | return 0; | 582 | return 0; |
| 590 | } | 583 | } |
| 591 | 584 | ||
| @@ -774,6 +767,7 @@ static int acp_dma_hw_params(struct snd_pcm_substream *substream, · 182 unmodified lines | |||
| 774 | { | 767 | { |
| 775 | int status; | 768 | int status; |
| 776 | uint64_t size; | 769 | uint64_t size; |
| 770 | u32 val = 0; | ||
| 777 | struct page *pg; | 771 | struct page *pg; |
| 778 | struct snd_pcm_runtime *runtime; | 772 | struct snd_pcm_runtime *runtime; |
| 779 | struct audio_substream_data *rtd; | 773 | struct audio_substream_data *rtd; |
| @@ -786,6 +780,14 @@ static int acp_dma_hw_params(struct snd_pcm_substream *substream, · 6 unmodified lines | |||
| 786 | if (WARN_ON(!rtd)) | 780 | if (WARN_ON(!rtd)) |
| 787 | return -EINVAL; | 781 | return -EINVAL; |
| 788 | 782 | ||
| 783 | if (adata->asic_type == CHIP_STONEY) { | ||
| 784 | val = acp_reg_read(adata->acp_mmio, mmACP_I2S_16BIT_RESOLUTION_EN); | ||
| 785 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) | ||
| 786 | val |= ACP_I2S_SP_16BIT_RESOLUTION_EN; | ||
| 787 | else | ||
| 788 | val |= ACP_I2S_MIC_16BIT_RESOLUTION_EN; | ||
| 789 | acp_reg_write(val, adata->acp_mmio, mmACP_I2S_16BIT_RESOLUTION_EN); | ||
| 790 | } | ||
| 789 | size = params_buffer_bytes(params); | 791 | size = params_buffer_bytes(params); |
| 790 | status = snd_pcm_lib_malloc_pages(substream, size); | 792 | status = snd_pcm_lib_malloc_pages(substream, size); |
| 791 | if (status < 0) | 793 | if (status < 0) |
| @@ -70,6 +70,8 @@ · 69 unmodified lines | |||
| 70 | #define CAPTURE_END_DMA_DESCR_CH15 7 | 70 | #define CAPTURE_END_DMA_DESCR_CH15 7 |
| 71 | 71 | ||
| 72 | #define mmACP_I2S_16BIT_RESOLUTION_EN 0x5209 | 72 | #define mmACP_I2S_16BIT_RESOLUTION_EN 0x5209 |
| 73 | #define ACP_I2S_MIC_16BIT_RESOLUTION_EN 0x01 | ||
| 74 | #define ACP_I2S_SP_16BIT_RESOLUTION_EN 0x02 | ||
| 73 | enum acp_dma_priority_level { | 75 | enum acp_dma_priority_level { |
| 74 | /* 0x0 Specifies the DMA channel is given normal priority */ | 76 | /* 0x0 Specifies the DMA channel is given normal priority */ |
| 75 | ACP_DMA_PRIORITY_LEVEL_NORMAL = 0x0, | 77 | ACP_DMA_PRIORITY_LEVEL_NORMAL = 0x0, |