[alsa-devel] ASoC updates for 2.6.30
The following changes since commit f1464ede550b8fda75086cb9bacf8d60fc9f6780: Takashi Iwai (1): Merge branch 'for-2.6.30' of git://git.kernel.org/.../broonie/sound-2.6 into topic/asoc
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git for-2.6.30
Kevin Hilman (1): ASoC: Fix DaVinci module unload error
Mark Brown (9): ASoC: Remove version display from the WM8731 driver ASoC: Clean up WM8731 bias level configuration ASoC: Improve diagnostics for AT91SAM9G20-EK probe ASoC: Check machine type before loading on AT91SAM9G20-EK ASoC: Actively manage MCLK for AT91SAM9G20-EK ASoC: Rename AT91SAMG20-EK for applications ASoC: Shuffle WM8731 SPI and I2C device registration ASoC: Refactor WM8731 device registration ASoC: Remove version display from the WM8753 driver
Paul Fertser (1): ASoC: Fix WM8753 DAIs unregistering
sound/soc/atmel/sam9g20_wm8731.c | 124 +++++++++++-- sound/soc/codecs/wm8731.c | 377 ++++++++++++++++-------------------- sound/soc/codecs/wm8731.h | 6 - sound/soc/codecs/wm8753.c | 9 +- sound/soc/davinci/davinci-evm.c | 3 +- sound/soc/davinci/davinci-sffsdr.c | 3 +- sound/soc/pxa/corgi.c | 43 ++++- sound/soc/pxa/poodle.c | 41 ++++- 8 files changed, 361 insertions(+), 245 deletions(-)
From: Kevin Hilman khilman@deeprootsystems.com
Fix for the error when the audio module is unloaded. On unregistering the platform_device, platform_device_release will free the platform data.If platform data is static the kernel panics when it is freed. Instead use the platform device helper function to add data.
This change has been tested on DM644x EVM, DM644x SFFSDR and DM355 EVM.
Signed-off-by: Chaithrika U S chaithrika@ti.com Signed-off-by: Kevin Hilman khilman@deeprootsystems.com Signed-off-by: Mark Brown broonie@opensource.wolfsonmicro.com --- sound/soc/davinci/davinci-evm.c | 3 ++- sound/soc/davinci/davinci-sffsdr.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/sound/soc/davinci/davinci-evm.c b/sound/soc/davinci/davinci-evm.c index 54851f3..9b90b34 100644 --- a/sound/soc/davinci/davinci-evm.c +++ b/sound/soc/davinci/davinci-evm.c @@ -186,7 +186,8 @@ static int __init evm_init(void)
platform_set_drvdata(evm_snd_device, &evm_snd_devdata); evm_snd_devdata.dev = &evm_snd_device->dev; - evm_snd_device->dev.platform_data = &evm_snd_data; + platform_device_add_data(evm_snd_device, &evm_snd_data, + sizeof(evm_snd_data));
ret = platform_device_add_resources(evm_snd_device, evm_snd_resources, ARRAY_SIZE(evm_snd_resources)); diff --git a/sound/soc/davinci/davinci-sffsdr.c b/sound/soc/davinci/davinci-sffsdr.c index 50baef1..0bf81ab 100644 --- a/sound/soc/davinci/davinci-sffsdr.c +++ b/sound/soc/davinci/davinci-sffsdr.c @@ -141,7 +141,8 @@ static int __init sffsdr_init(void)
platform_set_drvdata(sffsdr_snd_device, &sffsdr_snd_devdata); sffsdr_snd_devdata.dev = &sffsdr_snd_device->dev; - sffsdr_snd_device->dev.platform_data = &sffsdr_snd_data; + platform_device_add_data(sffsdr_snd_device, &sffsdr_snd_data, + sizeof(sffsdr_snd_data));
ret = platform_device_add_resources(sffsdr_snd_device, sffsdr_snd_resources,
From: Paul Fertser fercerpav@gmail.com
WM8753 uses a tricky way to switch DAIs "on the fly", for that it registers 2 dummy DAIs and substitutes them depending on mixer control.
List element of registered dummy DAIs should be preserved to allow unregistering of DAIs on module unload.
Signed-off-by: Paul Fertser fercerpav@gmail.com Signed-off-by: Mark Brown broonie@opensource.wolfsonmicro.com --- sound/soc/codecs/wm8753.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c index 6f9e6be..dc6042c 100644 --- a/sound/soc/codecs/wm8753.c +++ b/sound/soc/codecs/wm8753.c @@ -1451,30 +1451,35 @@ static void wm8753_set_dai_mode(struct snd_soc_codec *codec, unsigned int mode) if (mode < 4) { int playback_active, capture_active, codec_active, pop_wait; void *private_data; + struct list_head list;
playback_active = wm8753_dai[0].playback.active; capture_active = wm8753_dai[0].capture.active; codec_active = wm8753_dai[0].active; private_data = wm8753_dai[0].private_data; pop_wait = wm8753_dai[0].pop_wait; + list = wm8753_dai[0].list; wm8753_dai[0] = wm8753_all_dai[mode << 1]; wm8753_dai[0].playback.active = playback_active; wm8753_dai[0].capture.active = capture_active; wm8753_dai[0].active = codec_active; wm8753_dai[0].private_data = private_data; wm8753_dai[0].pop_wait = pop_wait; + wm8753_dai[0].list = list;
playback_active = wm8753_dai[1].playback.active; capture_active = wm8753_dai[1].capture.active; codec_active = wm8753_dai[1].active; private_data = wm8753_dai[1].private_data; pop_wait = wm8753_dai[1].pop_wait; + list = wm8753_dai[1].list; wm8753_dai[1] = wm8753_all_dai[(mode << 1) + 1]; wm8753_dai[1].playback.active = playback_active; wm8753_dai[1].capture.active = capture_active; wm8753_dai[1].active = codec_active; wm8753_dai[1].private_data = private_data; wm8753_dai[1].pop_wait = pop_wait; + wm8753_dai[1].list = list; } wm8753_dai[0].codec = codec; wm8753_dai[1].codec = codec;
It makes boot a bit more noisy and I never remember to update it.
Signed-off-by: Mark Brown broonie@opensource.wolfsonmicro.com --- sound/soc/codecs/wm8731.c | 4 ---- 1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c index 0150fe5..816e5bf 100644 --- a/sound/soc/codecs/wm8731.c +++ b/sound/soc/codecs/wm8731.c @@ -29,8 +29,6 @@
#include "wm8731.h"
-#define WM8731_VERSION "0.13" - struct snd_soc_codec_device soc_codec_dev_wm8731;
/* codec private data */ @@ -702,8 +700,6 @@ static int wm8731_probe(struct platform_device *pdev) struct wm8731_priv *wm8731; int ret = 0;
- pr_info("WM8731 Audio Codec %s", WM8731_VERSION); - setup = socdev->codec_data; codec = kzalloc(sizeof(struct snd_soc_codec), GFP_KERNEL); if (codec == NULL)
The WM8731 bias level configuration function was written slightly obscurely - streamline the code a little and refresh the comments.
Signed-off-by: Mark Brown broonie@opensource.wolfsonmicro.com --- sound/soc/codecs/wm8731.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c index 816e5bf..c6db677 100644 --- a/sound/soc/codecs/wm8731.c +++ b/sound/soc/codecs/wm8731.c @@ -396,21 +396,19 @@ static int wm8731_set_dai_fmt(struct snd_soc_dai *codec_dai, static int wm8731_set_bias_level(struct snd_soc_codec *codec, enum snd_soc_bias_level level) { - u16 reg = wm8731_read_reg_cache(codec, WM8731_PWR) & 0xff7f; + u16 reg;
switch (level) { case SND_SOC_BIAS_ON: - /* vref/mid, osc on, dac unmute */ - wm8731_write(codec, WM8731_PWR, reg); break; case SND_SOC_BIAS_PREPARE: break; case SND_SOC_BIAS_STANDBY: - /* everything off except vref/vmid, */ + /* Clear PWROFF, gate CLKOUT, everything else as-is */ + reg = wm8731_read_reg_cache(codec, WM8731_PWR) & 0xff7f; wm8731_write(codec, WM8731_PWR, reg | 0x0040); break; case SND_SOC_BIAS_OFF: - /* everything off, dac mute, inactive */ wm8731_write(codec, WM8731_ACTIVE, 0x0); wm8731_write(codec, WM8731_PWR, 0xffff); break;
We should display an error by default if we fail to register.
Signed-off-by: Mark Brown broonie@opensource.wolfsonmicro.com --- sound/soc/atmel/sam9g20_wm8731.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/sound/soc/atmel/sam9g20_wm8731.c b/sound/soc/atmel/sam9g20_wm8731.c index 6ea04be..be3f923 100644 --- a/sound/soc/atmel/sam9g20_wm8731.c +++ b/sound/soc/atmel/sam9g20_wm8731.c @@ -273,6 +273,7 @@ static int __init at91sam9g20ek_init(void) */ ssc = ssc_request(0); if (IS_ERR(ssc)) { + printk(KERN_ERR "ASoC: Failed to request SSC 0\n"); ret = PTR_ERR(ssc); ssc = NULL; goto err_ssc; @@ -281,8 +282,7 @@ static int __init at91sam9g20ek_init(void)
at91sam9g20ek_snd_device = platform_device_alloc("soc-audio", -1); if (!at91sam9g20ek_snd_device) { - printk(KERN_DEBUG - "platform device allocation failed\n"); + printk(KERN_ERR "ASoC: Platform device allocation failed\n"); ret = -ENOMEM; }
@@ -292,8 +292,7 @@ static int __init at91sam9g20ek_init(void)
ret = platform_device_add(at91sam9g20ek_snd_device); if (ret) { - printk(KERN_DEBUG - "platform device allocation failed\n"); + printk(KERN_ERR "ASoC: Platform device allocation failed\n"); platform_device_put(at91sam9g20ek_snd_device); }
Signed-off-by: Mark Brown broonie@opensource.wolfsonmicro.com --- sound/soc/atmel/sam9g20_wm8731.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/sound/soc/atmel/sam9g20_wm8731.c b/sound/soc/atmel/sam9g20_wm8731.c index be3f923..b7efdc8 100644 --- a/sound/soc/atmel/sam9g20_wm8731.c +++ b/sound/soc/atmel/sam9g20_wm8731.c @@ -45,6 +45,7 @@ #include <sound/soc.h> #include <sound/soc-dapm.h>
+#include <asm/mach-types.h> #include <mach/hardware.h> #include <mach/gpio.h>
@@ -268,6 +269,9 @@ static int __init at91sam9g20ek_init(void) struct ssc_device *ssc = NULL; int ret;
+ if (!machine_is_at91sam9g20ek()) + return -ENODEV; + /* * Request SSC device */
We have software control of the MCLK for the WM8731 so save a bit of power by actively managing it within the machine driver, enabling it only while the codec is active.
Once ASoC supports multiple boards and doesn't require the soc-audio device the initial clock setup should be pushed down into the arch/arm code but for now this reduces merge issues.
Tested-by: Sedji Gaouaou sedji.gaouaou@atmel.com Signed-off-by: Mark Brown broonie@opensource.wolfsonmicro.com --- sound/soc/atmel/sam9g20_wm8731.c | 68 ++++++++++++++++++++++++++++++++++++-- 1 files changed, 65 insertions(+), 3 deletions(-)
diff --git a/sound/soc/atmel/sam9g20_wm8731.c b/sound/soc/atmel/sam9g20_wm8731.c index b7efdc8..ab32514 100644 --- a/sound/soc/atmel/sam9g20_wm8731.c +++ b/sound/soc/atmel/sam9g20_wm8731.c @@ -53,6 +53,9 @@ #include "atmel-pcm.h" #include "atmel_ssc_dai.h"
+#define MCLK_RATE 12000000 + +static struct clk *mclk;
static int at91sam9g20ek_startup(struct snd_pcm_substream *substream) { @@ -60,11 +63,12 @@ static int at91sam9g20ek_startup(struct snd_pcm_substream *substream) struct snd_soc_dai *codec_dai = rtd->dai->codec_dai; int ret;
- /* codec system clock is supplied by PCK0, set to 12MHz */ ret = snd_soc_dai_set_sysclk(codec_dai, WM8731_SYSCLK, - 12000000, SND_SOC_CLOCK_IN); - if (ret < 0) + MCLK_RATE, SND_SOC_CLOCK_IN); + if (ret < 0) { + clk_disable(mclk); return ret; + }
return 0; } @@ -190,6 +194,31 @@ static struct snd_soc_ops at91sam9g20ek_ops = { .shutdown = at91sam9g20ek_shutdown, };
+static int at91sam9g20ek_set_bias_level(struct snd_soc_card *card, + enum snd_soc_bias_level level) +{ + static int mclk_on; + int ret = 0; + + switch (level) { + case SND_SOC_BIAS_ON: + case SND_SOC_BIAS_PREPARE: + if (!mclk_on) + ret = clk_enable(mclk); + if (ret == 0) + mclk_on = 1; + break; + + case SND_SOC_BIAS_OFF: + case SND_SOC_BIAS_STANDBY: + if (mclk_on) + clk_disable(mclk); + mclk_on = 0; + break; + } + + return ret; +}
static const struct snd_soc_dapm_widget at91sam9g20ek_dapm_widgets[] = { SND_SOC_DAPM_MIC("Int Mic", NULL), @@ -248,6 +277,7 @@ static struct snd_soc_card snd_soc_at91sam9g20ek = { .platform = &atmel_soc_platform, .dai_link = &at91sam9g20ek_dai, .num_links = 1, + .set_bias_level = at91sam9g20ek_set_bias_level, };
static struct wm8731_setup_data at91sam9g20ek_wm8731_setup = { @@ -267,12 +297,38 @@ static int __init at91sam9g20ek_init(void) { struct atmel_ssc_info *ssc_p = at91sam9g20ek_dai.cpu_dai->private_data; struct ssc_device *ssc = NULL; + struct clk *pllb; int ret;
if (!machine_is_at91sam9g20ek()) return -ENODEV;
/* + * Codec MCLK is supplied by PCK0 - set it up. + */ + mclk = clk_get(NULL, "pck0"); + if (IS_ERR(mclk)) { + printk(KERN_ERR "ASoC: Failed to get MCLK\n"); + ret = PTR_ERR(mclk); + goto err; + } + + pllb = clk_get(NULL, "pllb"); + if (IS_ERR(mclk)) { + printk(KERN_ERR "ASoC: Failed to get PLLB\n"); + ret = PTR_ERR(mclk); + goto err_mclk; + } + ret = clk_set_parent(mclk, pllb); + clk_put(pllb); + if (ret != 0) { + printk(KERN_ERR "ASoC: Failed to set MCLK parent\n"); + goto err_mclk; + } + + clk_set_rate(mclk, MCLK_RATE); + + /* * Request SSC device */ ssc = ssc_request(0); @@ -303,6 +359,10 @@ static int __init at91sam9g20ek_init(void) return ret;
err_ssc: +err_mclk: + clk_put(mclk); + mclk = NULL; +err: return ret; }
@@ -320,6 +380,8 @@ static void __exit at91sam9g20ek_exit(void)
platform_device_unregister(at91sam9g20ek_snd_device); at91sam9g20ek_snd_device = NULL; + clk_put(mclk); + mclk = NULL; }
module_init(at91sam9g20ek_init);
This is a bit more idiomatic and makes identifying a configuration based on the board type work better.
Signed-off-by: Mark Brown broonie@opensource.wolfsonmicro.com --- sound/soc/atmel/sam9g20_wm8731.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/sound/soc/atmel/sam9g20_wm8731.c b/sound/soc/atmel/sam9g20_wm8731.c index ab32514..aa52423 100644 --- a/sound/soc/atmel/sam9g20_wm8731.c +++ b/sound/soc/atmel/sam9g20_wm8731.c @@ -273,7 +273,7 @@ static struct snd_soc_dai_link at91sam9g20ek_dai = { };
static struct snd_soc_card snd_soc_at91sam9g20ek = { - .name = "WM8731", + .name = "AT91SAMG20-EK", .platform = &atmel_soc_platform, .dai_link = &at91sam9g20ek_dai, .num_links = 1,
This is a pure code motion patch intended to improve reviewability of a following patch moving WM8731 to use more standard device registration.
Signed-off-by: Mark Brown broonie@opensource.wolfsonmicro.com --- sound/soc/codecs/wm8731.c | 215 +++++++++++++++++++++++--------------------- 1 files changed, 112 insertions(+), 103 deletions(-)
diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c index c6db677..3ff971a 100644 --- a/sound/soc/codecs/wm8731.c +++ b/sound/soc/codecs/wm8731.c @@ -36,6 +36,11 @@ struct wm8731_priv { unsigned int sysclk; };
+#ifdef CONFIG_SPI_MASTER +static int wm8731_spi_write(struct spi_device *spi, const char *data, int len); +static struct spi_driver wm8731_spi_driver; +#endif + /* * wm8731 register cache * We can't read the WM8731 register space when we are @@ -544,54 +549,9 @@ pcm_err:
static struct snd_soc_device *wm8731_socdev;
-#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) - -/* - * WM8731 2 wire address is determined by GPIO5 - * state during powerup. - * low = 0x1a - * high = 0x1b - */ - -static int wm8731_i2c_probe(struct i2c_client *i2c, - const struct i2c_device_id *id) -{ - struct snd_soc_device *socdev = wm8731_socdev; - struct snd_soc_codec *codec = socdev->card->codec; - int ret; - - i2c_set_clientdata(i2c, codec); - codec->control_data = i2c; - - ret = wm8731_init(socdev); - if (ret < 0) - pr_err("failed to initialise WM8731\n"); - - return ret; -}
-static int wm8731_i2c_remove(struct i2c_client *client) -{ - struct snd_soc_codec *codec = i2c_get_clientdata(client); - kfree(codec->reg_cache); - return 0; -} - -static const struct i2c_device_id wm8731_i2c_id[] = { - { "wm8731", 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, wm8731_i2c_id); - -static struct i2c_driver wm8731_i2c_driver = { - .driver = { - .name = "WM8731 I2C Codec", - .owner = THIS_MODULE, - }, - .probe = wm8731_i2c_probe, - .remove = wm8731_i2c_remove, - .id_table = wm8731_i2c_id, -}; +#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) +static struct i2c_driver wm8731_i2c_driver;
static int wm8731_add_i2c_device(struct platform_device *pdev, const struct wm8731_setup_data *setup) @@ -634,62 +594,6 @@ err_driver: } #endif
-#if defined(CONFIG_SPI_MASTER) -static int __devinit wm8731_spi_probe(struct spi_device *spi) -{ - struct snd_soc_device *socdev = wm8731_socdev; - struct snd_soc_codec *codec = socdev->card->codec; - int ret; - - codec->control_data = spi; - - ret = wm8731_init(socdev); - if (ret < 0) - dev_err(&spi->dev, "failed to initialise WM8731\n"); - - return ret; -} - -static int __devexit wm8731_spi_remove(struct spi_device *spi) -{ - return 0; -} - -static struct spi_driver wm8731_spi_driver = { - .driver = { - .name = "wm8731", - .bus = &spi_bus_type, - .owner = THIS_MODULE, - }, - .probe = wm8731_spi_probe, - .remove = __devexit_p(wm8731_spi_remove), -}; - -static int wm8731_spi_write(struct spi_device *spi, const char *data, int len) -{ - struct spi_transfer t; - struct spi_message m; - u8 msg[2]; - - if (len <= 0) - return 0; - - msg[0] = data[0]; - msg[1] = data[1]; - - spi_message_init(&m); - memset(&t, 0, (sizeof t)); - - t.tx_buf = &msg[0]; - t.len = len; - - spi_message_add_tail(&t, &m); - spi_sync(spi, &m); - - return len; -} -#endif /* CONFIG_SPI_MASTER */ - static int wm8731_probe(struct platform_device *pdev) { struct snd_soc_device *socdev = platform_get_drvdata(pdev); @@ -772,6 +676,111 @@ struct snd_soc_codec_device soc_codec_dev_wm8731 = { }; EXPORT_SYMBOL_GPL(soc_codec_dev_wm8731);
+#if defined(CONFIG_SPI_MASTER) +static int __devinit wm8731_spi_probe(struct spi_device *spi) +{ + struct snd_soc_device *socdev = wm8731_socdev; + struct snd_soc_codec *codec = socdev->card->codec; + int ret; + + codec->control_data = spi; + + ret = wm8731_init(socdev); + if (ret < 0) + dev_err(&spi->dev, "failed to initialise WM8731\n"); + + return ret; +} + +static int __devexit wm8731_spi_remove(struct spi_device *spi) +{ + return 0; +} + +static struct spi_driver wm8731_spi_driver = { + .driver = { + .name = "wm8731", + .bus = &spi_bus_type, + .owner = THIS_MODULE, + }, + .probe = wm8731_spi_probe, + .remove = __devexit_p(wm8731_spi_remove), +}; + +static int wm8731_spi_write(struct spi_device *spi, const char *data, int len) +{ + struct spi_transfer t; + struct spi_message m; + u8 msg[2]; + + if (len <= 0) + return 0; + + msg[0] = data[0]; + msg[1] = data[1]; + + spi_message_init(&m); + memset(&t, 0, (sizeof t)); + + t.tx_buf = &msg[0]; + t.len = len; + + spi_message_add_tail(&t, &m); + spi_sync(spi, &m); + + return len; +} +#endif /* CONFIG_SPI_MASTER */ + +#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) +/* + * WM8731 2 wire address is determined by GPIO5 + * state during powerup. + * low = 0x1a + * high = 0x1b + */ + +static int wm8731_i2c_probe(struct i2c_client *i2c, + const struct i2c_device_id *id) +{ + struct snd_soc_device *socdev = wm8731_socdev; + struct snd_soc_codec *codec = socdev->card->codec; + int ret; + + i2c_set_clientdata(i2c, codec); + codec->control_data = i2c; + + ret = wm8731_init(socdev); + if (ret < 0) + pr_err("failed to initialise WM8731\n"); + + return ret; +} + +static int wm8731_i2c_remove(struct i2c_client *client) +{ + struct snd_soc_codec *codec = i2c_get_clientdata(client); + kfree(codec->reg_cache); + return 0; +} + +static const struct i2c_device_id wm8731_i2c_id[] = { + { "wm8731", 0 }, + { } +}; +MODULE_DEVICE_TABLE(i2c, wm8731_i2c_id); + +static struct i2c_driver wm8731_i2c_driver = { + .driver = { + .name = "WM8731 I2C Codec", + .owner = THIS_MODULE, + }, + .probe = wm8731_i2c_probe, + .remove = wm8731_i2c_remove, + .id_table = wm8731_i2c_id, +}; +#endif + static int __init wm8731_modinit(void) { return snd_soc_register_dai(&wm8731_dai);
Move the WM8731 driver to use a more standard device registration scheme where the device can be registered independantly of the ASoC probe.
As a transition measure push the current manual code for registering the WM8731 into the individual machine driver probes. This allows separate patches to update the relevant architecture files with less risk of merge issues.
Signed-off-by: Mark Brown broonie@opensource.wolfsonmicro.com --- sound/soc/atmel/sam9g20_wm8731.c | 43 +++++- sound/soc/codecs/wm8731.c | 334 +++++++++++++++++--------------------- sound/soc/codecs/wm8731.h | 6 - sound/soc/pxa/corgi.c | 43 ++++- sound/soc/pxa/poodle.c | 41 ++++- 5 files changed, 256 insertions(+), 211 deletions(-)
diff --git a/sound/soc/atmel/sam9g20_wm8731.c b/sound/soc/atmel/sam9g20_wm8731.c index aa52423..173a239 100644 --- a/sound/soc/atmel/sam9g20_wm8731.c +++ b/sound/soc/atmel/sam9g20_wm8731.c @@ -36,6 +36,7 @@ #include <linux/timer.h> #include <linux/interrupt.h> #include <linux/platform_device.h> +#include <linux/i2c.h>
#include <linux/atmel-ssc.h>
@@ -280,15 +281,41 @@ static struct snd_soc_card snd_soc_at91sam9g20ek = { .set_bias_level = at91sam9g20ek_set_bias_level, };
-static struct wm8731_setup_data at91sam9g20ek_wm8731_setup = { - .i2c_bus = 0, - .i2c_address = 0x1b, -}; +/* + * FIXME: This is a temporary bodge to avoid cross-tree merge issues. + * New drivers should register the wm8731 I2C device in the machine + * setup code (under arch/arm for ARM systems). + */ +static int wm8731_i2c_register(void) +{ + struct i2c_board_info info; + struct i2c_adapter *adapter; + struct i2c_client *client; + + memset(&info, 0, sizeof(struct i2c_board_info)); + info.addr = 0x1b; + strlcpy(info.type, "wm8731", I2C_NAME_SIZE); + + adapter = i2c_get_adapter(0); + if (!adapter) { + printk(KERN_ERR "can't get i2c adapter 0\n"); + return -ENODEV; + } + + client = i2c_new_device(adapter, &info); + i2c_put_adapter(adapter); + if (!client) { + printk(KERN_ERR "can't add i2c device at 0x%x\n", + (unsigned int)info.addr); + return -ENODEV; + } + + return 0; +}
static struct snd_soc_device at91sam9g20ek_snd_devdata = { .card = &snd_soc_at91sam9g20ek, .codec_dev = &soc_codec_dev_wm8731, - .codec_data = &at91sam9g20ek_wm8731_setup, };
static struct platform_device *at91sam9g20ek_snd_device; @@ -340,6 +367,10 @@ static int __init at91sam9g20ek_init(void) } ssc_p->ssc = ssc;
+ ret = wm8731_i2c_register(); + if (ret != 0) + goto err_ssc; + at91sam9g20ek_snd_device = platform_device_alloc("soc-audio", -1); if (!at91sam9g20ek_snd_device) { printk(KERN_ERR "ASoC: Platform device allocation failed\n"); @@ -359,6 +390,8 @@ static int __init at91sam9g20ek_init(void) return ret;
err_ssc: + ssc_free(ssc); + ssc_p->ssc = NULL; err_mclk: clk_put(mclk); mclk = NULL; diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c index 3ff971a..a2c478e 100644 --- a/sound/soc/codecs/wm8731.c +++ b/sound/soc/codecs/wm8731.c @@ -29,16 +29,18 @@
#include "wm8731.h"
+static struct snd_soc_codec *wm8731_codec; struct snd_soc_codec_device soc_codec_dev_wm8731;
/* codec private data */ struct wm8731_priv { + struct snd_soc_codec codec; + u16 reg_cache[WM8731_CACHEREGNUM]; unsigned int sysclk; };
#ifdef CONFIG_SPI_MASTER static int wm8731_spi_write(struct spi_device *spi, const char *data, int len); -static struct spi_driver wm8731_spi_driver; #endif
/* @@ -485,55 +487,33 @@ static int wm8731_resume(struct platform_device *pdev) return 0; }
-/* - * initialise the WM8731 driver - * register the mixer and dsp interfaces with the kernel - */ -static int wm8731_init(struct snd_soc_device *socdev) +static int wm8731_probe(struct platform_device *pdev) { - struct snd_soc_codec *codec = socdev->card->codec; - int reg, ret = 0; + struct snd_soc_device *socdev = platform_get_drvdata(pdev); + struct snd_soc_codec *codec; + int ret = 0;
- codec->name = "WM8731"; - codec->owner = THIS_MODULE; - codec->read = wm8731_read_reg_cache; - codec->write = wm8731_write; - codec->set_bias_level = wm8731_set_bias_level; - codec->dai = &wm8731_dai; - codec->num_dai = 1; - codec->reg_cache_size = ARRAY_SIZE(wm8731_reg); - codec->reg_cache = kmemdup(wm8731_reg, sizeof(wm8731_reg), GFP_KERNEL); - if (codec->reg_cache == NULL) - return -ENOMEM; + if (wm8731_codec == NULL) { + dev_err(&pdev->dev, "Codec device not registered\n"); + return -ENODEV; + }
- wm8731_reset(codec); + socdev->card->codec = wm8731_codec; + codec = wm8731_codec;
/* register pcms */ ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1); if (ret < 0) { - printk(KERN_ERR "wm8731: failed to create pcms\n"); + dev_err(codec->dev, "failed to create pcms: %d\n", ret); goto pcm_err; }
- /* power on device */ - wm8731_set_bias_level(codec, SND_SOC_BIAS_STANDBY); - - /* set the update bits */ - reg = wm8731_read_reg_cache(codec, WM8731_LOUT1V); - wm8731_write(codec, WM8731_LOUT1V, reg & ~0x0100); - reg = wm8731_read_reg_cache(codec, WM8731_ROUT1V); - wm8731_write(codec, WM8731_ROUT1V, reg & ~0x0100); - reg = wm8731_read_reg_cache(codec, WM8731_LINVOL); - wm8731_write(codec, WM8731_LINVOL, reg & ~0x0100); - reg = wm8731_read_reg_cache(codec, WM8731_RINVOL); - wm8731_write(codec, WM8731_RINVOL, reg & ~0x0100); - snd_soc_add_controls(codec, wm8731_snd_controls, - ARRAY_SIZE(wm8731_snd_controls)); + ARRAY_SIZE(wm8731_snd_controls)); wm8731_add_widgets(codec); ret = snd_soc_init_card(socdev); if (ret < 0) { - printk(KERN_ERR "wm8731: failed to register card\n"); + dev_err(codec->dev, "failed to register card: %d\n", ret); goto card_err; }
@@ -543,104 +523,6 @@ card_err: snd_soc_free_pcms(socdev); snd_soc_dapm_free(socdev); pcm_err: - kfree(codec->reg_cache); - return ret; -} - -static struct snd_soc_device *wm8731_socdev; - - -#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) -static struct i2c_driver wm8731_i2c_driver; - -static int wm8731_add_i2c_device(struct platform_device *pdev, - const struct wm8731_setup_data *setup) -{ - struct i2c_board_info info; - struct i2c_adapter *adapter; - struct i2c_client *client; - int ret; - - ret = i2c_add_driver(&wm8731_i2c_driver); - if (ret != 0) { - dev_err(&pdev->dev, "can't add i2c driver\n"); - return ret; - } - - memset(&info, 0, sizeof(struct i2c_board_info)); - info.addr = setup->i2c_address; - strlcpy(info.type, "wm8731", I2C_NAME_SIZE); - - adapter = i2c_get_adapter(setup->i2c_bus); - if (!adapter) { - dev_err(&pdev->dev, "can't get i2c adapter %d\n", - setup->i2c_bus); - goto err_driver; - } - - client = i2c_new_device(adapter, &info); - i2c_put_adapter(adapter); - if (!client) { - dev_err(&pdev->dev, "can't add i2c device at 0x%x\n", - (unsigned int)info.addr); - goto err_driver; - } - - return 0; - -err_driver: - i2c_del_driver(&wm8731_i2c_driver); - return -ENODEV; -} -#endif - -static int wm8731_probe(struct platform_device *pdev) -{ - struct snd_soc_device *socdev = platform_get_drvdata(pdev); - struct wm8731_setup_data *setup; - struct snd_soc_codec *codec; - struct wm8731_priv *wm8731; - int ret = 0; - - setup = socdev->codec_data; - codec = kzalloc(sizeof(struct snd_soc_codec), GFP_KERNEL); - if (codec == NULL) - return -ENOMEM; - - wm8731 = kzalloc(sizeof(struct wm8731_priv), GFP_KERNEL); - if (wm8731 == NULL) { - kfree(codec); - return -ENOMEM; - } - - codec->private_data = wm8731; - socdev->card->codec = codec; - mutex_init(&codec->mutex); - INIT_LIST_HEAD(&codec->dapm_widgets); - INIT_LIST_HEAD(&codec->dapm_paths); - - wm8731_socdev = socdev; - ret = -ENODEV; - -#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) - if (setup->i2c_address) { - codec->hw_write = (hw_write_t)i2c_master_send; - ret = wm8731_add_i2c_device(pdev, setup); - } -#endif -#if defined(CONFIG_SPI_MASTER) - if (setup->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"); - } -#endif - - if (ret != 0) { - kfree(codec->private_data); - kfree(codec); - } return ret; }
@@ -648,22 +530,9 @@ static int wm8731_probe(struct platform_device *pdev) static int wm8731_remove(struct platform_device *pdev) { struct snd_soc_device *socdev = platform_get_drvdata(pdev); - struct snd_soc_codec *codec = socdev->card->codec; - - if (codec->control_data) - wm8731_set_bias_level(codec, SND_SOC_BIAS_OFF);
snd_soc_free_pcms(socdev); snd_soc_dapm_free(socdev); -#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) - i2c_unregister_device(codec->control_data); - i2c_del_driver(&wm8731_i2c_driver); -#endif -#if defined(CONFIG_SPI_MASTER) - spi_unregister_driver(&wm8731_spi_driver); -#endif - kfree(codec->private_data); - kfree(codec);
return 0; } @@ -676,37 +545,78 @@ struct snd_soc_codec_device soc_codec_dev_wm8731 = { }; EXPORT_SYMBOL_GPL(soc_codec_dev_wm8731);
-#if defined(CONFIG_SPI_MASTER) -static int __devinit wm8731_spi_probe(struct spi_device *spi) +static int wm8731_register(struct wm8731_priv *wm8731) { - struct snd_soc_device *socdev = wm8731_socdev; - struct snd_soc_codec *codec = socdev->card->codec; int ret; + struct snd_soc_codec *codec = &wm8731->codec; + u16 reg;
- codec->control_data = spi; + if (wm8731_codec) { + dev_err(codec->dev, "Another WM8731 is registered\n"); + return -EINVAL; + }
- ret = wm8731_init(socdev); - if (ret < 0) - dev_err(&spi->dev, "failed to initialise WM8731\n"); + mutex_init(&codec->mutex); + INIT_LIST_HEAD(&codec->dapm_widgets); + INIT_LIST_HEAD(&codec->dapm_paths);
- return ret; -} + codec->private_data = wm8731; + codec->name = "WM8731"; + codec->owner = THIS_MODULE; + codec->read = wm8731_read_reg_cache; + codec->write = wm8731_write; + codec->bias_level = SND_SOC_BIAS_OFF; + codec->set_bias_level = wm8731_set_bias_level; + codec->dai = &wm8731_dai; + codec->num_dai = 1; + codec->reg_cache_size = WM8731_CACHEREGNUM; + codec->reg_cache = &wm8731->reg_cache; + + memcpy(codec->reg_cache, wm8731_reg, sizeof(wm8731_reg)); + + wm8731_dai.dev = codec->dev; + + wm8731_reset(codec); + wm8731_set_bias_level(codec, SND_SOC_BIAS_STANDBY); + + /* Latch the update bits */ + reg = wm8731_read_reg_cache(codec, WM8731_LOUT1V); + wm8731_write(codec, WM8731_LOUT1V, reg & ~0x0100); + reg = wm8731_read_reg_cache(codec, WM8731_ROUT1V); + wm8731_write(codec, WM8731_ROUT1V, reg & ~0x0100); + reg = wm8731_read_reg_cache(codec, WM8731_LINVOL); + wm8731_write(codec, WM8731_LINVOL, reg & ~0x0100); + reg = wm8731_read_reg_cache(codec, WM8731_RINVOL); + wm8731_write(codec, WM8731_RINVOL, reg & ~0x0100); + + wm8731_codec = codec; + + ret = snd_soc_register_codec(codec); + if (ret != 0) { + dev_err(codec->dev, "Failed to register codec: %d\n", ret); + return ret; + } + + ret = snd_soc_register_dai(&wm8731_dai); + if (ret != 0) { + dev_err(codec->dev, "Failed to register DAI: %d\n", ret); + snd_soc_unregister_codec(codec); + return ret; + }
-static int __devexit wm8731_spi_remove(struct spi_device *spi) -{ return 0; }
-static struct spi_driver wm8731_spi_driver = { - .driver = { - .name = "wm8731", - .bus = &spi_bus_type, - .owner = THIS_MODULE, - }, - .probe = wm8731_spi_probe, - .remove = __devexit_p(wm8731_spi_remove), -}; +static void wm8731_unregister(struct wm8731_priv *wm8731) +{ + wm8731_set_bias_level(&wm8731->codec, SND_SOC_BIAS_OFF); + snd_soc_unregister_dai(&wm8731_dai); + snd_soc_unregister_codec(&wm8731->codec); + kfree(wm8731); + wm8731_codec = NULL; +}
+#if defined(CONFIG_SPI_MASTER) static int wm8731_spi_write(struct spi_device *spi, const char *data, int len) { struct spi_transfer t; @@ -730,37 +640,67 @@ static int wm8731_spi_write(struct spi_device *spi, const char *data, int len)
return len; } + +static int __devinit wm8731_spi_probe(struct spi_device *spi) +{ + struct snd_soc_codec *codec; + struct wm8731_priv *wm8731; + + wm8731 = kzalloc(sizeof(struct wm8731_priv), GFP_KERNEL); + if (wm8731 == NULL) + return -ENOMEM; + + codec = &wm8731->codec; + codec->control_data = spi; + codec->hw_write = (hw_write_t)wm8731_spi_write; + codec->dev = &spi->dev; + + return wm8731_register(wm8731); +} + +static int __devexit wm8731_spi_remove(struct spi_device *spi) +{ + /* FIXME: This isn't actually implemented... */ + return 0; +} + +static struct spi_driver wm8731_spi_driver = { + .driver = { + .name = "wm8731", + .bus = &spi_bus_type, + .owner = THIS_MODULE, + }, + .probe = wm8731_spi_probe, + .remove = __devexit_p(wm8731_spi_remove), +}; #endif /* CONFIG_SPI_MASTER */
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) -/* - * WM8731 2 wire address is determined by GPIO5 - * state during powerup. - * low = 0x1a - * high = 0x1b - */ - static int wm8731_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id) { - struct snd_soc_device *socdev = wm8731_socdev; - struct snd_soc_codec *codec = socdev->card->codec; - int ret; + struct wm8731_priv *wm8731; + struct snd_soc_codec *codec;
- i2c_set_clientdata(i2c, codec); + wm8731 = kzalloc(sizeof(struct wm8731_priv), GFP_KERNEL); + if (wm8731 == NULL) + return -ENOMEM; + + codec = &wm8731->codec; + codec->hw_write = (hw_write_t)i2c_master_send; + + i2c_set_clientdata(i2c, wm8731); codec->control_data = i2c;
- ret = wm8731_init(socdev); - if (ret < 0) - pr_err("failed to initialise WM8731\n"); + codec->dev = &i2c->dev;
- return ret; + return wm8731_register(wm8731); }
static int wm8731_i2c_remove(struct i2c_client *client) { - struct snd_soc_codec *codec = i2c_get_clientdata(client); - kfree(codec->reg_cache); + struct wm8731_priv *wm8731 = i2c_get_clientdata(client); + wm8731_unregister(wm8731); return 0; }
@@ -783,13 +723,33 @@ static struct i2c_driver wm8731_i2c_driver = {
static int __init wm8731_modinit(void) { - return snd_soc_register_dai(&wm8731_dai); + int ret; +#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) + ret = i2c_add_driver(&wm8731_i2c_driver); + if (ret != 0) { + printk(KERN_ERR "Failed to register WM8731 I2C driver: %d\n", + ret); + } +#endif +#if defined(CONFIG_SPI_MASTER) + ret = spi_register_driver(&wm8731_spi_driver); + if (ret != 0) { + printk(KERN_ERR "Failed to register WM8731 SPI driver: %d\n", + ret); + } +#endif + return 0; } module_init(wm8731_modinit);
static void __exit wm8731_exit(void) { - snd_soc_unregister_dai(&wm8731_dai); +#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) + i2c_del_driver(&wm8731_i2c_driver); +#endif +#if defined(CONFIG_SPI_MASTER) + spi_unregister_driver(&wm8731_spi_driver); +#endif } module_exit(wm8731_exit);
diff --git a/sound/soc/codecs/wm8731.h b/sound/soc/codecs/wm8731.h index 95190e9..cd7b806 100644 --- a/sound/soc/codecs/wm8731.h +++ b/sound/soc/codecs/wm8731.h @@ -34,12 +34,6 @@ #define WM8731_SYSCLK 0 #define WM8731_DAI 0
-struct wm8731_setup_data { - int spi; - int i2c_bus; - unsigned short i2c_address; -}; - extern struct snd_soc_dai wm8731_dai; extern struct snd_soc_codec_device soc_codec_dev_wm8731;
diff --git a/sound/soc/pxa/corgi.c b/sound/soc/pxa/corgi.c index 0d41be3..eaa6691 100644 --- a/sound/soc/pxa/corgi.c +++ b/sound/soc/pxa/corgi.c @@ -317,19 +317,44 @@ static struct snd_soc_card snd_soc_corgi = { .num_links = 1, };
-/* corgi audio private data */ -static struct wm8731_setup_data corgi_wm8731_setup = { - .i2c_bus = 0, - .i2c_address = 0x1b, -}; - /* corgi audio subsystem */ static struct snd_soc_device corgi_snd_devdata = { .card = &snd_soc_corgi, .codec_dev = &soc_codec_dev_wm8731, - .codec_data = &corgi_wm8731_setup, };
+/* + * FIXME: This is a temporary bodge to avoid cross-tree merge issues. + * New drivers should register the wm8731 I2C device in the machine + * setup code (under arch/arm for ARM systems). + */ +static int wm8731_i2c_register(void) +{ + struct i2c_board_info info; + struct i2c_adapter *adapter; + struct i2c_client *client; + + memset(&info, 0, sizeof(struct i2c_board_info)); + info.addr = 0x1b; + strlcpy(info.type, "wm8731", I2C_NAME_SIZE); + + adapter = i2c_get_adapter(0); + if (!adapter) { + printk(KERN_ERR "can't get i2c adapter 0\n"); + return -ENODEV; + } + + client = i2c_new_device(adapter, &info); + i2c_put_adapter(adapter); + if (!client) { + printk(KERN_ERR "can't add i2c device at 0x%x\n", + (unsigned int)info.addr); + return -ENODEV; + } + + return 0; +} + static struct platform_device *corgi_snd_device;
static int __init corgi_init(void) @@ -340,6 +365,10 @@ static int __init corgi_init(void) machine_is_husky())) return -ENODEV;
+ ret = wm8731_i2c_setup(); + if (ret != 0) + return ret; + corgi_snd_device = platform_device_alloc("soc-audio", -1); if (!corgi_snd_device) return -ENOMEM; diff --git a/sound/soc/pxa/poodle.c b/sound/soc/pxa/poodle.c index 3a62d43..fd683a0 100644 --- a/sound/soc/pxa/poodle.c +++ b/sound/soc/pxa/poodle.c @@ -283,17 +283,42 @@ static struct snd_soc_card snd_soc_poodle = { .num_links = 1, };
-/* poodle audio private data */ -static struct wm8731_setup_data poodle_wm8731_setup = { - .i2c_bus = 0, - .i2c_address = 0x1b, -}; +/* + * FIXME: This is a temporary bodge to avoid cross-tree merge issues. + * New drivers should register the wm8731 I2C device in the machine + * setup code (under arch/arm for ARM systems). + */ +static int wm8731_i2c_register(void) +{ + struct i2c_board_info info; + struct i2c_adapter *adapter; + struct i2c_client *client; + + memset(&info, 0, sizeof(struct i2c_board_info)); + info.addr = 0x1b; + strlcpy(info.type, "wm8731", I2C_NAME_SIZE); + + adapter = i2c_get_adapter(0); + if (!adapter) { + printk(KERN_ERR "can't get i2c adapter 0\n"); + return -ENODEV; + } + + client = i2c_new_device(adapter, &info); + i2c_put_adapter(adapter); + if (!client) { + printk(KERN_ERR "can't add i2c device at 0x%x\n", + (unsigned int)info.addr); + return -ENODEV; + } + + return 0; +}
/* poodle audio subsystem */ static struct snd_soc_device poodle_snd_devdata = { .card = &snd_soc_poodle, .codec_dev = &soc_codec_dev_wm8731, - .codec_data = &poodle_wm8731_setup, };
static struct platform_device *poodle_snd_device; @@ -305,6 +330,10 @@ static int __init poodle_init(void) if (!machine_is_poodle()) return -ENODEV;
+ ret = wm8731_i2c_setup(); + if (ret != 0) + return ret; + locomo_gpio_set_dir(&poodle_locomo_device.dev, POODLE_LOCOMO_GPIO_AMP_ON, 0); /* should we mute HP at startup - burning power ?*/
Signed-off-by: Mark Brown broonie@opensource.wolfsonmicro.com --- sound/soc/codecs/wm8753.c | 4 ---- 1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c index dc6042c..31ff337 100644 --- a/sound/soc/codecs/wm8753.c +++ b/sound/soc/codecs/wm8753.c @@ -51,8 +51,6 @@
#include "wm8753.h"
-#define WM8753_VERSION "0.16" - static int caps_charge = 2000; module_param(caps_charge, int, 0); MODULE_PARM_DESC(caps_charge, "WM8753 cap charge time (msecs)"); @@ -1778,8 +1776,6 @@ static int wm8753_probe(struct platform_device *pdev) struct wm8753_priv *wm8753; int ret = 0;
- pr_info("WM8753 Audio Codec %s", WM8753_VERSION); - setup = socdev->codec_data; codec = kzalloc(sizeof(struct snd_soc_codec), GFP_KERNEL); if (codec == NULL)
At Wed, 18 Feb 2009 12:01:37 +0000, Mark Brown wrote:
The following changes since commit f1464ede550b8fda75086cb9bacf8d60fc9f6780: Takashi Iwai (1): Merge branch 'for-2.6.30' of git://git.kernel.org/.../broonie/sound-2.6 into topic/asoc
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git for-2.6.30
Pulled now. Thanks.
Takashi
At Wed, 18 Feb 2009 13:18:23 +0100, I wrote:
At Wed, 18 Feb 2009 12:01:37 +0000, Mark Brown wrote:
The following changes since commit f1464ede550b8fda75086cb9bacf8d60fc9f6780: Takashi Iwai (1): Merge branch 'for-2.6.30' of git://git.kernel.org/.../broonie/sound-2.6 into topic/asoc
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git for-2.6.30
Pulled now. Thanks.
I get the following warning with my build test: sound/soc/codecs/wm8731.c:611: warning: 'wm8731_unregister' defined but not used
Could you fix it?
thanks,
Takashi
At Wed, 18 Feb 2009 13:22:08 +0100, I wrote:
At Wed, 18 Feb 2009 13:18:23 +0100, I wrote:
At Wed, 18 Feb 2009 12:01:37 +0000, Mark Brown wrote:
The following changes since commit f1464ede550b8fda75086cb9bacf8d60fc9f6780: Takashi Iwai (1): Merge branch 'for-2.6.30' of git://git.kernel.org/.../broonie/sound-2.6 into topic/asoc
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git for-2.6.30
Pulled now. Thanks.
I get the following warning with my build test: sound/soc/codecs/wm8731.c:611: warning: 'wm8731_unregister' defined but not used
Could you fix it?
... and pxa/* drivers don't build. Missing i2c updates?
sound/soc/pxa/corgi.c: In function 'wm8731_i2c_register': sound/soc/pxa/corgi.c:333: error: storage size of 'info' isn't known sound/soc/pxa/corgi.c:337: error: invalid application of 'sizeof' to incomplete type 'struct i2c_board_info' sound/soc/pxa/corgi.c:339: error: 'I2C_NAME_SIZE' undeclared (first use in this function) sound/soc/pxa/corgi.c:339: error: (Each undeclared identifier is reported only once sound/soc/pxa/corgi.c:339: error: for each function it appears in.) sound/soc/pxa/corgi.c:341: error: implicit declaration of function 'i2c_get_adapter' sound/soc/pxa/corgi.c:341: warning: assignment makes pointer from integer without a cast sound/soc/pxa/corgi.c:347: error: implicit declaration of function 'i2c_new_device' sound/soc/pxa/corgi.c:347: warning: assignment makes pointer from integer without a cast sound/soc/pxa/corgi.c:348: error: implicit declaration of function 'i2c_put_adapter' sound/soc/pxa/corgi.c:333: warning: unused variable 'info' sound/soc/pxa/corgi.c: In function 'corgi_init': sound/soc/pxa/corgi.c:368: error: implicit declaration of function 'wm8731_i2c_setup'
Takashi
On Wed, Feb 18, 2009 at 01:27:13PM +0100, Takashi Iwai wrote:
... and pxa/* drivers don't build. Missing i2c updates?
Yes, I'll send a patch shortly.
I've never been able to get the underlying platform support for those machines to build, could you send me the .config you're using for testing, please? It's possible that they've been fixed since I last tried, I know people have been working on them a bit.
At Wed, 18 Feb 2009 12:37:20 +0000, Mark Brown wrote:
On Wed, Feb 18, 2009 at 01:27:13PM +0100, Takashi Iwai wrote:
... and pxa/* drivers don't build. Missing i2c updates?
Yes, I'll send a patch shortly.
I've never been able to get the underlying platform support for those machines to build, could you send me the .config you're using for testing, please? It's possible that they've been fixed since I last tried, I know people have been working on them a bit.
Attached below for corgi. It was generated by KCONFIG_ALLCONFIG=arch/arm/configs/corgi_defconfig make allyesconfig
Takashi
At Wed, 18 Feb 2009 12:29:54 +0000, Mark Brown wrote:
On Wed, Feb 18, 2009 at 01:22:08PM +0100, Takashi Iwai wrote:
I get the following warning with my build test: sound/soc/codecs/wm8731.c:611: warning: 'wm8731_unregister' defined but not used
Could you fix it?
What config are you running - is CONFIG_I2C undefined?
Yes. Only CONFIG_SPI=y.
Takashi
participants (2)
-
Mark Brown
-
Takashi Iwai