From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Jassi Brar <jassisinghbrar@gmail.com>
Cc: alsa-devel@alsa-project.org, kgene.kim@samsung.com,
Jassi Brar <jassi.brar@samsung.com>,
ben-linux@fluff.org, june.bae@samsung.com, lrg@slimlogic.co.uk,
sw.youn@samsung.com
Subject: Re: [PATCH 11/25] ASoC: Samsung: Add common I2S driver
Date: Tue, 19 Oct 2010 20:13:34 -0700 [thread overview]
Message-ID: <20101020031333.GH3803@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <AANLkTimaQ=7Ejgb1jZW4=VGj2-ZV-2wcX6esZwUXsC4a@mail.gmail.com>
On Wed, Oct 20, 2010 at 11:22:26AM +0900, Jassi Brar wrote:
> On Tue, Oct 19, 2010 at 6:35 PM, Mark Brown
> > Might be as easy just to embed a struct s3c_audio_pdata within the
> > struct samsung_i2s?
> struct s3c_audio_pdata is shared among I2S, AC97, SPDIF and PCM.
> Here the idea is that controller drivers add specific structures to the union
> as and when they need it.
Right, what I'm saying is that it'd seem more natural to do things the
other way around and embed the common structure within a device specific
pdata structure instead of having the union.
> >> + if (is_secondary(i2s)) {
> >> + con |= CON_TXSDMA_ACTIVE;
> >> + con &= ~CON_TXSDMA_PAUSE;
> >> + } else {
> >> + con |= CON_TXDMA_ACTIVE;
> >> + con &= ~CON_TXDMA_PAUSE;
> > Can we do this stuff with a variable storing the mask to use? It might
> > compress the code a lot but I've not looked at what the bits actually
> > are.
> sorry, I am unable to understand what you suggest
If we have something in the driver data struct specifying the masks to
use then set these at probe time rather than having the if statements -
probably the same mask can be used for playback & record if the
bitfields are lined up similarly. This would then be:
con |= data->active_mask;
con &= ~data->pause_mask;
or similar, possibly with some shifts.
> >> + /* Allow LRCLK-inverted version of the supported formats */
> >> + switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
> >> + case SND_SOC_DAIFMT_NB_NF:
> >> + break;
> >> + case SND_SOC_DAIFMT_NB_IF:
> >> + if (tmp & MOD_LR_RLOW)
> >> + tmp &= ~MOD_LR_RLOW;
> >> + else
> >> + tmp |= MOD_LR_RLOW;
> >> + break;
> > This looks a bit odd - it'll flip MOD_LR_FLOW if the frame is inverted,
> > I'd expect it to want to set a specific value?
> The frame polarity is specified by the Format(I2S, LSB, MSB), so we
> set/clear MOD_LR_RLOW acc to the Format requested.
> The Inversion request works relative to the Format -- if Frame inversion
> is requested, we simply flip it from the value set during Format setting.
Please add a comment explaining that you're inverting the orientation
you set previously - it's really surprising when reading the code.
> >> +static int i2sv2_i2s_set_clkdiv(struct snd_soc_dai *dai,
> >> + int div_id, int div)
> >> +{
> >> + struct i2s_dai *i2s = to_info(dai);
> >> + struct i2s_dai *other = i2s->pri_dai ? : i2s->sec_dai;
> >> +
> >> + if (div_id == SAMSUNG_I2S_DIV_BCLK) {
> > switch statement please.
> Switch didn't look very pretty with just one case, so I made it if-else
> Anyways, I'll change it to switch.
It helps make the code correspond to the expected patterns for selecting
one of many clocks which is especially helpful when doing a big picture
scan.
> >> +/*
> >> + * Maximum number of I2S blocks that any SoC can have.
> >> + * The secondary interface of a CPU dai(if there exists any),
> >> + * is indexed at [cpu-dai's ID + MAX_I2S]
> >> + */
> >> +#define MAX_I2S 4
> > Can this be kept internal to the driver? If not it should be
> > namespaced.
> ASoC machine drivers need to index the secondary dai that is
> automatically created and registered by the cpu driver.
> So, it needs to be available outside.
> I'll make it SAMSUNG_I2S_SECOFF -- secondary offset of I2S(?)
How would the index be used with multi-component?
next prev parent reply other threads:[~2010-10-20 3:13 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1P85Z9-0007a6-27>
2010-10-19 7:04 ` [PATCH 01/25] ASoC: WM8580: Remove useless assignment Jassi Brar
2010-10-19 10:02 ` Liam Girdwood
2010-10-19 10:21 ` Mark Brown
2010-10-19 7:05 ` [PATCH 02/25] ASoC: Samsung: Remove redundant AQUILA driver Jassi Brar
2010-10-19 7:05 ` [PATCH 03/25] ASoC: Samsung: Rename DMA device Jassi Brar
2010-10-19 7:05 ` [PATCH 04/25] ARM: Samsung: Define common audio-dma device Jassi Brar
2010-10-19 7:54 ` Vasily khoruzhick
2010-10-19 7:05 ` [PATCH 05/25] ASoC: Samsung: Rename ASoC DMA driver Jassi Brar
2010-10-19 7:05 ` [PATCH 06/25] ASoC: Samsung: Rename AC97 platform device Jassi Brar
2010-10-19 7:06 ` [PATCH 07/25] ASoC: Samsung: Rename AC97 driver Jassi Brar
2010-10-19 7:06 ` [PATCH 08/25] ASoC: Samsung: Rename PCM driver Jassi Brar
2010-10-19 7:06 ` [PATCH 09/25] ASoC: Samsung: Generalize DMA driver namespace Jassi Brar
2010-10-19 7:06 ` [PATCH 10/25] ASoC: Samsung: Rename s3c64xx I2S device Jassi Brar
2010-10-19 7:07 ` [PATCH 11/25] ASoC: Samsung: Add common I2S driver Jassi Brar
2010-10-19 9:35 ` Mark Brown
2010-10-20 2:22 ` Jassi Brar
2010-10-20 3:13 ` Mark Brown [this message]
2010-10-20 3:27 ` Jassi Brar
2010-10-20 4:01 ` Mark Brown
2010-10-22 7:39 ` Jassi Brar
2010-10-22 15:28 ` Mark Brown
2010-10-19 7:07 ` [PATCH 12/25] ARM: S3C64XX: I2S: Upgrade platform device Jassi Brar
2010-10-19 7:07 ` [PATCH 13/25] ARM: S5P6440: " Jassi Brar
2010-10-19 7:07 ` [PATCH 14/25] ARM: S5P6442: " Jassi Brar
2010-10-19 7:07 ` [PATCH 15/25] ARM: S5PC100: " Jassi Brar
2010-10-19 7:07 ` [PATCH 16/25] ARM: S5PV210: " Jassi Brar
2010-10-19 7:07 ` [PATCH 17/25] ARM: S5PV310: Add audio platform devices Jassi Brar
2010-10-19 7:07 ` [PATCH 18/25] ASoC: SMARTQ: Move to use new I2S driver Jassi Brar
2010-10-19 7:08 ` [PATCH 19/25] ASoC: GONI: " Jassi Brar
2010-10-19 7:08 ` [PATCH 20/25] ASoC: SMDK64XX: " Jassi Brar
2010-10-19 7:08 ` [PATCH 21/25] ASoC: S3C64XX: Remove obsoleted I2S drivers Jassi Brar
2010-10-19 7:08 ` [PATCH 22/25] ASoC: SMDK64XX: Rename for other platforms Jassi Brar
2010-10-19 7:08 ` [PATCH 23/25] ASoC: SMDK_WM8580: Enable for SMDKC100 Jassi Brar
2010-10-19 7:09 ` [PATCH 24/25] ASoC: Samsung: Generalize Kconfig symbols Jassi Brar
2010-10-19 7:09 ` [PATCH 25/25] ASoC: Samsung: Rename from s3c24xx to samsung Jassi Brar
2010-10-19 8:16 ` Mark Brown
2010-10-19 8:34 ` Jassi Brar
2010-10-19 8:16 ` Jassi Brar
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=20101020031333.GH3803@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=ben-linux@fluff.org \
--cc=jassi.brar@samsung.com \
--cc=jassisinghbrar@gmail.com \
--cc=june.bae@samsung.com \
--cc=kgene.kim@samsung.com \
--cc=lrg@slimlogic.co.uk \
--cc=sw.youn@samsung.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.