From: Lars-Peter Clausen <lars@metafoo.de>
To: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>,
broonie@kernel.org, lgirdwood@gmail.com
Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org,
devicetree@vger.kernel.org
Subject: Re: [PATCH] ASoC: jz4740: Add jz4780 support
Date: Sat, 07 Mar 2015 09:21:36 +0100 [thread overview]
Message-ID: <54FAB510.90304@metafoo.de> (raw)
In-Reply-To: <1425655991-12468-1-git-send-email-Zubair.Kakakhel@imgtec.com>
On 03/06/2015 04:33 PM, Zubair Lutfullah Kakakhel wrote:
> The jz4780 and jz4740 have very similar i2s blocks.
>
> The slight difference is in Rx/Tx fifos.
> And the bitclocks for input/output are different.
>
> This patch adds jz4780 support to the driver
>
> Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Looks mostly good.
[...]
> static inline uint32_t jz4740_i2s_read(const struct jz4740_i2s *i2s,
> @@ -267,13 +283,22 @@ static int jz4740_i2s_hw_params(struct snd_pcm_substream *substream,
> ctrl |= JZ_AIC_CTRL_MONO_TO_STEREO;
> else
> ctrl &= ~JZ_AIC_CTRL_MONO_TO_STEREO;
> +
> + div_reg &= ~I2SDIV_DV_MASK;
> + div_reg |= (div - 1) << I2SDIV_DV_SHIFT;
> } else {
> ctrl &= ~JZ_AIC_CTRL_INPUT_SAMPLE_SIZE_MASK;
> ctrl |= sample_size << JZ_AIC_CTRL_INPUT_SAMPLE_SIZE_OFFSET;
> +
> + if (i2s->version >= JZ_I2S_JZ4780) {
> + div_reg &= ~I2SDIV_IDV_MASK;
> + div_reg |= (div - 1) << I2SDIV_IDV_SHIFT;
> + } else {
> + div_reg &= ~I2SDIV_DV_MASK;
> + div_reg |= (div - 1) << I2SDIV_DV_SHIFT;
> + }
> }
Given that the JZ4780 supports different rates for TX and RX in this
configuration you can also remove the symmetric_rates flag from the DAI
struct, so applications can actually make use of it.
>
> - div_reg &= ~I2SDIV_DV_MASK;
> - div_reg |= (div - 1) << I2SDIV_DV_SHIFT;
> jz4740_i2s_write(i2s, JZ_REG_AIC_CTRL, ctrl);
> jz4740_i2s_write(i2s, JZ_REG_AIC_CLK_DIV, div_reg);
>
[...]
> + if (i2s->version >= JZ_I2S_JZ4780)
> + return devm_snd_dmaengine_pcm_register(&pdev->dev, NULL,
> + SND_DMAENGINE_PCM_FLAG_NO_RESIDUE);
We should not be adding new users of SND_DMAENGINE_PCM_FLAG_NO_RESIDUE, this
is a property of the DMA controller/driver and the DMAengine framework now
has the capabilities to report on whether it supports residue reporting or not.
prev parent reply other threads:[~2015-03-07 8:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-06 15:33 [PATCH] ASoC: jz4740: Add jz4780 support Zubair Lutfullah Kakakhel
2015-03-07 8:21 ` Lars-Peter Clausen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54FAB510.90304@metafoo.de \
--to=lars@metafoo.de \
--cc=Zubair.Kakakhel@imgtec.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).