From 9f232a9029771626963aab4cb13cac9b64ae7d5c Mon Sep 17 00:00:00 2001 From: Soumya Managoli Date: Fri, 2 Aug 2019 10:59:47 +0530 Subject: [PATCH] asoc: codecs: Fix LPASS register access during bootup In analog codec and soundwire codec probe functions, ADSP Audio PD up status is not checked which leads to LPASS registers access during bootup even before ADSP is ready. Check for ADSP ready state in the respective probe functions to fix this. Change-Id: I7c97833898b6e75806c4567fcdf1618759acb238 Signed-off-by: Soumya Managoli --- sound/soc/codecs/msm_sdw/msm_sdw_cdc.c | 5 +++-- sound/soc/codecs/sdm660_cdc/msm-analog-cdc.c | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/msm_sdw/msm_sdw_cdc.c b/sound/soc/codecs/msm_sdw/msm_sdw_cdc.c index 1c79e632b8f8..fa157b4534b3 100644 --- a/sound/soc/codecs/msm_sdw/msm_sdw_cdc.c +++ b/sound/soc/codecs/msm_sdw/msm_sdw_cdc.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. +/* Copyright (c) 2016-2019 The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -1871,7 +1871,8 @@ static int msm_sdw_probe(struct platform_device *pdev) int adsp_state; adsp_state = apr_get_subsys_state(); - if (adsp_state != APR_SUBSYS_LOADED) { + if (adsp_state != APR_SUBSYS_LOADED || + !q6core_is_adsp_ready()) { dev_err(&pdev->dev, "Adsp is not loaded yet %d\n", adsp_state); return -EPROBE_DEFER; diff --git a/sound/soc/codecs/sdm660_cdc/msm-analog-cdc.c b/sound/soc/codecs/sdm660_cdc/msm-analog-cdc.c index 94122de3e758..66245ba438fc 100644 --- a/sound/soc/codecs/sdm660_cdc/msm-analog-cdc.c +++ b/sound/soc/codecs/sdm660_cdc/msm-analog-cdc.c @@ -4575,7 +4575,8 @@ static int msm_anlg_cdc_probe(struct platform_device *pdev) int adsp_state; adsp_state = apr_get_subsys_state(); - if (adsp_state != APR_SUBSYS_LOADED) { + if (adsp_state != APR_SUBSYS_LOADED || + !q6core_is_adsp_ready()) { dev_err(&pdev->dev, "Adsp is not loaded yet %d\n", adsp_state); return -EPROBE_DEFER;