Re: [PATCH v3 7/8] ASoC: wm8998: Initial WM8998 codec driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 01, 2015 at 04:15:18PM +0100, Richard Fitzgerald wrote:

> +	switch (event) {
> +	case SND_SOC_DAPM_PRE_PMU:
> +		val = snd_soc_read(codec, ARIZONA_ASRC_RATE1);
> +		val &= ARIZONA_ASRC_RATE1_MASK;
> +		val >>= ARIZONA_ASRC_RATE1_SHIFT;
> +
> +		val = snd_soc_read(codec, ARIZONA_SAMPLE_RATE_1 + val);
> +		if (val >= 0x11)
> +			dev_warn(codec->dev, "Unsupported ASRC rate1\n");

Shouldn't we be returning an error if the rate is unsupported?  It'd
also be helpful to log what the invalid value that's been set is.

> +		val = snd_soc_read(codec, ARIZONA_ASRC_RATE2);
> +		val &= ARIZONA_ASRC_RATE2_MASK;
> +		val >>= ARIZONA_ASRC_RATE2_SHIFT;
> +		val -= 0x8;

What if the value we read back is set (invalidly I guess) to less than
8?  We'll just read...

> +
> +		val = snd_soc_read(codec, ARIZONA_ASYNC_SAMPLE_RATE_1 + val);
> +		if (val >= 0x11)
> +			dev_warn(codec->dev, "Unsupported ASRC rate2\n");

...some random other register.

> +static const char * const wm8998_inmux_texts[] = {
> +	"A",
> +	"B",
> +};
> +
> +static const SOC_ENUM_SINGLE_DECL(wm8998_in1muxl_enum,
> +				  ARIZONA_ADC_DIGITAL_VOLUME_1L,
> +				  ARIZONA_IN1L_SRC_SHIFT,
> +				  wm8998_inmux_texts);

Those are some fun input names...

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux