diff --git a/include/linux/qdsp6v2/rtac.h b/include/linux/qdsp6v2/rtac.h index 3e5433b23a51..eeea0eb0a837 100644 --- a/include/linux/qdsp6v2/rtac.h +++ b/include/linux/qdsp6v2/rtac.h @@ -1,4 +1,5 @@ -/* 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 diff --git a/sound/soc/msm/qdsp6v2/q6afe.c b/sound/soc/msm/qdsp6v2/q6afe.c index f1607b8e5d66..c1757fcdd598 100644 --- a/sound/soc/msm/qdsp6v2/q6afe.c +++ b/sound/soc/msm/qdsp6v2/q6afe.c @@ -1364,6 +1364,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); diff --git a/sound/soc/msm/qdsp6v2/rtac.c b/sound/soc/msm/qdsp6v2/rtac.c index 82551fb8ed71..83628b8d62d9 100644 --- a/sound/soc/msm/qdsp6v2/rtac.c +++ b/sound/soc/msm/qdsp6v2/rtac.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-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 @@ -393,6 +393,24 @@ done: 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) {