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

Commit 26970bf6 authored by Xiaoyu Ye's avatar Xiaoyu Ye Committed by Gerrit - the friendly Code Review server
Browse files

ASoC: msm: qdsp6v2: Remove vote for BMS power state for voice call



Remove support for voting for BMS power state, as this is not
needed for voice use cases anymore.

Change-Id: I539744c7602790052f4acdf820cc2644c32d2a8a
Signed-off-by: default avatarXiaoyu Ye <benyxy@codeaurora.org>
parent 128671bb
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -88,8 +88,6 @@ 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
 - qcom,vote-bms : Flag indicating whether to vote for BMS during
                   the call start and stop

* msm-voice-host-pcm

@@ -448,11 +446,6 @@ Example:
		qcom,destroy-cvd;
	};

	qcom,msm-pcm-voice {
		compatible = "qcom,msm-pcm-voice";
		qcom,vote-bms;
	};

        qcom,msm-voice-host-pcm {
                compatible = "qcom,msm-voice-host-pcm";
        };
+0 −6
Original line number Diff line number Diff line
@@ -673,9 +673,7 @@ static int msm_pcm_probe(struct platform_device *pdev)
{
	int rc;
	bool destroy_cvd = false;
	bool vote_bms = false;
	const char *is_destroy_cvd = "qcom,destroy-cvd";
	const char *is_vote_bms = "qcom,vote-bms";

	if (!is_voc_initialized()) {
		pr_debug("%s: voice module not initialized yet, deferring probe()\n",
@@ -702,10 +700,6 @@ static int msm_pcm_probe(struct platform_device *pdev)
						is_destroy_cvd);
	voc_set_destroy_cvd_flag(destroy_cvd);

	vote_bms = of_property_read_bool(pdev->dev.of_node,
					 is_vote_bms);
	voc_set_vote_bms_flag(vote_bms);

	rc = snd_soc_register_platform(&pdev->dev,
				       &msm_soc_platform);

+0 −44
Original line number Diff line number Diff line
@@ -102,7 +102,6 @@ static int voice_alloc_oob_shared_mem(void);
static int voice_free_oob_shared_mem(void);
static int voice_alloc_oob_mem_table(void);
static int voice_alloc_and_map_oob_mem(struct voice_data *v);
static void voice_vote_powerstate_to_bms(struct voice_data *v, bool state);

static struct voice_data *voice_get_session_by_idx(int idx);

@@ -1787,34 +1786,6 @@ static int voice_send_dtmf_rx_detection_cmd(struct voice_data *v,
	return ret;
}

static void voice_vote_powerstate_to_bms(struct voice_data *v, bool state)
{
	union power_supply_propval pval = {0, };

	if (!v->psy)
		v->psy = power_supply_get_by_name("bms");
	if (v->psy && !(is_voip_session(v->session_id) ||
			is_vowlan_session(v->session_id))) {
		pval.intval = VMBMS_VOICE_CALL_BIT;
		if (state) {
			power_supply_set_property(v->psy,
				POWER_SUPPLY_PROP_HI_POWER,
				&pval);
			pr_debug("%s : Vote High power to BMS\n",
				__func__);
		} else {
			power_supply_set_property(v->psy,
				POWER_SUPPLY_PROP_LOW_POWER,
				&pval);
			pr_debug("%s: Vote low power to BMS\n",
				__func__);
		}
	} else {
		pr_debug("%s: No OP", __func__);
	}

}

void voc_disable_dtmf_det_on_active_sessions(void)
{
	struct voice_data *v = NULL;
@@ -1860,12 +1831,6 @@ void voc_set_destroy_cvd_flag(bool is_destroy_cvd)
	common.is_destroy_cvd = is_destroy_cvd;
}

void voc_set_vote_bms_flag(bool is_vote_bms)
{
	pr_debug("%s: flag value: %d\n", __func__, is_vote_bms);
	common.is_vote_bms = is_vote_bms;
}

int voc_alloc_cal_shared_memory(void)
{
	int rc = 0;
@@ -2307,11 +2272,6 @@ static int voice_send_start_voice_cmd(struct voice_data *v)
	if (!ret) {
		pr_err("%s: wait_event timeout\n", __func__);
		goto fail;
	} else {
		if (common.is_vote_bms) {
			/* vote high power to BMS during call start */
			voice_vote_powerstate_to_bms(v, true);
		}
	}
	if (v->async_err > 0) {
		pr_err("%s: DSP returned error[%s]\n",
@@ -5855,10 +5815,6 @@ int voc_end_voice_call(uint32_t session_id)

		voice_destroy_mvm_cvs_session(v);
		v->voc_state = VOC_RELEASE;
		if (common.is_vote_bms) {
			/* vote low power to BMS during call stop */
			voice_vote_powerstate_to_bms(v, false);
		}
	} else {
		pr_err("%s: Error: End voice called in state %d\n",
			__func__, v->voc_state);
+0 −5
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@
#include <linux/qdsp6v2/rtac.h>
#include <linux/msm_ion.h>
#include <sound/voice_params.h>
#include <linux/power_supply.h>

#define MAX_VOC_PKT_SIZE 642
#define SESSION_NAME_LEN 20
@@ -1593,8 +1592,6 @@ struct voice_data {
	struct incall_music_info music_info;

	struct voice_rec_route_state rec_route_state;

	struct power_supply *psy;
};

struct cal_mem {
@@ -1647,7 +1644,6 @@ struct common_data {

	bool srvcc_rec_flag;
	bool is_destroy_cvd;
	bool is_vote_bms;
	char cvd_version[CVD_VERSION_STRING_MAX_SIZE];
	bool is_per_vocoder_cal_enabled;
	bool is_sound_focus_resp_success;
@@ -1778,7 +1774,6 @@ 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);
void voc_set_vote_bms_flag(bool is_vote_bms);
int voc_disable_topology(uint32_t session_id, uint32_t disable);
int voc_set_device_config(uint32_t session_id, uint8_t path_dir,
			  uint8_t no_of_channels, uint32_t dev_port_id);