asoc: codec: wcd9378: defer the probe if msm cdc pinctrl is not probed

Defer the probe when the msm cdc pinctrl driver is not prode.

Change-Id: I3ace42632601a8ef010363f23534471e99c0f827
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
This commit is contained in:
Prasad Kumpatla 2024-02-01 12:54:09 +05:30
parent 74ecbee24e
commit e2327f08c3

View File

@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#include <linux/module.h>
@ -3954,7 +3954,7 @@ static int wcd9378_reset(struct device *dev)
if (rc) {
dev_err(dev, "%s: wcd sleep state request fail!\n",
__func__);
return rc;
return -EPROBE_DEFER;
}
/* 20us sleep required after pulling the reset gpio to LOW */
usleep_range(20, 30);
@ -3963,7 +3963,7 @@ static int wcd9378_reset(struct device *dev)
if (rc) {
dev_err(dev, "%s: wcd active state request fail!\n",
__func__);
return rc;
return -EPROBE_DEFER;
}
/* 20us sleep required after pulling the reset gpio to HIGH */
usleep_range(20, 30);
@ -4363,7 +4363,11 @@ static int wcd9378_probe(struct platform_device *pdev)
if (ret)
goto err_lock_init;
wcd9378_reset(dev);
ret = wcd9378_reset(dev);
if (ret == -EPROBE_DEFER) {
dev_err(dev, "%s: wcd reset failed!\n", __func__);
goto err_lock_init;
}
wcd9378->wakeup = wcd9378_wakeup;