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

Commit 69ece6b1 authored by Vidyakumar Athota's avatar Vidyakumar Athota Committed by Banajit Goswami
Browse files

ASoC: qdsp6v2: update afe topology to RTAC driver



In device switch scenarios, AFE topology is stored in Real Time
Audio Calibration(RTAC) driver before afe ports are open, which
is invalid. Update AFE topology in RTAC driver after topology ID
is obtained during AFE port open.

Change-Id: I034321126fb0ffc9a2871f3c64f29f8aaedb21e7
Signed-off-by: default avatarVidyakumar Athota <vathota@codeaurora.org>
parent a7bf1bc5
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
/* Copyright (c) 2011, 2013-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011, 2013-2015, 2017, 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
@@ -95,4 +96,5 @@ int rtac_clear_mapping(uint32_t cal_type);
bool rtac_make_afe_callback(uint32_t *payload, u32 payload_size);
void rtac_set_afe_handle(void *handle);
void get_rtac_adm_data(struct rtac_adm *adm_data);
void rtac_update_afe_topology(u32 port_id);
#endif
+1 −0
Original line number Diff line number Diff line
@@ -1366,6 +1366,7 @@ static int afe_send_port_topology_id(u16 port_id)
	}

	this_afe.topology[index] = topology_id;
	rtac_update_afe_topology(port_id);
done:
	pr_debug("%s: AFE set topology id 0x%x  enable for port 0x%x ret %d\n",
			__func__, topology_id, port_id, ret);
+18 −0
Original line number Diff line number Diff line
@@ -400,6 +400,24 @@ void add_popp(u32 dev_idx, u32 port_id, u32 popp_id)
	return;
}

void rtac_update_afe_topology(u32 port_id)
{
	u32 i = 0;

	mutex_lock(&rtac_adm_mutex);
	for (i = 0; i < rtac_adm_data.num_of_dev; i++) {
		if (rtac_adm_data.device[i].afe_port == port_id) {
			rtac_adm_data.device[i].afe_topology =
						afe_get_topology(port_id);
			pr_debug("%s: port_id = 0x%x topology_id = 0x%x copp_id = %d\n",
				 __func__, port_id,
				 rtac_adm_data.device[i].afe_topology,
				 rtac_adm_data.device[i].copp);
		}
	}
	mutex_unlock(&rtac_adm_mutex);
}

void rtac_add_adm_device(u32 port_id, u32 copp_id, u32 path_id, u32 popp_id,
			 u32 app_type, u32 acdb_id)
{