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 02:35:50 -0700 [thread overview]
Message-ID: <20101019093550.GA11371@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1287472025-27898-1-git-send-email-jassisinghbrar@gmail.com>
On Tue, Oct 19, 2010 at 04:07:05PM +0900, Jassi Brar wrote:
This looks good - there's a few comments below but they're pretty small
things.
> /**
> * struct s3c_audio_pdata - common platform data for audio device drivers
> * @cfg_gpio: Callback function to setup mux'ed pins in I2S/PCM/AC97 mode
> */
> struct s3c_audio_pdata {
> int (*cfg_gpio)(struct platform_device *);
> + union {
> + struct samsung_i2s i2s;
> + } type;
Might be as easy just to embed a struct s3c_audio_pdata within the
struct samsung_i2s?
> + switch (bfs) {
> + case 48:
> + mod |= MOD_BCLK_48FS;
> + break;
> + case 32:
> + mod |= MOD_BCLK_32FS;
> + break;
> + case 24:
> + mod |= MOD_BCLK_24FS;
> + break;
> + default:
> + mod |= MOD_BCLK_16FS;
> + break;
Especially on the write side I'd be a bit more comfortable if these
functions didn't silently convert an unspecified setting into a default
so that we know that users are getting the setting they asked for.
> + 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.
> + /* 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?
> + /* We don't care about BFS in Slave mode */
> + if (is_slave(i2s))
> + return 0;
You're skipping more than just rfs setting here. Probably just a case
of updating the comment.
> +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.
> +#define SAMSUNG_I2S_RATES \
> + (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 | SNDRV_PCM_RATE_16000 | \
> + SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \
> + SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000)
SNDRV_PCM_RATE_8000_96000.
> +/*
> + * 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.
next prev parent reply other threads:[~2010-10-19 9:36 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 [this message]
2010-10-20 2:22 ` Jassi Brar
2010-10-20 3:13 ` Mark Brown
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=20101019093550.GA11371@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.