alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Tomoya MORINAGA <tomoya.rohm@gmail.com>
Cc: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>,
	alsa-devel@alsa-project.org, Lars-Peter Clausen <lars@metafoo.de>,
	Mike Frysinger <vapier@gentoo.org>,
	qi.wang@intel.com, Takashi Iwai <tiwai@suse.de>,
	linux-kernel@vger.kernel.org, yong.y.wang@intel.com,
	kok.howg.ewe@intel.com, Daniel Mack <zonque@gmail.com>,
	Liam Girdwood <lrg@ti.com>,
	joel.clark@intel.com
Subject: Re: [PATCH 2/3 v4] sound/soc/lapis: add machine driver for ML7213 Carrier Board
Date: Tue, 20 Dec 2011 10:45:26 +0000	[thread overview]
Message-ID: <20111220104525.GG2866@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1324349144-12784-2-git-send-email-tomoya.rohm@gmail.com>

On Tue, Dec 20, 2011 at 11:45:43AM +0900, Tomoya MORINAGA wrote:

> +{
> +	struct snd_soc_pcm_runtime *rtd = substream->private_data;
> +	struct snd_soc_dai *codec_dai = rtd->codec_dai;
> +	struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
> +
> +	unsigned int clk = 0;
> +	int ret = 0;
> +	int bclkfs;
> +	int mclkfs;
> +	int rate = params_rate(hw_params);

The coding style here is really odd, looks like you're mixing
declarations and code.

> +	default:
> +		pr_err("%s: Failed not support format\n", __func__);
> +		return -1;
> +		break;

Return sensible error codes and there's no reason for the break after
the return.

> +	ret = snd_soc_dai_set_clkdiv(cpu_dai, ML7213IOH_BCLKFS0, bclkfs);
> +	if (ret < 0)
> +		return ret;
> +
> +	ret = snd_soc_dai_set_clkdiv(cpu_dai, ML7213IOH_BCLKFS1, bclkfs);
> +	if (ret < 0)
> +		return ret;
> +
> +	ret = snd_soc_dai_set_clkdiv(cpu_dai, ML7213IOH_BCLKFS2, bclkfs);
> +	if (ret < 0)
> +		return ret;
> +
> +	ret = snd_soc_dai_set_clkdiv(cpu_dai, ML7213IOH_BCLKFS3, bclkfs);
> +	if (ret < 0)
> +		return ret;
> +
> +	ret = snd_soc_dai_set_clkdiv(cpu_dai, ML7213IOH_BCLKFS4, bclkfs);
> +	if (ret < 0)
> +		return ret;
> +
> +	ret = snd_soc_dai_set_clkdiv(cpu_dai, ML7213IOH_BCLKFS5, bclkfs);
> +	if (ret < 0)
> +		return ret;
> +
> +	ret = snd_soc_dai_set_clkdiv(cpu_dai, ML7213IOH_MCLKFS0, mclkfs);
> +	if (ret < 0)
> +		return ret;
> +
> +	ret = snd_soc_dai_set_clkdiv(cpu_dai, ML7213IOH_MCLKFS1, mclkfs);
> +	if (ret < 0)
> +		return ret;
> +
> +	ret = snd_soc_dai_set_clkdiv(cpu_dai, ML7213IOH_MCLKFS2, mclkfs);
> +	if (ret < 0)
> +		return ret;
> +
> +	ret = snd_soc_dai_set_clkdiv(cpu_dai, ML7213IOH_MCLKFS3, mclkfs);
> +	if (ret < 0)
> +		return ret;
> +
> +	ret = snd_soc_dai_set_clkdiv(cpu_dai, ML7213IOH_MCLKFS4, mclkfs);
> +	if (ret < 0)
> +		return ret;
> +
> +	ret = snd_soc_dai_set_clkdiv(cpu_dai, ML7213IOH_MCLKFS5, mclkfs);
> +	if (ret < 0)
> +		return ret;

This looks like the CODEC driver ought to be working these things out
for itself rather than having every machine using the device know about
these dividers.

You're also still missing the drivers for the CPU...

  reply	other threads:[~2011-12-20 10:45 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-20  2:45 [PATCH 1/3 v5] sound/soc/codecs: add LAPIS Semiconductor ML26124 Tomoya MORINAGA
2011-12-20  2:45 ` [PATCH 2/3 v4] sound/soc/lapis: add machine driver for ML7213 Carrier Board Tomoya MORINAGA
2011-12-20 10:45   ` Mark Brown [this message]
2011-12-20  2:45 ` [PATCH 3/3 v2] sound/soc/lapis: add platform driver for ML7213 IOH I2S Tomoya MORINAGA
2011-12-20 13:23   ` Mark Brown
2011-12-21 11:22     ` Tomoya MORINAGA
2011-12-22  0:58       ` Mark Brown
2011-12-22  8:10         ` Tomoya MORINAGA
2011-12-22 10:39           ` Mark Brown
2011-12-26  6:33             ` Tomoya MORINAGA
2011-12-26 12:12               ` Mark Brown
2011-12-27  1:25                 ` Tomoya MORINAGA
2011-12-27 17:33                   ` Mark Brown
2011-12-20 10:40 ` [PATCH 1/3 v5] sound/soc/codecs: add LAPIS Semiconductor ML26124 Mark Brown
2011-12-22  8:31   ` Tomoya MORINAGA
2011-12-22 10:50     ` Mark Brown
2011-12-20 10:42 ` 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=20111220104525.GG2866@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=dp@opensource.wolfsonmicro.com \
    --cc=joel.clark@intel.com \
    --cc=kok.howg.ewe@intel.com \
    --cc=lars@metafoo.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@ti.com \
    --cc=qi.wang@intel.com \
    --cc=tiwai@suse.de \
    --cc=tomoya.rohm@gmail.com \
    --cc=vapier@gentoo.org \
    --cc=yong.y.wang@intel.com \
    --cc=zonque@gmail.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 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).