[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111220104525.GG2866@opensource.wolfsonmicro.com>
Date: Tue, 20 Dec 2011 10:45:26 +0000
From: Mark Brown <broonie@...nsource.wolfsonmicro.com>
To: Tomoya MORINAGA <tomoya.rohm@...il.com>
Cc: Liam Girdwood <lrg@...com>, Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.de>,
Lars-Peter Clausen <lars@...afoo.de>,
Dimitris Papastamos <dp@...nsource.wolfsonmicro.com>,
Mike Frysinger <vapier@...too.org>,
Daniel Mack <zonque@...il.com>, alsa-devel@...a-project.org,
linux-kernel@...r.kernel.org, qi.wang@...el.com,
yong.y.wang@...el.com, joel.clark@...el.com, kok.howg.ewe@...el.com
Subject: Re: [PATCH 2/3 v4] sound/soc/lapis: add machine driver for ML7213
Carrier Board
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...
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists