From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753423AbcD0OdX (ORCPT ); Wed, 27 Apr 2016 10:33:23 -0400 Received: from 212-186-180-163.dynamic.surfer.at ([212.186.180.163]:52295 "EHLO cgate.sperl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752755AbcD0OdV (ORCPT ); Wed, 27 Apr 2016 10:33:21 -0400 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: [PATCH 2/2] ASoC: bcm2835: Add S16_LE support via packed DMA transfers From: Martin Sperl In-Reply-To: <1461763613-28714-2-git-send-email-hias@horus.com> Date: Wed, 27 Apr 2016 16:33:14 +0200 Cc: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Stephen Warren , Lee Jones , Eric Anholt , Luis de Bethencourt , alsa-devel@alsa-project.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: 7bit Message-Id: <46CBACB0-97C6-4C41-A8A2-85176794FC91@martin.sperl.org> References: <1461763613-28714-1-git-send-email-hias@horus.com> <1461763613-28714-2-git-send-email-hias@horus.com> To: Matthias Reichl X-Mailer: Apple Mail (2.2104) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On 27.04.2016, at 15:26, Matthias Reichl wrote: > > The bcm2835-i2s driver already has support for the S16_LE format but > that format hasn't been made available because dmaengine_pcm didn't > support packed data transfers. > > bcm2835-i2s needs 16-bit left+right channel data to be packed into > a 32-bit word, the FIFO register is 32-bit only and doesn't support > 16-bit access. > > Now that dmaengine_pcm supports packed transfers the format can > be made available by setting the SND_DMAENGINE_PCM_DAI_FLAG_PACK flag. > > No further configuration is necessary: > - snd_dmaengine_dai_dma_data.addr_width is already set to > DMA_SLAVE_BUSWIDTH_4_BYTES to force 32-bit DMA transfers > - dmaengine_pcm will pick up the S16_LE format from the DAI > configuration and make it available since it's no longer > masked out due to the PACK flag. > - there are no further corner cases to catch in hw_params, > since the channel count is fixed at 2 we always have two > 16-bit stereo samples that can be transferred via 32-bit DMA > > Signed-off-by: Matthias Reichl Tested-by: Martin Sperl From mboxrd@z Thu Jan 1 00:00:00 1970 From: kernel@martin.sperl.org (Martin Sperl) Date: Wed, 27 Apr 2016 16:33:14 +0200 Subject: [PATCH 2/2] ASoC: bcm2835: Add S16_LE support via packed DMA transfers In-Reply-To: <1461763613-28714-2-git-send-email-hias@horus.com> References: <1461763613-28714-1-git-send-email-hias@horus.com> <1461763613-28714-2-git-send-email-hias@horus.com> Message-ID: <46CBACB0-97C6-4C41-A8A2-85176794FC91@martin.sperl.org> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org > On 27.04.2016, at 15:26, Matthias Reichl wrote: > > The bcm2835-i2s driver already has support for the S16_LE format but > that format hasn't been made available because dmaengine_pcm didn't > support packed data transfers. > > bcm2835-i2s needs 16-bit left+right channel data to be packed into > a 32-bit word, the FIFO register is 32-bit only and doesn't support > 16-bit access. > > Now that dmaengine_pcm supports packed transfers the format can > be made available by setting the SND_DMAENGINE_PCM_DAI_FLAG_PACK flag. > > No further configuration is necessary: > - snd_dmaengine_dai_dma_data.addr_width is already set to > DMA_SLAVE_BUSWIDTH_4_BYTES to force 32-bit DMA transfers > - dmaengine_pcm will pick up the S16_LE format from the DAI > configuration and make it available since it's no longer > masked out due to the PACK flag. > - there are no further corner cases to catch in hw_params, > since the channel count is fixed at 2 we always have two > 16-bit stereo samples that can be transferred via 32-bit DMA > > Signed-off-by: Matthias Reichl Tested-by: Martin Sperl