icnss2: Add Low power mode to icnss driver state

Deep Sleep is a system wide low power mode during which
Modem would be brought down and DDR would be in self
refresh mode (suspend-to-RAM) thus platform driver on
receiving deep sleep indication goes to a state similar
to SSR apart from the fact that FW is not crashed but
deliberately brought down.

In msm-5.15, there are no seperate notifications used
for deep sleep, notifications used for hibernate like
BEFORE_SHUTDOWN, AFTER_SHUTDOWN, BEFORE_POWERUP and
AFTER_POWERUP are used for deep sleep also.

In this commit add only low power mode state to
icnss driver state.

Change-Id: I4b12c5a8841e3cfc3e5e44ab6d9dff141e472876
CRs-Fixed: 3394501
This commit is contained in:
Surabhi Vishnoi
2022-11-08 15:52:05 +05:30
committed by Gerrit - the friendly Code Review server
parent 2ac2197477
commit 6c9f906a94
4 changed files with 21 additions and 4 deletions

View File

@@ -519,6 +519,15 @@ static int icnss_send_smp2p(struct icnss_priv *priv,
return ret;
}
bool icnss_is_low_power(void)
{
if (!penv)
return false;
else
return test_bit(ICNSS_LOW_POWER, &penv->state);
}
EXPORT_SYMBOL(icnss_is_low_power);
static irqreturn_t fw_error_fatal_handler(int irq, void *ctx)
{
struct icnss_priv *priv = ctx;
@@ -1092,6 +1101,7 @@ static int icnss_pd_restart_complete(struct icnss_priv *priv)
clear_bit(ICNSS_PDR, &priv->state);
clear_bit(ICNSS_REJUVENATE, &priv->state);
clear_bit(ICNSS_PD_RESTART, &priv->state);
clear_bit(ICNSS_LOW_POWER, &priv->state);
priv->early_crash_ind = false;
priv->is_ssr = false;
@@ -2159,14 +2169,16 @@ static int icnss_modem_notifier_nb(struct notifier_block *nb,
icnss_pr_vdbg("Modem-Notify: event %s(%lu)\n",
icnss_qcom_ssr_notify_state_to_str(code), code);
if (code == QCOM_SSR_AFTER_SHUTDOWN) {
switch (code) {
case QCOM_SSR_BEFORE_SHUTDOWN:
break;
case QCOM_SSR_AFTER_SHUTDOWN:
icnss_pr_info("Collecting msa0 segment dump\n");
icnss_msa0_ramdump(priv);
goto out;
}
if (code != QCOM_SSR_BEFORE_SHUTDOWN)
default:
goto out;
}
priv->is_ssr = true;