All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Sergey Kiselev <sergey.kiselev@intel.com>, alsa-devel@alsa-project.org
Cc: liam.r.girdwood@linux.intel.com, Girdwood@alsa-project.org,
	Mark Brown <broonie@kernel.org>,
	Liam@alsa-project.org,
	Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Subject: Re: [PATCH] ASoC: wm8731: initialize the hardware when loading the codec driver; use regmap for I/O
Date: Mon, 01 Jun 2015 11:03:09 +0200	[thread overview]
Message-ID: <556C1FCD.1070905@metafoo.de> (raw)
In-Reply-To: <20150530003455.4c4d67eb444b1ceb45d3148c@intel.com>

On 05/30/2015 09:34 AM, Sergey Kiselev wrote:
> Hi,
>
> This patch moves the request supplies and hardware reset and initialization
> from wm8731_probe to wm8731_i2c_probe and wm8731_spi_probe. So that the
> codec hardware is initialized when loading the codec driver, and not when
> loading the machine driver.
> The I/O is converted to regmap_write and regmap_update_bits. (Mostly as a side
> effect, since snd_soc_write and friends won't work before snd_soc_register_codec
> is called)
>
> Signed-off-by: Sergey Kiselev <sergey.kiselev@intel.com>

Hi,

It looks like the patch has been made against an older tree. It will not 
apply on-top of ASoC for-next branch.

> ---
[...]
>   static const char *wm8731_input_select[] = {"Line In", "Mic"};
>
> @@ -118,7 +118,7 @@ static int wm8731_set_deemph(struct snd_soc_codec *codec)
>   	dev_dbg(codec->dev, "Set deemphasis %d (%dHz)\n",
>   		best, wm8731_deemph[best]);
>
> -	return snd_soc_update_bits(codec, WM8731_APDIGI, 0x6, val);
> +	return regmap_update_bits(wm8731->regmap, WM8731_APDIGI, 0x6, val);

There is no need to replace all the snd_soc_${io}() calls with 
regmap_${io}(). The snd_soc methods will just call the corresponding regmap 
method internally. But if you really want to do it this should be done in a 
separate patch.

>   }
>
[...]
> @@ -573,42 +571,53 @@ static struct snd_soc_dai_driver wm8731_dai = {
>
>   static int wm8731_probe(struct snd_soc_codec *codec)
>   {
> -	struct wm8731_priv *wm8731 = snd_soc_codec_get_drvdata(codec);
> -	int ret = 0, i;
> +	wm8731_set_bias_level(codec, SND_SOC_BIAS_STANDBY);

This is not necessary, the core will put the CODEC into BIAS_STANDBY mode, 
after the probe callback has been called. So the whole probe function can be 
dropped.

> +
> +	return 0;
> +}
[...]
>   static int wm8731_remove(struct snd_soc_codec *codec)
>   {
> -	struct wm8731_priv *wm8731 = snd_soc_codec_get_drvdata(codec);
> -
> -	regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies), wm8731->supplies);
> +	wm8731_set_bias_level(codec, SND_SOC_BIAS_OFF);

Same here, the core already puts the CODEC into BIAS_OFF mode before the 
remove callback is called.

>
>   	return 0;
>   }

  reply	other threads:[~2015-06-01  9:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-30  7:34 [PATCH] ASoC: wm8731: initialize the hardware when loading the codec driver; use regmap for I/O Sergey Kiselev
2015-06-01  9:03 ` Lars-Peter Clausen [this message]
2015-06-02 18:33   ` Sergey Kiselev
2015-06-02 20:12     ` 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=556C1FCD.1070905@metafoo.de \
    --to=lars@metafoo.de \
    --cc=Girdwood@alsa-project.org \
    --cc=Liam@alsa-project.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=rf@opensource.wolfsonmicro.com \
    --cc=sergey.kiselev@intel.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.