[alsa-devel] [PATCH] ASoC: pcm512x: Add PCM512x driver

Takashi Iwai tiwai at suse.de
Thu Feb 6 13:51:33 CET 2014


At Thu,  6 Feb 2014 12:26:15 +0000,
Mark Brown wrote:
> diff --git a/sound/soc/codecs/pcm512x.c b/sound/soc/codecs/pcm512x.c
(snip)
> +static const char *pcm512x_dsp_program_texts[] = {
> +	"FIR interpolation with de-emphasis",
> +	"Low latency IIR with de-emphasis",
> +	"High attenuation with de-emphasis",
> +	"Ringing-less low latency FIR",
> +};
> +
> +static const unsigned int pcm512x_dsp_program_values[] = {
> +	1,
> +	2,
> +	3,
> +	5,
> +	7,
> +};

The numbers of items in pcm512x_dsp_program_texts[] and _values[]
don't match.

> +static const SOC_VALUE_ENUM_SINGLE_DECL(pcm512x_dsp_program,
> +					PCM512x_DSP_PROGRAM, 0, 0x1f,
> +					pcm512x_dsp_program_texts,
> +					pcm512x_dsp_program_values);
> +
> +static const char *pcm512x_clk_missing_text[] = {
> +	"1s", "2s", "3s", "4s", "5s", "6s", "7s", "8s"
> +};
> +
> +static const struct soc_enum pcm512x_clk_missing =
> +	SOC_ENUM_SINGLE(PCM512x_CLKDET, 0,  7, pcm512x_clk_missing_text);

Isn't it 8?

> +
> +static const char *pcm512x_autom_text[] = {
> +	"21ms", "106ms", "213ms", "533ms", "1.07s", "2.13s", "5.33s", "10.66s"
> +};
> +
> +static const struct soc_enum pcm512x_autom_l =
> +	SOC_ENUM_SINGLE(PCM512x_AUTO_MUTE, PCM512x_ATML_SHIFT, 7,
> +			pcm512x_autom_text);
> +
> +static const struct soc_enum pcm512x_autom_r =
> +	SOC_ENUM_SINGLE(PCM512x_AUTO_MUTE, PCM512x_ATMR_SHIFT, 7,
> +			pcm512x_autom_text);

Ditto.


Takashi


More information about the Alsa-devel mailing list