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

Commit 8b079a01 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "sdm660_cdc: Reset cache_only mode for non SSR scenario"

parents fd510791 7126fc77
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
/* Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2020, 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
@@ -42,6 +42,7 @@

#define DEC_SVA 5
#define MSM_DIG_CDC_VERSION_ENTRY_SIZE 32
#define ADSP_UP 1

static unsigned long rx_digital_gain_reg[] = {
	MSM89XX_CDC_CORE_RX1_VOL_CTL_B2_CTL,
@@ -87,8 +88,13 @@ static int msm_digcdc_clock_control(bool flag)
	if (flag) {
		mutex_lock(&pdata->cdc_int_mclk0_mutex);
		if (atomic_read(&pdata->int_mclk0_enabled) == false) {
			if (msm_dig_cdc->regmap->cache_only == true)
			if (msm_dig_cdc->regmap->cache_only == true) {
				if (test_bit(ADSP_UP,
						&msm_dig_cdc->status_mask))
					msm_dig_cdc->regmap->cache_only = false;
				else
					return ret;
			}
			if (pdata->native_clk_set)
				pdata->digital_cdc_core_clk.clk_freq_in_hz =
							NATIVE_MCLK_RATE;
@@ -1115,9 +1121,11 @@ static int msm_dig_cdc_event_notify(struct notifier_block *block,
				MSM89XX_CDC_CORE_RX2_B3_CTL, 0x80, 0x00);
		break;
	case DIG_CDC_EVENT_SSR_DOWN:
		clear_bit(ADSP_UP, &msm_dig_cdc->status_mask);
		regcache_cache_only(msm_dig_cdc->regmap, true);
		break;
	case DIG_CDC_EVENT_SSR_UP:
		set_bit(ADSP_UP, &msm_dig_cdc->status_mask);
		regcache_cache_only(msm_dig_cdc->regmap, false);
		regcache_mark_dirty(msm_dig_cdc->regmap);

@@ -2145,6 +2153,7 @@ static int msm_dig_cdc_probe(struct platform_device *pdev)
				msm_codec_dais, ARRAY_SIZE(msm_codec_dais));
	dev_dbg(&pdev->dev, "%s: registered DIG CODEC 0x%x\n",
			__func__, dig_cdc_addr);
	set_bit(ADSP_UP, &msm_dig_cdc->status_mask);
rtn:
	return ret;
}
+2 −1
Original line number Diff line number Diff line
/* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2016-2017, 2020 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
@@ -62,6 +62,7 @@ struct msm_dig_priv {
				 struct notifier_block *nblock,
				 bool enable);
	struct tx_mute_work tx_mute_dwork[NUM_DECIMATORS];
	unsigned long status_mask;
};

struct dig_ctrl_platform_data {