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

From: Mark Brown
Date: Fri Jun 10 2011 - 13:27:45 EST


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@xxxxxxxxxx>

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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/