[alsa-devel] [PATCH 3/4] ASOC: WM8731 codec: add SPI support as well as I2C

Alan Horstmann gineera at aspect135.co.uk
Tue Sep 2 12:22:23 CEST 2008

On Monday 01 September 2008 15:02, you wrote:
> On Mon, Sep 01, 2008 at 02:52:08PM +0100, Alan Horstmann wrote:
> > in order to force use of SPI when (CONFIG_SND_SOC_WM8731_SPI) and
> > (CONFIG_I2C) are both defined.  Or have we misunderstood the intention? 
> > This is in 2 other places also in the patch.
> I've reworked the patch to allow a single kernel image to support both
> I2C and SPI which sidesteps this problem.  I'll post this later today.

I am aware am new to the asoc stuff, and hesitate to comment, but it would 
seem to me that Liams suggestion:

> It may be simpler to only have CONFIG_SND_SOC_WM8731_SPI and
> CONFIG_SND_SOC_WM8731_I2C definitions for all the codec drivers. These
> would be set by machine Kconfig.
> Liam

is better, since it means one or the other, or both sets of code can be built.  
Since in most applications the hardware is always wired up on a known bus, it 
avoids unused code built in.  Otherwise we would have to hand edit out 
sections of code.  (CONFIG_I2C) may be set because of other devices on that 
bus.  Does the codec ONLY work in spi master?

Then (CONFIG_SND_SOC_WM8731) is not really needed since it is


Essentially, where a hardware device can be connected in different ways 
needing different code, a config option for each way is needed, rather than 
being guessed from bus config options.


More information about the Alsa-devel mailing list