[alsa-devel] [RFC] [PATCH 2/2] ASoC sound support for SMDK2440 boards: board driver
Liam Girdwood
lg at opensource.wolfsonmicro.com
Thu May 24 19:17:13 CEST 2007
On Thu, 2007-05-24 at 16:38 +0200, Zoltan Devai wrote:
> +
> +static int smdk2440_hw_params(struct snd_pcm_substream *substream,
> + struct snd_pcm_hw_params *params)
> +{
> + struct snd_soc_pcm_runtime *rtd = substream->private_data;
> + struct snd_soc_codec_dai *codec_dai = rtd->dai->codec_dai;
> + struct snd_soc_cpu_dai *cpu_dai = rtd->dai->cpu_dai;
> + unsigned int clk = 0;
> + unsigned int div = 0;
> + int ret = 0;
> +
> + switch (params_rate(params)) {
> + case 11025:
> + div = 16;
> + clk = 4233600;
> + break;
> + case 22050:
> + div = 8;
> + clk = 8467200;
> + break;
> + case 44100:
> + div = 4;
> + clk = 16934400;
> + break;
> + default:
> + return -EINVAL;
> + }
> +
case keyword should start on same column as the switch.
e.g.
switch (x) {
case y:
do_that();
Cheers
Liam
More information about the Alsa-devel
mailing list