From: Xiubo Li
Date: Wed, 26 Mar 2014 05:40:27 +0000 (+0800)
Subject: ASoC: si476x: Remove the set_cache_io() entirely from ASoC probe.
X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=83905ef3cbd0025830e9db65bf5ce7db721e39a7;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git
ASoC: si476x: Remove the set_cache_io() entirely from ASoC probe.
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
Acked-by: Andrey Smirnov
Signed-off-by: Mark Brown
---
diff --git a/sound/soc/codecs/si476x.c b/sound/soc/codecs/si476x.c
index 244c097cd905..961b7e8ac0da 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,