linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: broonie@opensource.wolfsonmicro.com (Mark Brown)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/6] ASoC: enable wm8753 in aspenite
Date: Sat, 20 Mar 2010 16:42:20 +0000	[thread overview]
Message-ID: <20100320164220.GA1549@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <771cded01003190854o39aae5bj6ae5279a5316b73d@mail.gmail.com>

On Fri, Mar 19, 2010 at 11:54:40AM -0400, Haojian Zhuang wrote:

I note that you're not copying any of these ALSA patches to the ALSA
list...

> +	rate =  params_rate(params);
> +	width = snd_pcm_format_physical_width(params_format(params));
> +	channel = params_channels(params);
> +	ret = pxa168_seek_mclk_conf(rate, width, channel);
> +	if (ret < 0)
> +		return ret;
> +	index = ret;
> +	mclk = pxa168_get_mclk(ret);

Now that it's slightly clearer that this is exported from the SSP driver
the interface here looks odd - there doesn't seem to be any reason to
expose anything of the PXA internal configuration outside the SSP
driver, especially given that the configurations are expressed in terms
of an index into a table of configuration values which aren't much use
to anything outside the SSP driver.

A function allowing the MCLK rate to be queried seems reasonable since
this can be used to configure external devices (as you're doing here)
but this block of code and the subsequent passing of index back into the
driver both seem like boilerplate which every user (or at least most
users) will have to do so it'd be better to save them the effort.

> +	/* set codec DAI configuration */
> +	ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S
> +				  | SND_SOC_DAIFMT_NB_IF
> +				  | SND_SOC_DAIFMT_CBS_CFS);
> +	if (ret < 0)
> +		return ret;

Each time you've posted this I've asked you why you're using an inverted
frame clock for the DAI.  IIRC last time you posted this you said that
you'd add a comment explaining this but I don't see one here?

I'd also suggest not running the SSP port in I2S mode if you can avoid
it - the controller is really just emulating I2S, which makes the
configuration rather fragile.  The DSP modes are more natural for the
PXA hardware, I'd suggest using one of those.

      reply	other threads:[~2010-03-20 16:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-19 15:54 [PATCH 5/6] ASoC: enable wm8753 in aspenite Haojian Zhuang
2010-03-20 16:42 ` Mark Brown [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=20100320164220.GA1549@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=linux-arm-kernel@lists.infradead.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).