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>
This commit is contained in:
Meng Wang 2016-09-12 14:38:08 +08:00
parent d2afad6a90
commit 35b034ff27

8
sound/soc/codecs/audio-ext-clk.c Executable file → Normal file
View file

@ -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",