summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMeng Wang <mwang@codeaurora.org>2016-09-12 14:38:08 +0800
committerMeng Wang <mwang@codeaurora.org>2016-09-15 20:49:30 -0700
commit35b034ff27afcfcaedfa1e64f9e77576ae27187c (patch)
tree539495d0284a60aba0821bba832408ae3c61cd18
parentd2afad6a903bdda2f803fae49f0b0001d12f8600 (diff)
ASoC: audio-ext-clk: avoid multiple initialization of pinctrl_info
Dynamic detection between wcd9335 and wcd934x codecs is supported on msmcobalt. Probe sequence of the two codec drivers can occur in any order. MCLK initialization is common for the two codecs which gets called twice. Avoid wcd934x codec's probe sequence from resetting wcd9335 codec's native mclk pinctrl if the pinctrl is already initialized. CRs-Fixed: 1066167 Change-Id: Idf65e15e08bb856d65b992b996cffa6ef2e6f974 Signed-off-by: Meng Wang <mwang@codeaurora.org>
-rw-r--r--[-rwxr-xr-x]sound/soc/codecs/audio-ext-clk.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sound/soc/codecs/audio-ext-clk.c b/sound/soc/codecs/audio-ext-clk.c
index c422267dbf2c..34b1d9481457 100755..100644
--- a/sound/soc/codecs/audio-ext-clk.c
+++ b/sound/soc/codecs/audio-ext-clk.c
@@ -193,7 +193,13 @@ static int audio_get_pinctrl(struct platform_device *pdev)
int ret;
pnctrl_info = &audio_ap_clk2.pnctrl_info;
- pnctrl_info->pinctrl = NULL;
+
+ if (pnctrl_info->pinctrl) {
+ dev_dbg(&pdev->dev, "%s: already requested before\n",
+ __func__);
+ return -EINVAL;
+ }
+
pinctrl = devm_pinctrl_get(&pdev->dev);
if (IS_ERR_OR_NULL(pinctrl)) {
dev_dbg(&pdev->dev, "%s: Unable to get pinctrl handle\n",