From: Xiubo Li <Li.Xiubo@freescale.com> To: <broonie@kernel.org>, <lars@metafoo.de>, <alsa-devel@alsa-project.org> Cc: <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:42:24 +0800 [thread overview] Message-ID: <1393814545-15002-4-git-send-email-Li.Xiubo@freescale.com> (raw) In-Reply-To: <1393814545-15002-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
WARNING: multiple messages have this Message-ID (diff)
From: Xiubo Li <Li.Xiubo@freescale.com> To: broonie@kernel.org, lars@metafoo.de, alsa-devel@alsa-project.org Cc: 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:42:24 +0800 [thread overview] Message-ID: <1393814545-15002-4-git-send-email-Li.Xiubo@freescale.com> (raw) In-Reply-To: <1393814545-15002-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
next prev parent reply other threads:[~2014-03-03 3:49 UTC|newest] Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-03-03 2:42 [PATCHv3 0/3] Simplify the CODEC ASoC probe code Xiubo Li 2014-03-03 2:42 ` Xiubo Li 2014-03-03 2:42 ` [PATCHv3 1/3] ASoC: codec: Simplify " Xiubo Li 2014-03-03 2:42 ` Xiubo Li 2014-03-03 4:59 ` Mark Brown 2014-03-03 7:24 ` Li.Xiubo 2014-03-04 4:36 ` Mark Brown 2014-03-10 3:51 ` Li.Xiubo 2014-03-10 6:57 ` [alsa-devel] " Lars-Peter Clausen 2014-03-10 6:57 ` Lars-Peter Clausen 2014-03-10 7:38 ` [alsa-devel] " Mark Brown 2014-03-10 7:47 ` Lars-Peter Clausen 2014-03-10 7:56 ` Li.Xiubo 2014-03-10 14:54 ` Timur Tabi 2014-03-10 14:54 ` Timur Tabi 2014-03-03 2:42 ` [PATCHv3 2/3] ASoC: io: New signature for snd_soc_codec_set_cache_io() Xiubo Li 2014-03-03 2:42 ` Xiubo Li 2014-03-03 2:42 ` Xiubo Li [this message] 2014-03-03 2:42 ` [PATCHv3 3/3] ASoC: core: Fix check before setting default I/O up try regmap Xiubo Li -- strict thread matches above, loose matches on Subject: below -- 2014-03-03 2:36 [PATCHv3 0/3] Simplify the CODEC ASoC probe code Xiubo Li 2014-03-03 2:36 ` [PATCHv3 3/3] ASoC: core: Fix check before setting default I/O up try regmap Xiubo Li 2014-03-03 2:36 ` Xiubo Li
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=1393814545-15002-4-git-send-email-Li.Xiubo@freescale.com \ --to=li.xiubo@freescale.com \ --cc=alsa-devel@alsa-project.org \ --cc=broonie@kernel.org \ --cc=lars@metafoo.de \ --cc=linux-kernel@vger.kernel.org \ /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: linkBe 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.