From: Liam Girdwood <lrg@ti.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
"patches@opensource.wolfsonmicro.com"
<patches@opensource.wolfsonmicro.com>
Subject: Re: [PATCH 2/2] ASoC: Add SPI support for WM8741
Date: Tue, 9 Aug 2011 13:28:58 +0100 [thread overview]
Message-ID: <4E41280A.7030800@ti.com> (raw)
In-Reply-To: <1312361229-30722-2-git-send-email-broonie@opensource.wolfsonmicro.com>
On 03/08/11 09:47, Mark Brown wrote:
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---
Could not see 1/2
but 2/2
Acked-by: Liam Girdwood <lrg@ti.com>
> sound/soc/codecs/wm8741.c | 48 +++++++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 48 insertions(+), 0 deletions(-)
>
> diff --git a/sound/soc/codecs/wm8741.c b/sound/soc/codecs/wm8741.c
> index d4bfffd..c1b6e91 100644
> --- a/sound/soc/codecs/wm8741.c
> +++ b/sound/soc/codecs/wm8741.c
> @@ -17,6 +17,7 @@
> #include <linux/delay.h>
> #include <linux/pm.h>
> #include <linux/i2c.h>
> +#include <linux/spi/spi.h>
> #include <linux/platform_device.h>
> #include <linux/regulator/consumer.h>
> #include <linux/slab.h>
> @@ -549,6 +550,43 @@ static struct i2c_driver wm8741_i2c_driver = {
> };
> #endif
>
> +#if defined(CONFIG_SPI_MASTER)
> +static int __devinit wm8741_spi_probe(struct spi_device *spi)
> +{
> + struct wm8741_priv *wm8741;
> + int ret;
> +
> + wm8741 = kzalloc(sizeof(struct wm8741_priv), GFP_KERNEL);
> + if (wm8741 == NULL)
> + return -ENOMEM;
> +
> + wm8741->control_type = SND_SOC_SPI;
> + spi_set_drvdata(spi, wm8741);
> +
> + ret = snd_soc_register_codec(&spi->dev,
> + &soc_codec_dev_wm8741, &wm8741_dai, 1);
> + if (ret < 0)
> + kfree(wm8741);
> + return ret;
> +}
> +
> +static int __devexit wm8741_spi_remove(struct spi_device *spi)
> +{
> + snd_soc_unregister_codec(&spi->dev);
> + kfree(spi_get_drvdata(spi));
> + return 0;
> +}
> +
> +static struct spi_driver wm8741_spi_driver = {
> + .driver = {
> + .name = "wm8741",
> + .owner = THIS_MODULE,
> + },
> + .probe = wm8741_spi_probe,
> + .remove = __devexit_p(wm8741_spi_remove),
> +};
> +#endif /* CONFIG_SPI_MASTER */
> +
> static int __init wm8741_modinit(void)
> {
> int ret = 0;
> @@ -558,6 +596,13 @@ static int __init wm8741_modinit(void)
> if (ret != 0)
> pr_err("Failed to register WM8741 I2C driver: %d\n", ret);
> #endif
> +#if defined(CONFIG_SPI_MASTER)
> + ret = spi_register_driver(&wm8741_spi_driver);
> + if (ret != 0) {
> + printk(KERN_ERR "Failed to register wm8741 SPI driver: %d\n",
> + ret);
> + }
> +#endif
>
> return ret;
> }
> @@ -565,6 +610,9 @@ module_init(wm8741_modinit);
>
> static void __exit wm8741_exit(void)
> {
> +#if defined(CONFIG_SPI_MASTER)
> + spi_unregister_driver(&wm8741_spi_driver);
> +#endif
> #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
> i2c_del_driver(&wm8741_i2c_driver);
> #endif
next prev parent reply other threads:[~2011-08-09 12:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-03 8:47 [PATCH 1/2] ASoC: Refactor WM8741 regulator handling into CODEC generic code Mark Brown
2011-08-03 8:47 ` [PATCH 2/2] ASoC: Add SPI support for WM8741 Mark Brown
2011-08-09 12:28 ` Liam Girdwood [this message]
2011-08-09 15:08 ` Mark Brown
2011-08-09 15:29 ` Liam Girdwood
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E41280A.7030800@ti.com \
--to=lrg@ti.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=patches@opensource.wolfsonmicro.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox