ASoC: Fix twl4030 and 6040 regression by adding back read and write

"Linux Kernel Mailing List" <[email protected]>
Newsgroups gmane.linux.kernel.commits.head
Message-ID <[email protected]>
Web:        https://git.kernel.org/torvalds/c/8146acff3b80327f2a23710f2674a79a7fa80de3
Commit:     8146acff3b80327f2a23710f2674a79a7fa80de3
Parent:     0b5eca67bd2d0e6f6d0ccdc316aced0cc4bf2e9f
Refname:    refs/heads/master
Author:     Tony Lindgren <[email protected]>
AuthorDate: Thu Jan 25 09:35:05 2018 -0800
Committer:  Mark Brown <[email protected]>
CommitDate: Thu Jan 25 18:20:26 2018 +0000

    ASoC: Fix twl4030 and 6040 regression by adding back read and write
    
    Commit 3bb0f7c31b1a ("ASoC: don't use snd_soc_write/read on twl4030")
    caused regressions for both twl4030 and twl6040 as it assumes the
    ASoC driver is using regmap. As a side effect, this also causes a
    considerable increase in idle power consumption omap3 boards using
    twl4030 as the PMIC.
    
    This is because the removal of read and write function pointers
    causes some of the ASoC IO functions to not do anything. For example,
    snd_soc_register_card() calls snd_soc_dapm_new_widgets() that calls
    snd_soc_codec_drv_read() that now does nothing.
    
    A long term solution suggested by Mark Brown <[email protected]>
    is to make the twl drivers use regmap by adding a call to
    snd_soc_codec_set_regmap(). This however needs more consideration
    as currently the driver internal reads do caching and we would have
    both regmap access and internal read/write access accessing the same
    hardware registers.
    
    So to fix the regression, let's just do a partial revert adding back
    the read and write function pointers. Note that other non-regmap
    ASoC drivers may need similar patches.
    
    Fixes: 3bb0f7c31b1a ("ASoC: don't use snd_soc_write/read on twl4030")
    Fixes: 93a00c467fe9 ("ASoC: don't use snd_soc_write/read on twl6040")
    Acked-by: Kuninori Morimoto <[email protected]>
    Acked-by: Peter Ujfalusi <[email protected]>
    Signed-off-by: Tony Lindgren <[email protected]>
    Signed-off-by: Mark Brown <[email protected]>
---
 sound/soc/codecs/twl4030.c | 2 ++
 sound/soc/codecs/twl6040.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
index 8798182959c1..e4d7f397d361 100644
--- a/sound/soc/codecs/twl4030.c
+++ b/sound/soc/codecs/twl4030.c
@@ -2195,6 +2195,8 @@ static int twl4030_soc_remove(struct snd_soc_codec *codec)
 static const struct snd_soc_codec_driver soc_codec_dev_twl4030 = {
 	.probe = twl4030_soc_probe,
 	.remove = twl4030_soc_remove,
+	.read = twl4030_read,
+	.write = twl4030_write,
 	.set_bias_level = twl4030_set_bias_level,
 	.idle_bias_off = true,
 
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index 3b895b4b451c..573a523ed0b3 100644
--- a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -1158,6 +1158,8 @@ static int twl6040_remove(struct snd_soc_codec *codec)
 static const struct snd_soc_codec_driver soc_codec_dev_twl6040 = {
 	.probe = twl6040_probe,
 	.remove = twl6040_remove,
+	.read = twl6040_read,
+	.write = twl6040_write,
 	.set_bias_level = twl6040_set_bias_level,
 	.suspend_bias_off = true,
 	.ignore_pmdown_time = true,
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.