[alsa-devel] [PATCH 1/3] ASoC: Add ADAU1701 codec driver

Mark Brown broonie at opensource.wolfsonmicro.com
Fri Jun 10 19:27:35 CEST 2011


On Fri, Jun 10, 2011 at 07:18:49PM +0200, Lars-Peter Clausen wrote:
> This patch adds support for the Analog Devices ADAU1701 SigmaDSP.
> 
> Signed-off-by: Lars-Peter Clausen <lars at metafoo.de>

Looks OK but one thing it'd be nice to do:

> +static unsigned int adau1701_register_size(unsigned int reg)
> +{
> +	switch (reg) {
> +	case ADAU1701_DSPCTRL:
> +	case ADAU1701_SEROCTL:
> +	case ADAU1701_AUXNPOW:
> +	case ADAU1701_OSCIPOW:
> +	case ADAU1701_DACSET:
> +		return 2;
> +	case ADAU1701_SERICTL:
> +		return 1;
> +	}
> +
> +	return 0;
> +}

I'd be happier if this complained loudly when it fell through the
switch in case something goes wrong.  You've got checks in the callers
but I'd feel safer if the log were here in case we missed a caller.

Also someone should remonstrate with the hardware designers.


More information about the Alsa-devel mailing list