From: Xiubo Li <Li.Xiubo@freescale.com>
To: thierry.reding@gmail.com
Cc: linux-pwm@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, Xiubo Li <Li.Xiubo@freescale.com>
Subject: [PATCHv3 3/3] ASoC: core: Fix check before setting default I/O up try regmap
Date: Mon, 3 Mar 2014 10:36:39 +0800 [thread overview]
Message-ID: <1393814199-9937-4-git-send-email-Li.Xiubo@freescale.com> (raw)
In-Reply-To: <1393814199-9937-1-git-send-email-Li.Xiubo@freescale.com>
Since the CODEC driver could specify its own I/O(read and write)
while registering the CODEC for some reason, maybe the MFDs is
used, etc.
So just do check it, if they are not specified by CODEC driver
then try to set up the default regmap I/O if regmap is used.
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
---
sound/soc/soc-core.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 6880fad..a14155b 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1137,9 +1137,15 @@ static int soc_probe_codec(struct snd_soc_card *card,
codec->dapm.idle_bias_off = driver->idle_bias_off;
- /* Set the default I/O up try regmap */
- if (dev_get_regmap(codec->dev, NULL))
- snd_soc_codec_set_cache_io(codec, NULL);
+ if (!codec->write && dev_get_regmap(codec->dev, NULL)) {
+ /* Set the default I/O up try regmap */
+ ret = snd_soc_codec_set_cache_io(codec, NULL);
+ if (ret < 0) {
+ dev_err(codec->dev,
+ "Failed to set cache I/O: %d\n", ret);
+ goto err_probe;
+ }
+ }
if (driver->probe) {
ret = driver->probe(codec);
--
1.8.4
prev parent reply other threads:[~2014-03-03 2:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-03 2:36 [PATCHv3 0/3] Simplify the CODEC ASoC probe code Xiubo Li
2014-03-03 2:36 ` [PATCHv3 1/3] ASoC: codec: Simplify " Xiubo Li
2014-03-03 2:36 ` [PATCHv3 2/3] ASoC: io: New signature for snd_soc_codec_set_cache_io() Xiubo Li
2014-03-03 2:36 ` Xiubo Li [this message]
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=1393814199-9937-4-git-send-email-Li.Xiubo@freescale.com \
--to=li.xiubo@freescale.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=thierry.reding@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).