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

Commit ebc7b33d authored by Avinash Vaish's avatar Avinash Vaish Committed by Venkata Narendra Kumar Gutta
Browse files

ASoC: msm: qdsp6v2: destroy CVD sessions during call teardown



With targets supporting low RAM space it is required to destroy the
CVD sessions after every call tear down due to memory constraints.
This can be achieved using device tree model. Based on the destroy
cvd flag info CVD sessions are destroyed.

Change-Id: Icd29f5084d6fbb4dd69ed39ad9d381553d6abeca
Signed-off-by: default avatarAvinash Vaish <avaish@codeaurora.org>
parent 6364f210
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -62,6 +62,8 @@ Required properties:
Required properties:

 - compatible : "qcom,msm-pcm-voice"
 - qcom,destroy-cvd : Flag indicating whether to destroy cvd at
                      the end of call for low memory targets

* msm-voice-host-pcm

@@ -297,6 +299,11 @@ Example:
                compatible = "qcom,msm-voip-dsp";
        };

	qcom,msm-pcm-voice {
		compatible = "qcom,msm-pcm-voice";
		qcom,destroy-cvd;
	};

        qcom,msm-voice-host-pcm {
                compatible = "qcom,msm-voice-host-pcm";
        };
+8 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@
#include <sound/initval.h>
#include <sound/control.h>
#include <asm/dma.h>
#include <linux/of_device.h>

#include "msm-pcm-voice-v2.h"
#include "q6voice.h"
@@ -560,6 +561,8 @@ static struct snd_soc_platform_driver msm_soc_platform = {
static int msm_pcm_probe(struct platform_device *pdev)
{
	int rc;
	bool destroy_cvd = false;
	const char *is_destroy_cvd = "qcom,destroy-cvd";

	if (!is_voc_initialized()) {
		pr_debug("%s: voice module not initialized yet, deferring probe()\n",
@@ -582,6 +585,11 @@ static int msm_pcm_probe(struct platform_device *pdev)

	if (pdev->dev.of_node)
		dev_set_name(&pdev->dev, "%s", "msm-pcm-voice");
	pr_debug("%s: dev name %s\n",
			__func__, dev_name(&pdev->dev));
	destroy_cvd = of_property_read_bool(pdev->dev.of_node,
						is_destroy_cvd);
	voc_set_destroy_cvd_flag(destroy_cvd);

	pr_debug("%s: dev name %s\n", __func__, dev_name(&pdev->dev));
	rc = snd_soc_register_platform(&pdev->dev,
+10 −1
Original line number Diff line number Diff line
@@ -983,7 +983,7 @@ static int voice_destroy_mvm_cvs_session(struct voice_data *v)
	    is_qchat_session(v->session_id) ||
	    is_volte_session(v->session_id) ||
	    is_vowlan_session(v->session_id) ||
	    v->voc_state == VOC_ERROR) {
	    v->voc_state == VOC_ERROR || common.is_destroy_cvd) {
		/* Destroy CVS. */
		pr_debug("%s: CVS destroy session\n", __func__);

@@ -1391,6 +1391,12 @@ int voc_enable_dtmf_rx_detection(uint32_t session_id, uint32_t enable)
	return ret;
}

void voc_set_destroy_cvd_flag(bool is_destroy_cvd)
{
	pr_debug("%s: %d\n", __func__, is_destroy_cvd);
	common.is_destroy_cvd = is_destroy_cvd;
}

int voc_alloc_cal_shared_memory(void)
{
	int rc = 0;
@@ -6274,6 +6280,9 @@ static int __init voice_init(void)
	/* Initialize MVS info. */
	common.mvs_info.network_type = VSS_NETWORK_ID_DEFAULT;

	/* Initialize is low memory flag */
	common.is_destroy_cvd = false;

	mutex_init(&common.common_lock);

	/* Initialize session id with vsid */
+2 −0
Original line number Diff line number Diff line
@@ -1474,6 +1474,7 @@ struct common_data {
	struct voice_data voice[MAX_VOC_SESSIONS];

	bool srvcc_rec_flag;
	bool is_destroy_cvd;
};

struct voice_session_itr {
@@ -1601,5 +1602,6 @@ int voc_set_ext_ec_ref(uint16_t port_id, bool state);
int voc_update_amr_vocoder_rate(uint32_t session_id);
int voc_disable_device(uint32_t session_id);
int voc_enable_device(uint32_t session_id);
void voc_set_destroy_cvd_flag(bool is_destroy_cvd);

#endif