[alsa-devel] [PATCH 3/4] ASOC: WM8731 codec: add SPI support as well as I2C
Mark Brown
broonie at sirena.org.uk
Wed Aug 27 13:01:44 CEST 2008
On Wed, Aug 27, 2008 at 05:39:27PM +0800, Bryan Wu wrote:
This looks good, thanks but...
> -#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
> +#if defined (CONFIG_I2C) || defined (CONFIG_I2C_MODULE) && !defined (CONFIG_SND_SOC_WM8731_SPI)
> if (setup->i2c_address) {
> normal_i2c[0] = setup->i2c_address;
> codec->hw_write = (hw_write_t)i2c_master_send;
> @@ -688,8 +745,14 @@ static int wm8731_probe(struct platform_device *pdev)
> if (ret != 0)
> printk(KERN_ERR "can't add i2c driver");
> }
> +#elif defined (CONFIG_SPI_MASTER) && defined (CONFIG_SND_SOC_WM8731_SPI)
> + codec->hw_write = (hw_write_t)wm8731_spi_write;
> + ret = spi_register_driver(&wm8731_spi_driver);
> + if (ret != 0)
> + printk(KERN_ERR "can't add spi driver");
...as for the SSM2602 it'd be good if it were possible to build a kernel
which supports both I2C and SPI. If you like I could do this for you -
there's likely to be merge issues due to the update to the new I2C API
anyway?
More information about the Alsa-devel
mailing list