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

Commit eea18f12 authored by Mohammad Johny Shaik's avatar Mohammad Johny Shaik Committed by Satish Kamuju
Browse files

ASoC: msm: qdsp6: Fix pop noise seen with touch tone during playback



Issue: When a session is opened for playback of the touch tone and
	routed through the COPP, the PBE and IIR params are being
	reconfigured in the COPP every time a session is open.

Rootcause:Configuring the PBE/IIR in the COPP every time a session
           is open.
Fix: Configuring the PBE and IIR param in the COPP one time a session
      is open

CRs-Fixed: 541722
Change-Id: If0d1a8c6893a94186e1c6c2a75432d2f4a89f842
Signed-off-by: default avatarMohammad Johny Shaik <mjshai@codeaurora.org>
Signed-off-by: default avatarSatish Kamuju <skamuj@codeaurora.org>
parent 11c77eba
Loading
Loading
Loading
Loading
+23 −15
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ struct adm_ctl {
	atomic_t copp_stat[AFE_MAX_PORTS];
	wait_queue_head_t wait;
	int  ec_ref_rx;
	int  prev_index;
};

static struct acdb_cal_block mem_addr_audproc[MAX_AUDPROC_TYPES];
@@ -667,6 +668,8 @@ static void send_adm_cal(int port_id, int path)
	int			result = 0;
	s32			acdb_path;
	struct acdb_cal_block	aud_cal;
	int flag = 0;
	int index = afe_get_port_index(port_id);

	pr_debug("%s\n", __func__);

@@ -695,13 +698,16 @@ static void send_adm_cal(int port_id, int path)
		else
			mem_addr_audproc[acdb_path] = aud_cal;
	}

	if (this_adm.prev_index != index) {
		if (!send_adm_cal_block(port_id, &aud_cal))
			pr_debug("%s: Audproc cal sent for port id: %d, path %d\n",
				__func__, port_id, acdb_path);
		else
			pr_debug("%s: Audproc cal not sent for port id: %d, path %d\n",
				__func__, port_id, acdb_path);
		this_adm.prev_index = index;
		flag = 1;
	}

	pr_debug("%s: Sending audvol cal\n", __func__);
	get_audvol_cal(acdb_path, &aud_cal);
@@ -724,7 +730,7 @@ static void send_adm_cal(int port_id, int path)
		else
			mem_addr_audvol[acdb_path] = aud_cal;
	}

	if ((this_adm.prev_index == index) && (flag == 1)) {
		if (!send_adm_cal_block(port_id, &aud_cal))
			pr_debug("%s: Audvol cal sent for port id: %d, path %d\n",
				__func__, port_id, acdb_path);
@@ -733,6 +739,8 @@ static void send_adm_cal(int port_id, int path)
				__func__, port_id, acdb_path);
	}

}

int adm_connect_afe_port(int mode, int session_id, int port_id)
{
	struct adm_cmd_connect_afe_port	cmd;
@@ -1621,7 +1629,7 @@ int adm_close(int port_id)

		atomic_set(&this_adm.copp_id[index], RESET_COPP_ID);
		atomic_set(&this_adm.copp_stat[index], 0);

		this_adm.prev_index = 0xffff;

		pr_debug("%s:coppid %d portid=%d index=%d coppcnt=%d\n",
				__func__,
@@ -1658,7 +1666,7 @@ static int __init adm_init(void)
	int i = 0;
	init_waitqueue_head(&this_adm.wait);
	this_adm.apr = NULL;

	this_adm.prev_index = 0xffff;
	for (i = 0; i < AFE_MAX_PORTS; i++) {
		atomic_set(&this_adm.copp_id[i], RESET_COPP_ID);
		atomic_set(&this_adm.copp_cnt[i], 0);