Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cc9dc97a authored by Ramireddy KrishnaKanth Reddy's avatar Ramireddy KrishnaKanth Reddy
Browse files

asoc: codecs: Fix for the SSR issue on qcm2150



when the SSR event triggers, lock_arg is accessing NULL
which cause device soft reboot. Add NULL check to fix
this.

Change-Id: Id8b225e503b1dae283968427f81802b077609795
Signed-off-by: default avatarRamireddy KrishnaKanth Reddy <quic_ramikris@quicinc.com>
parent 6b98c492
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2015-2017, 2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
 */
#include <linux/module.h>
#include <linux/init.h>
@@ -1141,8 +1142,10 @@ static int msm_dig_cdc_event_notify(struct notifier_block *block,
		break;
	case DIG_CDC_EVENT_SSR_UP:
		regcache_cache_only(msm_dig_cdc->regmap, false);
		if ((msm_dig_cdc->regmap) != NULL && (msm_dig_cdc->regmap->lock) != NULL &&
			(msm_dig_cdc->regmap->lock_arg) != NULL) {
			regcache_mark_dirty(msm_dig_cdc->regmap);

		}
		mutex_lock(&pdata->cdc_int_mclk0_mutex);
		pdata->digital_cdc_core_clk.enable = 1;
		ret = afe_set_lpass_clock_v2(
@@ -1156,7 +1159,10 @@ static int msm_dig_cdc_event_notify(struct notifier_block *block,
		}
		mutex_unlock(&pdata->cdc_int_mclk0_mutex);

		if ((msm_dig_cdc->regmap) != NULL && (msm_dig_cdc->regmap->lock) != NULL &&
                        (msm_dig_cdc->regmap->lock_arg) != NULL) {
			regcache_sync(msm_dig_cdc->regmap);
		}

		mutex_lock(&pdata->cdc_int_mclk0_mutex);
		pdata->digital_cdc_core_clk.enable = 0;