From: Mark Brown <broonie@kernel.org>
To: maruthi srinivas <maruthi.srinivas.b@gmail.com>
Cc: alsa-devel@alsa-project.org, maruthi.bayyavarapu@amd.com,
tiwai@suse.de, lgirdwood@gmail.com,
dri-devel@lists.freedesktop.org,
Alex Deucher <alexander.deucher@amd.com>,
Alex Deucher <alexdeucher@gmail.com>,
airlied@gmail.com
Subject: Re: [PATCH V5 3/3] ASoC: AMD: add AMD ASoC ACP-I2S driver
Date: Fri, 21 Aug 2015 09:17:16 -0700 [thread overview]
Message-ID: <20150821161716.GD12027@sirena.org.uk> (raw)
In-Reply-To: <CANv6ZMb9f-kaAUfcUka9T-0XLdG_0eNMVD8YvJNbN=fHEGMRPw@mail.gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 2973 bytes --]
On Fri, Aug 21, 2015 at 05:21:07PM +0530, maruthi srinivas wrote:
> On Fri, Aug 21, 2015 at 4:48 AM, Mark Brown <broonie@kernel.org> wrote:
> > We already have a driver for the DesignWare I2S controller. To repeat
> > the concern I raised in a slightly different bit of the code last time:
> > | This doesn't appear to be a designware-i2s driver, we already have one
> > | of those?
> Our IP block includes few AMD IPs along with DesignWare I2S IP. I have reused
> code from Designware I2S controller from
> sound/soc/dwc/designware_i2s.c and because
> of the way IPs are coupled together, I couldn't use existing
> Designware I2S driver as is.
Could you be more specific about the way in which the IPs are coupled
and the problems this causes please?
> I have given credit to the original author in DRM patch copyright
> header, where register I2S read/writes
> are made. Do I need to add the same header in ASoC driver too ?
What I'm looking for is actual code sharing where we use the same code
for the I2S controller block or a clear and documented understanding of
why it is not possible to share things.
> Oh! I freed in dma_close(), that were allocated in dma_open(). Rest
> of them used devm_*
OK.
> > > + /* Now configure DMA to transfer only first half of System RAM
> > > + * buffer before playback is triggered. This will overwrite
> > > + * zero-ed second half of SRAM buffer */
> > > + acp_dev->config_dma_channel(acp_dev, SYSRAM_TO_ACP_CH_NUM,
> > > + PLAYBACK_START_DMA_DESCR_CH12,
> > > + 1, 0);
> >
> > | Why? The comments describe what's happening but it's not clear why it's
> > | happening.
> The reason for doing this is : When C completes rendering, calls
> period_elapsed() and informs
> ALSA core there is free space to fill new data to system memory. In
> the same irq handler, B is
> DMA'ed to C to be ready by the time D completes rendering with
> prefetched data (in trigger()).
> when D completes rendering, new data fetched by ALSA core can be
> DMA'ed from A to D and
> rendering is continued with C. This is done cyclically.
My point here is that the internal documentation in the driver should be
improved so that someone reading the code can tell why this is being
done. It doesn't need to be this full explanation but at least enough
for people to be aware of the general issue.
> > > +static struct snd_soc_dai_driver i2s_dai_driver = {
> > > + .playback = {
> > > + .stream_name = "I2S Playback",
> > > + .channels_min = 2,
> > > + .channels_max = 2,
> > Elsewhere support for 8 channels was declared and handled.
> The board for which driver is developed, doesn't support more than 2 channels.
This is a driver for the IP, not for the board - you may not be able to
test everything but code should try to be as general as it can be.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
next prev parent reply other threads:[~2015-08-21 16:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-20 21:36 [PATCH V5 3/3] ASoC: AMD: add AMD ASoC ACP-I2S driver Alex Deucher
2015-08-20 23:18 ` Mark Brown
2015-08-20 23:45 ` Alex Deucher
2015-08-21 11:51 ` [alsa-devel] " maruthi srinivas
2015-08-21 16:17 ` Mark Brown [this message]
2015-08-24 20:08 ` Alex Deucher
2015-08-25 6:06 ` Mark Brown
2015-08-25 9:56 ` [alsa-devel] " maruthi srinivas
2015-08-25 18:32 ` Mark Brown
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=20150821161716.GD12027@sirena.org.uk \
--to=broonie@kernel.org \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=alexdeucher@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=lgirdwood@gmail.com \
--cc=maruthi.bayyavarapu@amd.com \
--cc=maruthi.srinivas.b@gmail.com \
--cc=tiwai@suse.de \
/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