Lines Matching +full:q6adm +full:- +full:routing

1 // SPDX-License-Identifier: GPL-2.0
2 // Copyright (c) 2011-2017, The Linux Foundation. All rights reserved.
5 #include <dt-bindings/sound/qcom,q6asm.h>
6 #include <dt-bindings/sound/qcom,q6afe.h>
17 #include <sound/soc-dapm.h>
24 #include "q6adm.h"
27 #define DRV_NAME "q6routing-component"
352 * q6routing_stream_open() - Register a new stream for route setup
371 pr_err("Routing driver not yet ready\n"); in q6routing_stream_open()
372 return -EINVAL; in q6routing_stream_open()
375 session = &routing_data->sessions[stream_id - 1]; in q6routing_stream_open()
376 if (session->port_id < 0) { in q6routing_stream_open()
377 dev_err(routing_data->dev, "Routing not setup for MultiMedia%d Session\n", in q6routing_stream_open()
378 session->fedai_id); in q6routing_stream_open()
379 return -EINVAL; in q6routing_stream_open()
382 pdata = &routing_data->port_data[session->port_id]; in q6routing_stream_open()
384 mutex_lock(&routing_data->lock); in q6routing_stream_open()
385 session->fedai_id = fedai_id; in q6routing_stream_open()
387 session->path_type = pdata->path_type; in q6routing_stream_open()
388 session->sample_rate = pdata->sample_rate; in q6routing_stream_open()
389 session->channels = pdata->channels; in q6routing_stream_open()
390 session->bits_per_sample = pdata->bits_per_sample; in q6routing_stream_open()
394 copp = q6adm_open(routing_data->dev, session->port_id, in q6routing_stream_open()
395 session->path_type, session->sample_rate, in q6routing_stream_open()
396 session->channels, topology, perf_mode, in q6routing_stream_open()
397 session->bits_per_sample, 0, 0); in q6routing_stream_open()
400 mutex_unlock(&routing_data->lock); in q6routing_stream_open()
401 return -EINVAL; in q6routing_stream_open()
405 set_bit(copp_idx, &session->copp_map); in q6routing_stream_open()
406 session->copps[copp_idx] = copp; in q6routing_stream_open()
408 for_each_set_bit(j, &session->copp_map, MAX_COPPS_PER_PORT) { in q6routing_stream_open()
409 payload.port_id[num_copps] = session->port_id; in q6routing_stream_open()
417 q6adm_matrix_map(routing_data->dev, session->path_type, in q6routing_stream_open()
420 mutex_unlock(&routing_data->lock); in q6routing_stream_open()
432 if (fedai_id == data->sessions[i].fedai_id) in get_session_from_id()
433 return &data->sessions[i]; in get_session_from_id()
439 * q6routing_stream_close() - Deregister a stream
455 for_each_set_bit(idx, &session->copp_map, MAX_COPPS_PER_PORT) { in q6routing_stream_close()
456 if (session->copps[idx]) { in q6routing_stream_close()
457 q6adm_close(routing_data->dev, session->copps[idx]); in q6routing_stream_close()
458 session->copps[idx] = NULL; in q6routing_stream_close()
462 session->fedai_id = -1; in q6routing_stream_close()
463 session->copp_map = 0; in q6routing_stream_close()
473 (struct soc_mixer_control *)kcontrol->private_value; in msm_routing_get_audio_mixer()
474 int session_id = mc->shift; in msm_routing_get_audio_mixer()
476 struct msm_routing_data *priv = dev_get_drvdata(c->dev); in msm_routing_get_audio_mixer()
477 struct session_data *session = &priv->sessions[session_id]; in msm_routing_get_audio_mixer()
479 if (session->port_id == mc->reg) in msm_routing_get_audio_mixer()
480 ucontrol->value.integer.value[0] = 1; in msm_routing_get_audio_mixer()
482 ucontrol->value.integer.value[0] = 0; in msm_routing_get_audio_mixer()
493 struct msm_routing_data *data = dev_get_drvdata(c->dev); in msm_routing_put_audio_mixer()
495 (struct soc_mixer_control *)kcontrol->private_value; in msm_routing_put_audio_mixer()
497 int be_id = mc->reg; in msm_routing_put_audio_mixer()
498 int session_id = mc->shift; in msm_routing_put_audio_mixer()
499 struct session_data *session = &data->sessions[session_id]; in msm_routing_put_audio_mixer()
501 if (ucontrol->value.integer.value[0]) { in msm_routing_put_audio_mixer()
502 if (session->port_id == be_id) in msm_routing_put_audio_mixer()
505 session->port_id = be_id; in msm_routing_put_audio_mixer()
508 if (session->port_id == -1 || session->port_id != be_id) in msm_routing_put_audio_mixer()
511 session->port_id = -1; in msm_routing_put_audio_mixer()
1053 struct msm_routing_data *data = dev_get_drvdata(component->dev); in routing_hw_params()
1054 unsigned int be_id = snd_soc_rtd_to_cpu(rtd, 0)->id; in routing_hw_params()
1058 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) in routing_hw_params()
1064 return -EINVAL; in routing_hw_params()
1066 session = &data->port_data[be_id]; in routing_hw_params()
1068 mutex_lock(&data->lock); in routing_hw_params()
1070 session->path_type = path_type; in routing_hw_params()
1071 session->sample_rate = params_rate(params); in routing_hw_params()
1072 session->channels = params_channels(params); in routing_hw_params()
1076 session->bits_per_sample = 16; in routing_hw_params()
1079 session->bits_per_sample = 24; in routing_hw_params()
1085 mutex_unlock(&data->lock); in routing_hw_params()
1094 routing_data->sessions[i].port_id = -1; in msm_routing_probe()
1095 routing_data->sessions[i].fedai_id = -1; in msm_routing_probe()
1129 struct device *dev = &pdev->dev; in q6pcm_routing_probe()
1133 return -ENOMEM; in q6pcm_routing_probe()
1135 routing_data->dev = dev; in q6pcm_routing_probe()
1137 mutex_init(&routing_data->lock); in q6pcm_routing_probe()
1152 { .compatible = "qcom,q6adm-routing" },
1168 MODULE_DESCRIPTION("Q6 Routing platform");