All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org, linaro-kernel@lists.linaro.org,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@linaro.org>
Subject: Re: [PATCH] ASoC: io: Remove hw_read() operation
Date: Tue, 04 Mar 2014 10:20:16 +0100	[thread overview]
Message-ID: <53159AD0.5000800@metafoo.de> (raw)
In-Reply-To: <1393924251-6754-1-git-send-email-broonie@kernel.org>

On 03/04/2014 10:10 AM, Mark Brown wrote:
> From: Mark Brown <broonie@linaro.org>
>
> We now no longer have any users of hw_read() in the kernel so remove the
> code in order to prevent any new users being added. Users should be using
> regmap.
>
> Signed-off-by: Mark Brown <broonie@linaro.org>
> ---
>   include/sound/soc.h |  1 -
>   sound/soc/soc-io.c  | 13 -------------
>   2 files changed, 14 deletions(-)
>
> diff --git a/include/sound/soc.h b/include/sound/soc.h
> index 56c4c71..dc36331 100644
> --- a/include/sound/soc.h
> +++ b/include/sound/soc.h
> @@ -706,7 +706,6 @@ struct snd_soc_codec {
>   	/* codec IO */
>   	void *control_data; /* codec control (i2c/3wire) data */
>   	hw_write_t hw_write;
> -	unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int);

This part is OK.

>   	unsigned int (*read)(struct snd_soc_codec *, unsigned int);
>   	int (*write)(struct snd_soc_codec *, unsigned int, unsigned int);
>   	void *reg_cache;
> diff --git a/sound/soc/soc-io.c b/sound/soc/soc-io.c
> index c3b6a0a..3c1de9c 100644
> --- a/sound/soc/soc-io.c
> +++ b/sound/soc/soc-io.c
> @@ -26,18 +26,6 @@ static int hw_write(struct snd_soc_codec *codec, unsigned int reg,
>   	return regmap_write(codec->control_data, reg, value);
>   }
>
> -static unsigned int hw_read(struct snd_soc_codec *codec, unsigned int reg)
> -{
> -	int ret;
> -	unsigned int val;
> -
> -	ret = regmap_read(codec->control_data, reg, &val);
> -	if (ret == 0)
> -		return val;
> -	else
> -		return -1;
> -}
> -
>   /**
>    * snd_soc_codec_set_cache_io: Set up standard I/O functions.
>    *
> @@ -64,7 +52,6 @@ int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec,
>   	int ret;
>
>   	codec->write = hw_write;
> -	codec->read = hw_read;

But this part will break snd_soc_read() and with it basically every driver 
that has any controls or DAPM widgets.

I do have a set of patches that moves IO to the component level that will 
clean this all up quite a bit. I'm just waiting for Xiubo Li 
snd_soc_codec_set_cache_io() cleanup to be merged first, since it will make 
things a bit simpler.

>
>   	switch (control) {
>   	case SND_SOC_REGMAP:
>

  reply	other threads:[~2014-03-04  9:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-04  9:10 [PATCH] ASoC: io: Remove hw_read() operation Mark Brown
2014-03-04  9:20 ` Lars-Peter Clausen [this message]
2014-03-04  9:27   ` Mark Brown
2014-03-04  9:45     ` Lars-Peter Clausen
2014-03-04 10:11       ` Mark Brown
2014-03-04 11:25         ` Lars-Peter Clausen
2014-03-05  1:25           ` Mark Brown

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=53159AD0.5000800@metafoo.de \
    --to=lars@metafoo.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=broonie@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linaro-kernel@lists.linaro.org \
    /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.