[PATCHv2,05/11] ASoc: si476x: Remove the set_cache_io() entirely from ASoC probe.
diff mbox

Message ID 1395812433-26410-6-git-send-email-Li.Xiubo@freescale.com
State Accepted
Commit 83905ef3cbd0025830e9db65bf5ce7db721e39a7
Headers show

Commit Message

Xiubo Li March 26, 2014, 5:40 a.m. UTC
As we can set the CODEC I/O while snd_soc_register_codec(), so the
calling of set_cache_io() from CODEC ASoC probe could be removed
entirely.

And then we can set the CODEC I/O in the device probe instead of
CODEC ASoC probe as earily as possible.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
---
 sound/soc/codecs/si476x.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

Comments

Andrey Smirnov March 27, 2014, 2:41 p.m. UTC | #1
On Tue, Mar 25, 2014 at 10:40 PM, Xiubo Li <Li.Xiubo@freescale.com> wrote:
> As we can set the CODEC I/O while snd_soc_register_codec(), so the
> calling of set_cache_io() from CODEC ASoC probe could be removed
> entirely.
>
> And then we can set the CODEC I/O in the device probe instead of
> CODEC ASoC probe as earily as possible.
>
> Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
> ---
>  sound/soc/codecs/si476x.c | 14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/sound/soc/codecs/si476x.c b/sound/soc/codecs/si476x.c
> index 244c097..961b7e8 100644
> --- a/sound/soc/codecs/si476x.c
> +++ b/sound/soc/codecs/si476x.c
> @@ -208,13 +208,6 @@ out:
>         return err;
>  }
>
> -static int si476x_codec_probe(struct snd_soc_codec *codec)
> -{
> -       struct regmap *regmap = dev_get_regmap(codec->dev->parent, NULL);
> -
> -       return snd_soc_codec_set_cache_io(codec, regmap);
> -}
> -
>  static struct snd_soc_dai_ops si476x_dai_ops = {
>         .hw_params      = si476x_codec_hw_params,
>         .set_fmt        = si476x_codec_set_dai_fmt,
> @@ -238,8 +231,13 @@ static struct snd_soc_dai_driver si476x_dai = {
>         .ops            = &si476x_dai_ops,
>  };
>
> +struct regmap *si476x_get_regmap(struct device *dev)
> +{
> +       return dev_get_regmap(dev->parent, NULL);
> +}
> +
>  static struct snd_soc_codec_driver soc_codec_dev_si476x = {
> -       .probe  = si476x_codec_probe,
> +       .get_regmap = si476x_get_regmap,
>         .dapm_widgets = si476x_dapm_widgets,
>         .num_dapm_widgets = ARRAY_SIZE(si476x_dapm_widgets),
>         .dapm_routes = si476x_dapm_routes,
> --
> 1.8.4
>
>

Acked-by: Andrey Smirnov <andrew.smirnov@gmail.com>

Patch
diff mbox

diff --git a/sound/soc/codecs/si476x.c b/sound/soc/codecs/si476x.c
index 244c097..961b7e8 100644
--- a/sound/soc/codecs/si476x.c
+++ b/sound/soc/codecs/si476x.c
@@ -208,13 +208,6 @@  out:
 	return err;
 }
 
-static int si476x_codec_probe(struct snd_soc_codec *codec)
-{
-	struct regmap *regmap = dev_get_regmap(codec->dev->parent, NULL);
-
-	return snd_soc_codec_set_cache_io(codec, regmap);
-}
-
 static struct snd_soc_dai_ops si476x_dai_ops = {
 	.hw_params	= si476x_codec_hw_params,
 	.set_fmt	= si476x_codec_set_dai_fmt,
@@ -238,8 +231,13 @@  static struct snd_soc_dai_driver si476x_dai = {
 	.ops		= &si476x_dai_ops,
 };
 
+struct regmap *si476x_get_regmap(struct device *dev)
+{
+	return dev_get_regmap(dev->parent, NULL);
+}
+
 static struct snd_soc_codec_driver soc_codec_dev_si476x = {
-	.probe  = si476x_codec_probe,
+	.get_regmap = si476x_get_regmap,
 	.dapm_widgets = si476x_dapm_widgets,
 	.num_dapm_widgets = ARRAY_SIZE(si476x_dapm_widgets),
 	.dapm_routes = si476x_dapm_routes,