From 098babd32f752f739e10770a64ce7e20784b9564 Mon Sep 17 00:00:00 2001 From: Ramprasad Katkam Date: Wed, 17 May 2017 23:51:44 +0530 Subject: [PATCH] ASoC: audio_notifier : Change logic for initial boot In sdm660 due to change of notifier logic, there is a chance of receiving only service down notifications during bootup. In this case the initial boot flag is not cleared, as it is only cleared on service up notification currenly.because of this, the next service down event during SSR/PDR will be ignored. To fix this, clear initial boot flag for both first service up/down notification, so that Reset notifications are not ignored. Change-Id: Iae3ccc6a81fac5d9e5c640f0fee8bb2aee2271cd Signed-off-by: Ramprasad Katkam --- drivers/pinctrl/qcom/pinctrl-lpi.c | 4 +++- drivers/soc/qcom/qdsp6v2/apr.c | 4 +++- sound/soc/codecs/msm_sdw/msm_sdw_cdc.c | 4 +++- sound/soc/codecs/sdm660_cdc/msm-analog-cdc.c | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/qcom/pinctrl-lpi.c b/drivers/pinctrl/qcom/pinctrl-lpi.c index 3fe41ee4c3c1..e5269cffe568 100644 --- a/drivers/pinctrl/qcom/pinctrl-lpi.c +++ b/drivers/pinctrl/qcom/pinctrl-lpi.c @@ -414,8 +414,10 @@ static int lpi_notifier_service_cb(struct notifier_block *this, switch (opcode) { case AUDIO_NOTIFIER_SERVICE_DOWN: - if (initial_boot) + if (initial_boot) { + initial_boot = false; break; + } lpi_dev_up = false; break; case AUDIO_NOTIFIER_SERVICE_UP: diff --git a/drivers/soc/qcom/qdsp6v2/apr.c b/drivers/soc/qcom/qdsp6v2/apr.c index 5681b8f2e678..7547c1597ffb 100644 --- a/drivers/soc/qcom/qdsp6v2/apr.c +++ b/drivers/soc/qcom/qdsp6v2/apr.c @@ -885,8 +885,10 @@ static int apr_notifier_service_cb(struct notifier_block *this, * recovery notifications during initial boot * up since everything is expected to be down. */ - if (is_initial_boot) + if (is_initial_boot) { + is_initial_boot = false; break; + } if (cb_data->domain == AUDIO_NOTIFIER_MODEM_DOMAIN) apr_modem_down(opcode); else diff --git a/sound/soc/codecs/msm_sdw/msm_sdw_cdc.c b/sound/soc/codecs/msm_sdw/msm_sdw_cdc.c index db723e5ec1f4..b91d13c8e010 100644 --- a/sound/soc/codecs/msm_sdw/msm_sdw_cdc.c +++ b/sound/soc/codecs/msm_sdw/msm_sdw_cdc.c @@ -1668,8 +1668,10 @@ static int msm_sdw_notifier_service_cb(struct notifier_block *nb, mutex_lock(&msm_sdw->codec_mutex); switch (opcode) { case AUDIO_NOTIFIER_SERVICE_DOWN: - if (initial_boot) + if (initial_boot) { + initial_boot = false; break; + } msm_sdw->int_mclk1_enabled = false; msm_sdw->dev_up = false; for (i = 0; i < msm_sdw->nr; i++) diff --git a/sound/soc/codecs/sdm660_cdc/msm-analog-cdc.c b/sound/soc/codecs/sdm660_cdc/msm-analog-cdc.c index 699e7251023f..573b0b633f60 100644 --- a/sound/soc/codecs/sdm660_cdc/msm-analog-cdc.c +++ b/sound/soc/codecs/sdm660_cdc/msm-analog-cdc.c @@ -3829,8 +3829,10 @@ static int sdm660_cdc_notifier_service_cb(struct notifier_block *nb, switch (opcode) { case AUDIO_NOTIFIER_SERVICE_DOWN: - if (initial_boot) + if (initial_boot) { + initial_boot = false; break; + } dev_dbg(codec->dev, "ADSP is about to power down. teardown/reset codec\n"); msm_anlg_cdc_device_down(codec);