From: Liam Girdwood <lrg@slimlogic.co.uk>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: alsa-devel@alsa-project.org, Lars-Peter Clausen <lars@metafoo.de>,
patches@opensource.wolfsonmicro.com
Subject: Re: [PATCH] ASoC: Reintroduce do_spi_write()
Date: Thu, 12 May 2011 09:42:21 +0100 [thread overview]
Message-ID: <1305189742.3369.1.camel@odin> (raw)
In-Reply-To: <1305134752-20571-1-git-send-email-broonie@opensource.wolfsonmicro.com>
On Wed, 2011-05-11 at 19:25 +0200, Mark Brown wrote:
> There is an unfortunate difference in return values between spi_write()
> and i2c_master_send() so we need an adaptor function to translate.
>
> Reported-by: Lars-Peter Clausen <lars@metafoo.de>
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---
> sound/soc/soc-cache.c | 16 +++++++++++++++-
> 1 files changed, 15 insertions(+), 1 deletions(-)
>
> diff --git a/sound/soc/soc-cache.c b/sound/soc/soc-cache.c
> index 04861c4..dee86fc 100644
> --- a/sound/soc/soc-cache.c
> +++ b/sound/soc/soc-cache.c
> @@ -20,6 +20,20 @@
>
> #include <trace/events/asoc.h>
>
> +#ifdef CONFIG_SPI_MASTER
> +static int do_spi_write(void *control, const char *data, int len)
> +{
> + struct spi_device *spi = control;
> + int ret;
> +
> + ret = spi_write(spi, data, len);
> + if (ret < 0)
> + return ret;
> +
> + return len;
> +}
> +#endif
> +
> static int do_hw_write(struct snd_soc_codec *codec, unsigned int reg,
> unsigned int value, const void *data, int len)
> {
> @@ -409,7 +423,7 @@ int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec,
>
> case SND_SOC_SPI:
> #ifdef CONFIG_SPI_MASTER
> - codec->hw_write = (hw_write_t)spi_write;
> + codec->hw_write = do_spi_write;
> #endif
>
> codec->control_data = container_of(codec->dev,
Acked-by: Liam Girdwood <lrg@ti.com>
prev parent reply other threads:[~2011-05-12 8:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-11 17:25 [PATCH] ASoC: Reintroduce do_spi_write() Mark Brown
2011-05-11 19:05 ` [PATCH] ASoC: snd_soc_hw_bulk_write_raw: Use the codec's hw_write callback Lars-Peter Clausen
2011-05-11 20:00 ` Mark Brown
2011-05-12 8:42 ` Liam Girdwood [this message]
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=1305189742.3369.1.camel@odin \
--to=lrg@slimlogic.co.uk \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=lars@metafoo.de \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.