[alsa-devel] [PATCH 1/9] ARM: DaVinci: ASoC: Adds ASoC driver support for TI DM646X EVM platform

David Brownell david-b at pacbell.net
Mon Mar 16 18:38:05 CET 2009


On Monday 16 March 2009, Naresh Medisetty wrote:
> @@ -43,14 +48,14 @@ static int evm_hw_params(struct snd_pcm_substream *substream,
>         unsigned sysclk;
>  
>         /* ASP1 on DM355 EVM is clocked by an external oscillator */

... and on this DM646x EVM ... ?


> -       if (machine_is_davinci_dm355_evm())
> +       if (cpu_is_davinci_dm355() || cpu_is_davinci_dm646x())

Shouldn't that stay as a machine_is_*() test,
just adding a machine_is_davinci_dm646x_evm() case?

Code tends to get modified by clone-and-modify,
and making this code be cpu-specific instead of
board-specific will thus promote errors.

On top of that, there's currently an effort to
minimize the amount of cpu_is_*() testing found
in drivers.  Patches that increase such testing,
especially needlessly increasing it!, seem to be
the wrong direction...


>                 sysclk = 27000000;
>  
>         /* ASP0 in DM6446 EVM is clocked by U55, as configured by
>          * board-dm644x-evm.c using GPIOs from U18.  There are six
>          * options; here we "know" we use a 48 KHz sample rate.
>          */
> -       else if (machine_is_davinci_evm())
> +       else if (cpu_is_davinci_dm644x())
>                 sysclk = 12288000;
>  
>         else




More information about the Alsa-devel mailing list