[RFC PATCH 2/2] soundwire: qcom: add support for static port mapping
Srinivas Kandagatla
srinivas.kandagatla at linaro.org
Wed Jan 20 19:01:10 CET 2021
On some of Qualcomm SoundWire controller instances ports are statically
mapped based on the functionalities. So add support for such mapping.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla at linaro.org>
---
drivers/soundwire/qcom.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
index 6d22df01f354..0641b591037e 100644
--- a/drivers/soundwire/qcom.c
+++ b/drivers/soundwire/qcom.c
@@ -474,7 +474,10 @@ static int qcom_swrm_compute_params(struct sdw_bus *bus)
list_for_each_entry(s_rt, &m_rt->slave_rt_list, m_rt_node) {
list_for_each_entry(p_rt, &s_rt->port_list, port_node) {
- pcfg = &ctrl->pconfig[i];
+ if (p_rt->is_static_map)
+ pcfg = &ctrl->pconfig[p_rt->mapped_port_num - 1];
+ else
+ pcfg = &ctrl->pconfig[i];
p_rt->transport_params.port_num = p_rt->num;
p_rt->transport_params.sample_interval =
pcfg->si + 1;
@@ -551,7 +554,11 @@ static int qcom_swrm_stream_alloc_ports(struct qcom_swrm_ctrl *ctrl,
list_for_each_entry(s_rt, &m_rt->slave_rt_list, m_rt_node) {
list_for_each_entry(p_rt, &s_rt->port_list, port_node) {
/* Port numbers start from 1 - 14*/
- pn = find_first_zero_bit(port_mask, maxport);
+ if (p_rt->is_static_map)
+ pn = p_rt->mapped_port_num;
+ else
+ pn = find_first_zero_bit(port_mask, maxport);
+
if (pn > (maxport - 1)) {
dev_err(ctrl->dev, "All ports busy\n");
ret = -EBUSY;
--
2.21.0
More information about the Alsa-devel
mailing list