alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: alsa-devel@alsa-project.org, Eric Miao <eric.y.miao@gmail.com>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	Liam Girdwood <lrg@slimlogic.co.uk>
Subject: Re: [PATCH 4/4] ASoC: enable wm8753 in aspenite
Date: Thu, 1 Apr 2010 19:21:24 +0100	[thread overview]
Message-ID: <20100401182124.GB26650@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <s2g771cded01003310548udc9ff8b8u35736bd95038f92c@mail.gmail.com>

On Wed, Mar 31, 2010 at 08:48:58AM -0400, Haojian Zhuang wrote:

> +/* Seek the index of MCLK configuration table */
> +static int pxa168_seek_mclk_conf(int rate, int format, int channel)
> +{
> +	int i;
> +
> +	for (i = 0; i < ARRAY_SIZE(mclk_conf); i++) {
> +		if ((mclk_conf[i].rate == rate)
> +			&& (mclk_conf[i].format == format)
> +			&& (mclk_conf[i].channel == channel))
> +			return i;
> +	}
> +	return -EINVAL;
> +}

> +/* Get the MCLK frequency */
> +static int pxa168_get_mclk(int i)
> +{
> +	if ((i < 0) || (i >= ARRAY_SIZE(mclk_conf)))
> +		return -EINVAL;
> +	return mclk_conf[i].mclk;
> +}

This stuff probably shouldn't be in the machine driver since pretty much
all machine drivers are going to want exactly the same code - it should
be in the library code.  Probably best to have them take hw_params
rather than require the machine driver to decode the format, rate and
channel since that'll save a bit of per driver boiler plate if they
don't otherwise need that information.

As I said last time ideally machine drivers shouldn't have to see this
at all, of course.

Otherwise this series all looks basically OK.  Liam is travelling at the
minute so it'll probably be the weekend at the earliest (more likely
early next week) before he has a chance to look at it.

  reply	other threads:[~2010-04-01 18:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-31 12:48 [PATCH 4/4] ASoC: enable wm8753 in aspenite Haojian Zhuang
2010-04-01 18:21 ` Mark Brown [this message]
2010-04-02  4:40   ` Haojian Zhuang
2010-04-02  9:43     ` Mark Brown
  -- strict thread matches above, loose matches on Subject: below --
2010-04-17  5:37 Haojian Zhuang
2010-04-19 11:35 ` Liam Girdwood

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=20100401182124.GB26650@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=eric.y.miao@gmail.com \
    --cc=haojian.zhuang@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=lrg@slimlogic.co.uk \
    /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).