ufs: ufs-qcom: WA for VCCQ LDO OCP in shutdown

Currently during system shutdown, power down command
is sent to ufs subsystem. After this we put all the
UFS rails in low power modes immediately but it seems
some ufs devices may still draw more than sleep current
from UFS rails (especially from VCCQ rail) at least for
some micro seconds. It causes OCP on VCCQ rail.

Hence avoid turning off UFS VCCQ regulator in ufs
shutdown by putting an additional vote on VCCQ
LDO if 'qcom,vccq-shutdown' is defined in target
DTS. UFS device LDO would be turned off by PMIC
regulator itself.

Change-Id: Ibf5764152e9460a0dc96ec121345920c06b985a5
Signed-off-by: Manish Pandey <quic_mapa@quicinc.com>
This commit is contained in:
Manish Pandey 2023-12-19 11:16:26 +05:30
parent e97cac2064
commit fb9a496b8b
2 changed files with 27 additions and 0 deletions

View File

@ -5837,6 +5837,28 @@ static int ufs_qcom_remove(struct platform_device *pdev)
return 0;
}
/**
* ufs_qcom_enable_vccq_shutdown - read from DTS whether vccq_shutdown
* should be enabled for putting additional vote on VCCQ LDO during shutdown.
* @hba: per adapter instance
*/
static void ufs_qcom_enable_vccq_shutdown(struct ufs_hba *hba)
{
struct ufs_qcom_host *host = ufshcd_get_variant(hba);
int err;
err = ufs_qcom_parse_reg_info(host, "qcom,vccq-shutdown",
&host->vccq_shutdown);
if (host->vccq_shutdown) {
err = ufs_qcom_enable_vreg(hba->dev, host->vccq_shutdown);
if (err)
dev_err(hba->dev, "%s: failed enable vccq_shutdown err=%d\n",
__func__, err);
}
}
static void ufs_qcom_shutdown(struct platform_device *pdev)
{
struct ufs_hba *hba;
@ -5853,6 +5875,10 @@ static void ufs_qcom_shutdown(struct platform_device *pdev)
ufs_qcom_log_str(host, "0xdead\n");
if (host->dbg_en)
trace_ufs_qcom_shutdown(dev_name(hba->dev));
/* put an additional vote on UFS VCCQ LDO if required */
ufs_qcom_enable_vccq_shutdown(hba);
ufshcd_pltfrm_shutdown(pdev);
/* UFS_RESET TLMM register cannot reset to POR value '1' after warm

View File

@ -578,6 +578,7 @@ struct ufs_qcom_host {
struct ufs_vreg *vddp_ref_clk;
struct ufs_vreg *vccq_parent;
struct ufs_vreg *vccq_shutdown;
bool work_pending;
bool bypass_g4_cfgready;
bool is_dt_pm_level_read;