Merge "ASoC: msm: qdsp6v2: add support for tx app type config"
This commit is contained in:
commit
1242c04867
5 changed files with 390 additions and 88 deletions
|
@ -2779,10 +2779,10 @@ static int msm_compr_app_type_cfg_put(struct snd_kcontrol *kcontrol,
|
||||||
acdb_dev_id = ucontrol->value.integer.value[1];
|
acdb_dev_id = ucontrol->value.integer.value[1];
|
||||||
if (0 != ucontrol->value.integer.value[2])
|
if (0 != ucontrol->value.integer.value[2])
|
||||||
sample_rate = ucontrol->value.integer.value[2];
|
sample_rate = ucontrol->value.integer.value[2];
|
||||||
pr_debug("%s: app_type- %d acdb_dev_id- %d sample_rate- %d\n",
|
pr_debug("%s: app_type- %d acdb_dev_id- %d sample_rate- %d session_type- %d\n",
|
||||||
__func__, app_type, acdb_dev_id, sample_rate);
|
__func__, app_type, acdb_dev_id, sample_rate, SESSION_TYPE_RX);
|
||||||
msm_pcm_routing_reg_stream_app_type_cfg(fe_id, app_type,
|
msm_pcm_routing_reg_stream_app_type_cfg(fe_id, app_type,
|
||||||
acdb_dev_id, sample_rate);
|
acdb_dev_id, sample_rate, SESSION_TYPE_RX);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -2804,8 +2804,8 @@ static int msm_compr_app_type_cfg_get(struct snd_kcontrol *kcontrol,
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = msm_pcm_routing_get_stream_app_type_cfg(fe_id, &app_type,
|
ret = msm_pcm_routing_get_stream_app_type_cfg(fe_id, SESSION_TYPE_RX,
|
||||||
&acdb_dev_id, &sample_rate);
|
&app_type, &acdb_dev_id, &sample_rate);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
pr_err("%s: msm_pcm_routing_get_stream_app_type_cfg failed returned %d\n",
|
pr_err("%s: msm_pcm_routing_get_stream_app_type_cfg failed returned %d\n",
|
||||||
__func__, ret);
|
__func__, ret);
|
||||||
|
@ -2815,8 +2815,9 @@ static int msm_compr_app_type_cfg_get(struct snd_kcontrol *kcontrol,
|
||||||
ucontrol->value.integer.value[0] = app_type;
|
ucontrol->value.integer.value[0] = app_type;
|
||||||
ucontrol->value.integer.value[1] = acdb_dev_id;
|
ucontrol->value.integer.value[1] = acdb_dev_id;
|
||||||
ucontrol->value.integer.value[2] = sample_rate;
|
ucontrol->value.integer.value[2] = sample_rate;
|
||||||
pr_debug("%s: fedai_id %llu, app_type %d, acdb_dev_id %d, sample_rate %d\n",
|
pr_debug("%s: fedai_id %llu, session_type %d, app_type %d, acdb_dev_id %d, sample_rate %d\n",
|
||||||
__func__, fe_id, app_type, acdb_dev_id, sample_rate);
|
__func__, fe_id, SESSION_TYPE_RX,
|
||||||
|
app_type, acdb_dev_id, sample_rate);
|
||||||
done:
|
done:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -516,7 +516,7 @@ exit:
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int msm_pcm_add_controls(struct snd_soc_pcm_runtime *rtd)
|
static int msm_pcm_add_volume_controls(struct snd_soc_pcm_runtime *rtd)
|
||||||
{
|
{
|
||||||
struct snd_pcm *pcm = rtd->pcm->streams[0].pcm;
|
struct snd_pcm *pcm = rtd->pcm->streams[0].pcm;
|
||||||
struct snd_pcm_volume *volume_info;
|
struct snd_pcm_volume *volume_info;
|
||||||
|
@ -537,6 +537,192 @@ static int msm_pcm_add_controls(struct snd_soc_pcm_runtime *rtd)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int msm_pcm_playback_app_type_cfg_ctl_put(struct snd_kcontrol *kcontrol,
|
||||||
|
struct snd_ctl_elem_value *ucontrol)
|
||||||
|
{
|
||||||
|
u64 fe_id = kcontrol->private_value;
|
||||||
|
int app_type;
|
||||||
|
int acdb_dev_id;
|
||||||
|
int sample_rate = 48000;
|
||||||
|
|
||||||
|
pr_debug("%s: fe_id- %llu\n", __func__, fe_id);
|
||||||
|
if (fe_id >= MSM_FRONTEND_DAI_MAX) {
|
||||||
|
pr_err("%s: Received out of bounds fe_id %llu\n",
|
||||||
|
__func__, fe_id);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
app_type = ucontrol->value.integer.value[0];
|
||||||
|
acdb_dev_id = ucontrol->value.integer.value[1];
|
||||||
|
if (ucontrol->value.integer.value[2] != 0)
|
||||||
|
sample_rate = ucontrol->value.integer.value[2];
|
||||||
|
pr_debug("%s: app_type- %d acdb_dev_id- %d sample_rate- %d session_type- %d\n",
|
||||||
|
__func__, app_type, acdb_dev_id, sample_rate, SESSION_TYPE_RX);
|
||||||
|
msm_pcm_routing_reg_stream_app_type_cfg(fe_id, app_type,
|
||||||
|
acdb_dev_id, sample_rate, SESSION_TYPE_RX);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int msm_pcm_playback_app_type_cfg_ctl_get(struct snd_kcontrol *kcontrol,
|
||||||
|
struct snd_ctl_elem_value *ucontrol)
|
||||||
|
{
|
||||||
|
u64 fe_id = kcontrol->private_value;
|
||||||
|
int ret = 0;
|
||||||
|
int app_type;
|
||||||
|
int acdb_dev_id;
|
||||||
|
int sample_rate;
|
||||||
|
|
||||||
|
pr_debug("%s: fe_id- %llu\n", __func__, fe_id);
|
||||||
|
if (fe_id >= MSM_FRONTEND_DAI_MAX) {
|
||||||
|
pr_err("%s: Received out of bounds fe_id %llu\n",
|
||||||
|
__func__, fe_id);
|
||||||
|
ret = -EINVAL;
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = msm_pcm_routing_get_stream_app_type_cfg(fe_id, SESSION_TYPE_RX,
|
||||||
|
&app_type, &acdb_dev_id, &sample_rate);
|
||||||
|
if (ret < 0) {
|
||||||
|
pr_err("%s: msm_pcm_routing_get_stream_app_type_cfg failed returned %d\n",
|
||||||
|
__func__, ret);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
ucontrol->value.integer.value[0] = app_type;
|
||||||
|
ucontrol->value.integer.value[1] = acdb_dev_id;
|
||||||
|
ucontrol->value.integer.value[2] = sample_rate;
|
||||||
|
pr_debug("%s: fedai_id %llu, session_type %d, app_type %d, acdb_dev_id %d, sample_rate %d\n",
|
||||||
|
__func__, fe_id, SESSION_TYPE_RX,
|
||||||
|
app_type, acdb_dev_id, sample_rate);
|
||||||
|
done:
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int msm_pcm_capture_app_type_cfg_ctl_put(struct snd_kcontrol *kcontrol,
|
||||||
|
struct snd_ctl_elem_value *ucontrol)
|
||||||
|
{
|
||||||
|
u64 fe_id = kcontrol->private_value;
|
||||||
|
int app_type;
|
||||||
|
int acdb_dev_id;
|
||||||
|
int sample_rate = 48000;
|
||||||
|
|
||||||
|
pr_debug("%s: fe_id- %llu\n", __func__, fe_id);
|
||||||
|
if (fe_id >= MSM_FRONTEND_DAI_MAX) {
|
||||||
|
pr_err("%s: Received out of bounds fe_id %llu\n",
|
||||||
|
__func__, fe_id);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
app_type = ucontrol->value.integer.value[0];
|
||||||
|
acdb_dev_id = ucontrol->value.integer.value[1];
|
||||||
|
if (ucontrol->value.integer.value[2] != 0)
|
||||||
|
sample_rate = ucontrol->value.integer.value[2];
|
||||||
|
pr_debug("%s: app_type- %d acdb_dev_id- %d sample_rate- %d session_type- %d\n",
|
||||||
|
__func__, app_type, acdb_dev_id, sample_rate, SESSION_TYPE_TX);
|
||||||
|
msm_pcm_routing_reg_stream_app_type_cfg(fe_id, app_type,
|
||||||
|
acdb_dev_id, sample_rate, SESSION_TYPE_TX);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int msm_pcm_capture_app_type_cfg_ctl_get(struct snd_kcontrol *kcontrol,
|
||||||
|
struct snd_ctl_elem_value *ucontrol)
|
||||||
|
{
|
||||||
|
u64 fe_id = kcontrol->private_value;
|
||||||
|
int ret = 0;
|
||||||
|
int app_type;
|
||||||
|
int acdb_dev_id;
|
||||||
|
int sample_rate;
|
||||||
|
|
||||||
|
pr_debug("%s: fe_id- %llu\n", __func__, fe_id);
|
||||||
|
if (fe_id >= MSM_FRONTEND_DAI_MAX) {
|
||||||
|
pr_err("%s: Received out of bounds fe_id %llu\n",
|
||||||
|
__func__, fe_id);
|
||||||
|
ret = -EINVAL;
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = msm_pcm_routing_get_stream_app_type_cfg(fe_id, SESSION_TYPE_TX,
|
||||||
|
&app_type, &acdb_dev_id, &sample_rate);
|
||||||
|
if (ret < 0) {
|
||||||
|
pr_err("%s: msm_pcm_routing_get_stream_app_type_cfg failed returned %d\n",
|
||||||
|
__func__, ret);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
ucontrol->value.integer.value[0] = app_type;
|
||||||
|
ucontrol->value.integer.value[1] = acdb_dev_id;
|
||||||
|
ucontrol->value.integer.value[2] = sample_rate;
|
||||||
|
pr_debug("%s: fedai_id %llu, session_type %d, app_type %d, acdb_dev_id %d, sample_rate %d\n",
|
||||||
|
__func__, fe_id, SESSION_TYPE_TX,
|
||||||
|
app_type, acdb_dev_id, sample_rate);
|
||||||
|
done:
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int msm_pcm_add_app_type_controls(struct snd_soc_pcm_runtime *rtd)
|
||||||
|
{
|
||||||
|
struct snd_pcm *pcm = rtd->pcm->streams[0].pcm;
|
||||||
|
struct snd_pcm_usr *app_type_info;
|
||||||
|
struct snd_kcontrol *kctl;
|
||||||
|
const char *playback_mixer_ctl_name = "Audio Stream";
|
||||||
|
const char *capture_mixer_ctl_name = "Audio Stream Capture";
|
||||||
|
const char *deviceNo = "NN";
|
||||||
|
const char *suffix = "App Type Cfg";
|
||||||
|
int ctl_len, ret = 0;
|
||||||
|
|
||||||
|
if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) {
|
||||||
|
ctl_len = strlen(playback_mixer_ctl_name) + 1 +
|
||||||
|
strlen(deviceNo) + 1 + strlen(suffix) + 1;
|
||||||
|
pr_debug("%s: Playback app type cntrl add\n", __func__);
|
||||||
|
ret = snd_pcm_add_usr_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK,
|
||||||
|
NULL, 1, ctl_len, rtd->dai_link->be_id,
|
||||||
|
&app_type_info);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
kctl = app_type_info->kctl;
|
||||||
|
snprintf(kctl->id.name, ctl_len, "%s %d %s",
|
||||||
|
playback_mixer_ctl_name, rtd->pcm->device, suffix);
|
||||||
|
kctl->put = msm_pcm_playback_app_type_cfg_ctl_put;
|
||||||
|
kctl->get = msm_pcm_playback_app_type_cfg_ctl_get;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) {
|
||||||
|
ctl_len = strlen(capture_mixer_ctl_name) + 1 +
|
||||||
|
strlen(deviceNo) + 1 + strlen(suffix) + 1;
|
||||||
|
pr_debug("%s: Capture app type cntrl add\n", __func__);
|
||||||
|
ret = snd_pcm_add_usr_ctls(pcm, SNDRV_PCM_STREAM_CAPTURE,
|
||||||
|
NULL, 1, ctl_len, rtd->dai_link->be_id,
|
||||||
|
&app_type_info);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
kctl = app_type_info->kctl;
|
||||||
|
snprintf(kctl->id.name, ctl_len, "%s %d %s",
|
||||||
|
capture_mixer_ctl_name, rtd->pcm->device, suffix);
|
||||||
|
kctl->put = msm_pcm_capture_app_type_cfg_ctl_put;
|
||||||
|
kctl->get = msm_pcm_capture_app_type_cfg_ctl_get;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int msm_pcm_add_controls(struct snd_soc_pcm_runtime *rtd)
|
||||||
|
{
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
|
pr_debug("%s\n", __func__);
|
||||||
|
ret = msm_pcm_add_volume_controls(rtd);
|
||||||
|
if (ret)
|
||||||
|
pr_err("%s: pcm add volume controls failed:%d\n",
|
||||||
|
__func__, ret);
|
||||||
|
ret = msm_pcm_add_app_type_controls(rtd);
|
||||||
|
if (ret)
|
||||||
|
pr_err("%s: pcm add app type controls failed:%d\n",
|
||||||
|
__func__, ret);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
static int msm_asoc_pcm_new(struct snd_soc_pcm_runtime *rtd)
|
static int msm_asoc_pcm_new(struct snd_soc_pcm_runtime *rtd)
|
||||||
{
|
{
|
||||||
struct snd_card *card = rtd->card->snd_card;
|
struct snd_card *card = rtd->card->snd_card;
|
||||||
|
|
|
@ -1178,7 +1178,7 @@ static int msm_pcm_add_chmap_controls(struct snd_soc_pcm_runtime *rtd)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int msm_pcm_app_type_cfg_ctl_put(struct snd_kcontrol *kcontrol,
|
static int msm_pcm_playback_app_type_cfg_ctl_put(struct snd_kcontrol *kcontrol,
|
||||||
struct snd_ctl_elem_value *ucontrol)
|
struct snd_ctl_elem_value *ucontrol)
|
||||||
{
|
{
|
||||||
u64 fe_id = kcontrol->private_value;
|
u64 fe_id = kcontrol->private_value;
|
||||||
|
@ -1197,15 +1197,15 @@ static int msm_pcm_app_type_cfg_ctl_put(struct snd_kcontrol *kcontrol,
|
||||||
acdb_dev_id = ucontrol->value.integer.value[1];
|
acdb_dev_id = ucontrol->value.integer.value[1];
|
||||||
if (0 != ucontrol->value.integer.value[2])
|
if (0 != ucontrol->value.integer.value[2])
|
||||||
sample_rate = ucontrol->value.integer.value[2];
|
sample_rate = ucontrol->value.integer.value[2];
|
||||||
pr_debug("%s: app_type- %d acdb_dev_id- %d sample_rate- %d\n",
|
pr_debug("%s: app_type- %d acdb_dev_id- %d sample_rate- %d session_type- %d\n",
|
||||||
__func__, app_type, acdb_dev_id, sample_rate);
|
__func__, app_type, acdb_dev_id, sample_rate, SESSION_TYPE_RX);
|
||||||
msm_pcm_routing_reg_stream_app_type_cfg(fe_id, app_type,
|
msm_pcm_routing_reg_stream_app_type_cfg(fe_id, app_type,
|
||||||
acdb_dev_id, sample_rate);
|
acdb_dev_id, sample_rate, SESSION_TYPE_RX);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int msm_pcm_app_type_cfg_ctl_get(struct snd_kcontrol *kcontrol,
|
static int msm_pcm_playback_app_type_cfg_ctl_get(struct snd_kcontrol *kcontrol,
|
||||||
struct snd_ctl_elem_value *ucontrol)
|
struct snd_ctl_elem_value *ucontrol)
|
||||||
{
|
{
|
||||||
u64 fe_id = kcontrol->private_value;
|
u64 fe_id = kcontrol->private_value;
|
||||||
|
@ -1222,8 +1222,8 @@ static int msm_pcm_app_type_cfg_ctl_get(struct snd_kcontrol *kcontrol,
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = msm_pcm_routing_get_stream_app_type_cfg(fe_id, &app_type,
|
ret = msm_pcm_routing_get_stream_app_type_cfg(fe_id, SESSION_TYPE_RX,
|
||||||
&acdb_dev_id, &sample_rate);
|
&app_type, &acdb_dev_id, &sample_rate);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
pr_err("%s: msm_pcm_routing_get_stream_app_type_cfg failed returned %d\n",
|
pr_err("%s: msm_pcm_routing_get_stream_app_type_cfg failed returned %d\n",
|
||||||
__func__, ret);
|
__func__, ret);
|
||||||
|
@ -1233,8 +1233,71 @@ static int msm_pcm_app_type_cfg_ctl_get(struct snd_kcontrol *kcontrol,
|
||||||
ucontrol->value.integer.value[0] = app_type;
|
ucontrol->value.integer.value[0] = app_type;
|
||||||
ucontrol->value.integer.value[1] = acdb_dev_id;
|
ucontrol->value.integer.value[1] = acdb_dev_id;
|
||||||
ucontrol->value.integer.value[2] = sample_rate;
|
ucontrol->value.integer.value[2] = sample_rate;
|
||||||
pr_debug("%s: fedai_id %llu, app_type %d, acdb_dev_id %d, sample_rate %d\n",
|
pr_debug("%s: fedai_id %llu, session_type %d, app_type %d, acdb_dev_id %d, sample_rate %d\n",
|
||||||
__func__, fe_id, app_type, acdb_dev_id, sample_rate);
|
__func__, fe_id, SESSION_TYPE_RX,
|
||||||
|
app_type, acdb_dev_id, sample_rate);
|
||||||
|
done:
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int msm_pcm_capture_app_type_cfg_ctl_put(struct snd_kcontrol *kcontrol,
|
||||||
|
struct snd_ctl_elem_value *ucontrol)
|
||||||
|
{
|
||||||
|
u64 fe_id = kcontrol->private_value;
|
||||||
|
int app_type;
|
||||||
|
int acdb_dev_id;
|
||||||
|
int sample_rate = 48000;
|
||||||
|
|
||||||
|
pr_debug("%s: fe_id- %llu\n", __func__, fe_id);
|
||||||
|
if (fe_id >= MSM_FRONTEND_DAI_MAX) {
|
||||||
|
pr_err("%s: Received out of bounds fe_id %llu\n",
|
||||||
|
__func__, fe_id);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
app_type = ucontrol->value.integer.value[0];
|
||||||
|
acdb_dev_id = ucontrol->value.integer.value[1];
|
||||||
|
if (ucontrol->value.integer.value[2] != 0)
|
||||||
|
sample_rate = ucontrol->value.integer.value[2];
|
||||||
|
pr_debug("%s: app_type- %d acdb_dev_id- %d sample_rate- %d session_type- %d\n",
|
||||||
|
__func__, app_type, acdb_dev_id, sample_rate, SESSION_TYPE_TX);
|
||||||
|
msm_pcm_routing_reg_stream_app_type_cfg(fe_id, app_type,
|
||||||
|
acdb_dev_id, sample_rate, SESSION_TYPE_TX);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int msm_pcm_capture_app_type_cfg_ctl_get(struct snd_kcontrol *kcontrol,
|
||||||
|
struct snd_ctl_elem_value *ucontrol)
|
||||||
|
{
|
||||||
|
u64 fe_id = kcontrol->private_value;
|
||||||
|
int ret = 0;
|
||||||
|
int app_type;
|
||||||
|
int acdb_dev_id;
|
||||||
|
int sample_rate;
|
||||||
|
|
||||||
|
pr_debug("%s: fe_id- %llu\n", __func__, fe_id);
|
||||||
|
if (fe_id >= MSM_FRONTEND_DAI_MAX) {
|
||||||
|
pr_err("%s: Received out of bounds fe_id %llu\n",
|
||||||
|
__func__, fe_id);
|
||||||
|
ret = -EINVAL;
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = msm_pcm_routing_get_stream_app_type_cfg(fe_id, SESSION_TYPE_TX,
|
||||||
|
&app_type, &acdb_dev_id, &sample_rate);
|
||||||
|
if (ret < 0) {
|
||||||
|
pr_err("%s: msm_pcm_routing_get_stream_app_type_cfg failed returned %d\n",
|
||||||
|
__func__, ret);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
ucontrol->value.integer.value[0] = app_type;
|
||||||
|
ucontrol->value.integer.value[1] = acdb_dev_id;
|
||||||
|
ucontrol->value.integer.value[2] = sample_rate;
|
||||||
|
pr_debug("%s: fedai_id %llu, session_type %d, app_type %d, acdb_dev_id %d, sample_rate %d\n",
|
||||||
|
__func__, fe_id, SESSION_TYPE_TX,
|
||||||
|
app_type, acdb_dev_id, sample_rate);
|
||||||
done:
|
done:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -1244,27 +1307,49 @@ static int msm_pcm_add_app_type_controls(struct snd_soc_pcm_runtime *rtd)
|
||||||
struct snd_pcm *pcm = rtd->pcm;
|
struct snd_pcm *pcm = rtd->pcm;
|
||||||
struct snd_pcm_usr *app_type_info;
|
struct snd_pcm_usr *app_type_info;
|
||||||
struct snd_kcontrol *kctl;
|
struct snd_kcontrol *kctl;
|
||||||
const char *mixer_ctl_name = "Audio Stream";
|
const char *playback_mixer_ctl_name = "Audio Stream";
|
||||||
|
const char *capture_mixer_ctl_name = "Audio Stream Capture";
|
||||||
const char *deviceNo = "NN";
|
const char *deviceNo = "NN";
|
||||||
const char *suffix = "App Type Cfg";
|
const char *suffix = "App Type Cfg";
|
||||||
int ctl_len, ret = 0;
|
int ctl_len, ret = 0;
|
||||||
|
|
||||||
ctl_len = strlen(mixer_ctl_name) + 1 + strlen(deviceNo) + 1 +
|
if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) {
|
||||||
strlen(suffix) + 1;
|
ctl_len = strlen(playback_mixer_ctl_name) + 1 +
|
||||||
pr_debug("%s, App type cntrl add\n", __func__);
|
strlen(deviceNo) + 1 + strlen(suffix) + 1;
|
||||||
ret = snd_pcm_add_usr_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK,
|
pr_debug("%s: Playback app type cntrl add\n", __func__);
|
||||||
NULL, 1, ctl_len, rtd->dai_link->be_id,
|
ret = snd_pcm_add_usr_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK,
|
||||||
&app_type_info);
|
NULL, 1, ctl_len, rtd->dai_link->be_id,
|
||||||
if (ret < 0) {
|
&app_type_info);
|
||||||
pr_err("%s, app type cntrl add failed:%d\n", __func__, ret);
|
if (ret < 0) {
|
||||||
return ret;
|
pr_err("%s: playback app type cntrl add failed: %d\n",
|
||||||
|
__func__, ret);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
kctl = app_type_info->kctl;
|
||||||
|
snprintf(kctl->id.name, ctl_len, "%s %d %s",
|
||||||
|
playback_mixer_ctl_name, rtd->pcm->device, suffix);
|
||||||
|
kctl->put = msm_pcm_playback_app_type_cfg_ctl_put;
|
||||||
|
kctl->get = msm_pcm_playback_app_type_cfg_ctl_get;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) {
|
||||||
|
ctl_len = strlen(capture_mixer_ctl_name) + 1 +
|
||||||
|
strlen(deviceNo) + 1 + strlen(suffix) + 1;
|
||||||
|
pr_debug("%s: Capture app type cntrl add\n", __func__);
|
||||||
|
ret = snd_pcm_add_usr_ctls(pcm, SNDRV_PCM_STREAM_CAPTURE,
|
||||||
|
NULL, 1, ctl_len, rtd->dai_link->be_id,
|
||||||
|
&app_type_info);
|
||||||
|
if (ret < 0) {
|
||||||
|
pr_err("%s: capture app type cntrl add failed: %d\n",
|
||||||
|
__func__, ret);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
kctl = app_type_info->kctl;
|
||||||
|
snprintf(kctl->id.name, ctl_len, "%s %d %s",
|
||||||
|
capture_mixer_ctl_name, rtd->pcm->device, suffix);
|
||||||
|
kctl->put = msm_pcm_capture_app_type_cfg_ctl_put;
|
||||||
|
kctl->get = msm_pcm_capture_app_type_cfg_ctl_get;
|
||||||
}
|
}
|
||||||
kctl = app_type_info->kctl;
|
|
||||||
snprintf(kctl->id.name, ctl_len, "%s %d %s", mixer_ctl_name,
|
|
||||||
rtd->pcm->device, suffix);
|
|
||||||
kctl = app_type_info->kctl;
|
|
||||||
kctl->put = msm_pcm_app_type_cfg_ctl_put;
|
|
||||||
kctl->get = msm_pcm_app_type_cfg_ctl_get;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -553,7 +553,7 @@ static unsigned long session_copp_map[MSM_FRONTEND_DAI_MM_SIZE][2]
|
||||||
[MSM_BACKEND_DAI_MAX];
|
[MSM_BACKEND_DAI_MAX];
|
||||||
static struct msm_pcm_routing_app_type_data app_type_cfg[MAX_APP_TYPES];
|
static struct msm_pcm_routing_app_type_data app_type_cfg[MAX_APP_TYPES];
|
||||||
static struct msm_pcm_stream_app_type_cfg
|
static struct msm_pcm_stream_app_type_cfg
|
||||||
fe_dai_app_type_cfg[MSM_FRONTEND_DAI_MM_SIZE];
|
fe_dai_app_type_cfg[MSM_FRONTEND_DAI_MM_SIZE][2];
|
||||||
|
|
||||||
/* The caller of this should aqcuire routing lock */
|
/* The caller of this should aqcuire routing lock */
|
||||||
void msm_pcm_routing_get_bedai_info(int be_idx,
|
void msm_pcm_routing_get_bedai_info(int be_idx,
|
||||||
|
@ -597,34 +597,43 @@ static int msm_pcm_routing_get_app_type_idx(int app_type)
|
||||||
}
|
}
|
||||||
|
|
||||||
void msm_pcm_routing_reg_stream_app_type_cfg(int fedai_id, int app_type,
|
void msm_pcm_routing_reg_stream_app_type_cfg(int fedai_id, int app_type,
|
||||||
int acdb_dev_id, int sample_rate)
|
int acdb_dev_id, int sample_rate, int session_type)
|
||||||
{
|
{
|
||||||
pr_debug("%s: fedai_id %d, app_type %d, sample_rate %d\n",
|
pr_debug("%s: fedai_id %d, session_type %d, app_type %d, acdb_dev_id %d, sample_rate %d\n",
|
||||||
__func__, fedai_id, app_type, sample_rate);
|
__func__, fedai_id, session_type, app_type,
|
||||||
|
acdb_dev_id, sample_rate);
|
||||||
if (fedai_id > MSM_FRONTEND_DAI_MM_MAX_ID) {
|
if (fedai_id > MSM_FRONTEND_DAI_MM_MAX_ID) {
|
||||||
pr_err("%s: Invalid machine driver ID %d\n",
|
pr_err("%s: Invalid machine driver ID %d\n",
|
||||||
__func__, fedai_id);
|
__func__, fedai_id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
fe_dai_app_type_cfg[fedai_id].app_type = app_type;
|
if (session_type != SESSION_TYPE_RX &&
|
||||||
fe_dai_app_type_cfg[fedai_id].acdb_dev_id = acdb_dev_id;
|
session_type != SESSION_TYPE_TX) {
|
||||||
fe_dai_app_type_cfg[fedai_id].sample_rate = sample_rate;
|
pr_err("%s: Invalid session type %d\n",
|
||||||
|
__func__, session_type);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
fe_dai_app_type_cfg[fedai_id][session_type].app_type = app_type;
|
||||||
|
fe_dai_app_type_cfg[fedai_id][session_type].acdb_dev_id = acdb_dev_id;
|
||||||
|
fe_dai_app_type_cfg[fedai_id][session_type].sample_rate = sample_rate;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* msm_pcm_routing_get_stream_app_type_cfg
|
* msm_pcm_routing_get_stream_app_type_cfg
|
||||||
*
|
*
|
||||||
* Receives fedai_id and populates app_type, acdb_dev_id, &
|
* Receives fedai_id, session_type and populates app_type, acdb_dev_id, &
|
||||||
* sample rate. Returns 0 on success. On failure returns
|
* sample rate. Returns 0 on success. On failure returns
|
||||||
* -EINVAL and does not alter passed values.
|
* -EINVAL and does not alter passed values.
|
||||||
*
|
*
|
||||||
* fedai_id - Passed value, front end ID for which app type config is wanted
|
* fedai_id - Passed value, front end ID for which app type config is wanted
|
||||||
|
* session_type - Passed value, session type for which app type config
|
||||||
|
* is wanted
|
||||||
* app_type - Returned value, app type used by app type config
|
* app_type - Returned value, app type used by app type config
|
||||||
* acdb_dev_id - Returned value, ACDB device ID used by app type config
|
* acdb_dev_id - Returned value, ACDB device ID used by app type config
|
||||||
* sample_rate - Returned value, sample rate used by app type config
|
* sample_rate - Returned value, sample rate used by app type config
|
||||||
*/
|
*/
|
||||||
int msm_pcm_routing_get_stream_app_type_cfg(int fedai_id, int *app_type,
|
int msm_pcm_routing_get_stream_app_type_cfg(int fedai_id, int session_type,
|
||||||
int *acdb_dev_id, int *sample_rate)
|
int *app_type, int *acdb_dev_id, int *sample_rate)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
|
@ -645,13 +654,20 @@ int msm_pcm_routing_get_stream_app_type_cfg(int fedai_id, int *app_type,
|
||||||
__func__, fedai_id);
|
__func__, fedai_id);
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
goto done;
|
goto done;
|
||||||
|
} else if (session_type != SESSION_TYPE_RX &&
|
||||||
|
session_type != SESSION_TYPE_TX) {
|
||||||
|
pr_err("%s: Invalid session type %d\n",
|
||||||
|
__func__, session_type);
|
||||||
|
ret = -EINVAL;
|
||||||
|
goto done;
|
||||||
}
|
}
|
||||||
*app_type = fe_dai_app_type_cfg[fedai_id].app_type;
|
*app_type = fe_dai_app_type_cfg[fedai_id][session_type].app_type;
|
||||||
*acdb_dev_id = fe_dai_app_type_cfg[fedai_id].acdb_dev_id;
|
*acdb_dev_id = fe_dai_app_type_cfg[fedai_id][session_type].acdb_dev_id;
|
||||||
*sample_rate = fe_dai_app_type_cfg[fedai_id].sample_rate;
|
*sample_rate = fe_dai_app_type_cfg[fedai_id][session_type].sample_rate;
|
||||||
|
|
||||||
pr_debug("%s: fedai_id %d, app_type %d, acdb_dev_id %d, sample_rate %d\n",
|
pr_debug("%s: fedai_id %d, session_type %d, app_type %d, acdb_dev_id %d, sample_rate %d\n",
|
||||||
__func__, fedai_id, *app_type, *acdb_dev_id, *sample_rate);
|
__func__, fedai_id, session_type,
|
||||||
|
*app_type, *acdb_dev_id, *sample_rate);
|
||||||
done:
|
done:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -708,7 +724,8 @@ static struct cal_block_data *msm_routing_find_topology(int path,
|
||||||
return msm_routing_find_topology_by_path(path);
|
return msm_routing_find_topology_by_path(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int msm_routing_get_adm_topology(int path, int fedai_id)
|
static int msm_routing_get_adm_topology(int path, int fedai_id,
|
||||||
|
int session_type)
|
||||||
{
|
{
|
||||||
int topology = NULL_COPP_TOPOLOGY;
|
int topology = NULL_COPP_TOPOLOGY;
|
||||||
struct cal_block_data *cal_block = NULL;
|
struct cal_block_data *cal_block = NULL;
|
||||||
|
@ -721,11 +738,10 @@ static int msm_routing_get_adm_topology(int path, int fedai_id)
|
||||||
|
|
||||||
mutex_lock(&cal_data->lock);
|
mutex_lock(&cal_data->lock);
|
||||||
|
|
||||||
if (path == RX_DEVICE) {
|
app_type = fe_dai_app_type_cfg[fedai_id][session_type].app_type;
|
||||||
app_type = fe_dai_app_type_cfg[fedai_id].app_type;
|
acdb_dev_id = fe_dai_app_type_cfg[fedai_id][session_type].acdb_dev_id;
|
||||||
acdb_dev_id = fe_dai_app_type_cfg[fedai_id].acdb_dev_id;
|
sample_rate = fe_dai_app_type_cfg[fedai_id][session_type].sample_rate;
|
||||||
sample_rate = fe_dai_app_type_cfg[fedai_id].sample_rate;
|
|
||||||
}
|
|
||||||
cal_block = msm_routing_find_topology(path, app_type,
|
cal_block = msm_routing_find_topology(path, app_type,
|
||||||
acdb_dev_id, sample_rate);
|
acdb_dev_id, sample_rate);
|
||||||
if (cal_block == NULL)
|
if (cal_block == NULL)
|
||||||
|
@ -781,9 +797,12 @@ static void msm_pcm_routing_build_matrix(int fedai_id, int sess_type,
|
||||||
if (num_copps) {
|
if (num_copps) {
|
||||||
payload.num_copps = num_copps;
|
payload.num_copps = num_copps;
|
||||||
payload.session_id = fe_dai_map[fedai_id][sess_type].strm_id;
|
payload.session_id = fe_dai_map[fedai_id][sess_type].strm_id;
|
||||||
payload.app_type = fe_dai_app_type_cfg[fedai_id].app_type;
|
payload.app_type =
|
||||||
payload.acdb_dev_id = fe_dai_app_type_cfg[fedai_id].acdb_dev_id;
|
fe_dai_app_type_cfg[fedai_id][sess_type].app_type;
|
||||||
payload.sample_rate = fe_dai_app_type_cfg[fedai_id].sample_rate;
|
payload.acdb_dev_id =
|
||||||
|
fe_dai_app_type_cfg[fedai_id][sess_type].acdb_dev_id;
|
||||||
|
payload.sample_rate =
|
||||||
|
fe_dai_app_type_cfg[fedai_id][sess_type].sample_rate;
|
||||||
adm_matrix_map(path_type, payload, perf_mode);
|
adm_matrix_map(path_type, payload, perf_mode);
|
||||||
msm_pcm_routng_cfg_matrix_map_pp(payload, path_type, perf_mode);
|
msm_pcm_routng_cfg_matrix_map_pp(payload, path_type, perf_mode);
|
||||||
}
|
}
|
||||||
|
@ -891,22 +910,23 @@ int msm_pcm_routing_reg_phy_compr_stream(int fe_id, int perf_mode,
|
||||||
|
|
||||||
bit_width = msm_routing_get_bit_width(
|
bit_width = msm_routing_get_bit_width(
|
||||||
msm_bedais[i].format);
|
msm_bedais[i].format);
|
||||||
app_type = (stream_type == SNDRV_PCM_STREAM_PLAYBACK) ?
|
app_type =
|
||||||
fe_dai_app_type_cfg[fe_id].app_type : 0;
|
fe_dai_app_type_cfg[fe_id][session_type].app_type;
|
||||||
if (app_type) {
|
if (app_type) {
|
||||||
app_type_idx =
|
app_type_idx =
|
||||||
msm_pcm_routing_get_app_type_idx(
|
msm_pcm_routing_get_app_type_idx(
|
||||||
app_type);
|
app_type);
|
||||||
sample_rate =
|
sample_rate =
|
||||||
fe_dai_app_type_cfg[fe_id].sample_rate;
|
fe_dai_app_type_cfg[fe_id][session_type].sample_rate;
|
||||||
bit_width =
|
bit_width =
|
||||||
app_type_cfg[app_type_idx].bit_width;
|
app_type_cfg[app_type_idx].bit_width;
|
||||||
} else {
|
} else {
|
||||||
sample_rate = msm_bedais[i].sample_rate;
|
sample_rate = msm_bedais[i].sample_rate;
|
||||||
}
|
}
|
||||||
acdb_dev_id = fe_dai_app_type_cfg[fe_id].acdb_dev_id;
|
acdb_dev_id =
|
||||||
|
fe_dai_app_type_cfg[fe_id][session_type].acdb_dev_id;
|
||||||
topology = msm_routing_get_adm_topology(path_type,
|
topology = msm_routing_get_adm_topology(path_type,
|
||||||
fe_id);
|
fe_id, session_type);
|
||||||
if (compr_passthr_mode == COMPRESSED_PASSTHROUGH_DSD)
|
if (compr_passthr_mode == COMPRESSED_PASSTHROUGH_DSD)
|
||||||
topology = COMPRESS_PASSTHROUGH_NONE_TOPOLOGY;
|
topology = COMPRESS_PASSTHROUGH_NONE_TOPOLOGY;
|
||||||
pr_err("%s: Before adm open topology %d\n", __func__,
|
pr_err("%s: Before adm open topology %d\n", __func__,
|
||||||
|
@ -956,8 +976,10 @@ int msm_pcm_routing_reg_phy_compr_stream(int fe_id, int perf_mode,
|
||||||
if (num_copps) {
|
if (num_copps) {
|
||||||
payload.num_copps = num_copps;
|
payload.num_copps = num_copps;
|
||||||
payload.session_id = fe_dai_map[fe_id][session_type].strm_id;
|
payload.session_id = fe_dai_map[fe_id][session_type].strm_id;
|
||||||
payload.app_type = fe_dai_app_type_cfg[fe_id].app_type;
|
payload.app_type =
|
||||||
payload.acdb_dev_id = fe_dai_app_type_cfg[fe_id].acdb_dev_id;
|
fe_dai_app_type_cfg[fe_id][session_type].app_type;
|
||||||
|
payload.acdb_dev_id =
|
||||||
|
fe_dai_app_type_cfg[fe_id][session_type].acdb_dev_id;
|
||||||
adm_matrix_map(path_type, payload, perf_mode);
|
adm_matrix_map(path_type, payload, perf_mode);
|
||||||
msm_pcm_routng_cfg_matrix_map_pp(payload, path_type, perf_mode);
|
msm_pcm_routng_cfg_matrix_map_pp(payload, path_type, perf_mode);
|
||||||
}
|
}
|
||||||
|
@ -1054,21 +1076,23 @@ int msm_pcm_routing_reg_phy_stream(int fedai_id, int perf_mode,
|
||||||
bits_per_sample = msm_routing_get_bit_width(
|
bits_per_sample = msm_routing_get_bit_width(
|
||||||
msm_bedais[i].format);
|
msm_bedais[i].format);
|
||||||
|
|
||||||
app_type = (stream_type == SNDRV_PCM_STREAM_PLAYBACK) ?
|
app_type =
|
||||||
fe_dai_app_type_cfg[fedai_id].app_type : 0;
|
fe_dai_app_type_cfg[fedai_id][session_type].app_type;
|
||||||
if (app_type) {
|
if (app_type) {
|
||||||
app_type_idx =
|
app_type_idx =
|
||||||
msm_pcm_routing_get_app_type_idx(app_type);
|
msm_pcm_routing_get_app_type_idx(app_type);
|
||||||
sample_rate =
|
sample_rate =
|
||||||
fe_dai_app_type_cfg[fedai_id].sample_rate;
|
fe_dai_app_type_cfg[fedai_id][session_type].
|
||||||
|
sample_rate;
|
||||||
bits_per_sample =
|
bits_per_sample =
|
||||||
app_type_cfg[app_type_idx].bit_width;
|
app_type_cfg[app_type_idx].bit_width;
|
||||||
} else
|
} else
|
||||||
sample_rate = msm_bedais[i].sample_rate;
|
sample_rate = msm_bedais[i].sample_rate;
|
||||||
|
|
||||||
acdb_dev_id = fe_dai_app_type_cfg[fedai_id].acdb_dev_id;
|
acdb_dev_id =
|
||||||
|
fe_dai_app_type_cfg[fedai_id][session_type].acdb_dev_id;
|
||||||
topology = msm_routing_get_adm_topology(path_type,
|
topology = msm_routing_get_adm_topology(path_type,
|
||||||
fedai_id);
|
fedai_id, session_type);
|
||||||
copp_idx = adm_open(msm_bedais[i].port_id, path_type,
|
copp_idx = adm_open(msm_bedais[i].port_id, path_type,
|
||||||
sample_rate, channels, topology,
|
sample_rate, channels, topology,
|
||||||
perf_mode, bits_per_sample,
|
perf_mode, bits_per_sample,
|
||||||
|
@ -1113,9 +1137,12 @@ int msm_pcm_routing_reg_phy_stream(int fedai_id, int perf_mode,
|
||||||
if (num_copps) {
|
if (num_copps) {
|
||||||
payload.num_copps = num_copps;
|
payload.num_copps = num_copps;
|
||||||
payload.session_id = fe_dai_map[fedai_id][session_type].strm_id;
|
payload.session_id = fe_dai_map[fedai_id][session_type].strm_id;
|
||||||
payload.app_type = fe_dai_app_type_cfg[fedai_id].app_type;
|
payload.app_type =
|
||||||
payload.acdb_dev_id = fe_dai_app_type_cfg[fedai_id].acdb_dev_id;
|
fe_dai_app_type_cfg[fedai_id][session_type].app_type;
|
||||||
payload.sample_rate = fe_dai_app_type_cfg[fedai_id].sample_rate;
|
payload.acdb_dev_id =
|
||||||
|
fe_dai_app_type_cfg[fedai_id][session_type].acdb_dev_id;
|
||||||
|
payload.sample_rate =
|
||||||
|
fe_dai_app_type_cfg[fedai_id][session_type].sample_rate;
|
||||||
adm_matrix_map(path_type, payload, perf_mode);
|
adm_matrix_map(path_type, payload, perf_mode);
|
||||||
msm_pcm_routng_cfg_matrix_map_pp(payload, path_type, perf_mode);
|
msm_pcm_routng_cfg_matrix_map_pp(payload, path_type, perf_mode);
|
||||||
}
|
}
|
||||||
|
@ -1283,20 +1310,23 @@ static void msm_pcm_routing_process_audio(u16 reg, u16 val, int set)
|
||||||
bits_per_sample = msm_routing_get_bit_width(
|
bits_per_sample = msm_routing_get_bit_width(
|
||||||
msm_bedais[reg].format);
|
msm_bedais[reg].format);
|
||||||
|
|
||||||
app_type = (session_type == SESSION_TYPE_RX) ?
|
app_type =
|
||||||
fe_dai_app_type_cfg[val].app_type : 0;
|
fe_dai_app_type_cfg[val][session_type].app_type;
|
||||||
if (app_type) {
|
if (app_type) {
|
||||||
app_type_idx =
|
app_type_idx =
|
||||||
msm_pcm_routing_get_app_type_idx(app_type);
|
msm_pcm_routing_get_app_type_idx(app_type);
|
||||||
sample_rate =
|
sample_rate =
|
||||||
fe_dai_app_type_cfg[val].sample_rate;
|
fe_dai_app_type_cfg[val][session_type].
|
||||||
|
sample_rate;
|
||||||
bits_per_sample =
|
bits_per_sample =
|
||||||
app_type_cfg[app_type_idx].bit_width;
|
app_type_cfg[app_type_idx].bit_width;
|
||||||
} else
|
} else
|
||||||
sample_rate = msm_bedais[reg].sample_rate;
|
sample_rate = msm_bedais[reg].sample_rate;
|
||||||
|
|
||||||
topology = msm_routing_get_adm_topology(path_type, val);
|
topology = msm_routing_get_adm_topology(path_type, val,
|
||||||
acdb_dev_id = fe_dai_app_type_cfg[val].acdb_dev_id;
|
session_type);
|
||||||
|
acdb_dev_id =
|
||||||
|
fe_dai_app_type_cfg[val][session_type].acdb_dev_id;
|
||||||
copp_idx = adm_open(msm_bedais[reg].port_id, path_type,
|
copp_idx = adm_open(msm_bedais[reg].port_id, path_type,
|
||||||
sample_rate, channels, topology,
|
sample_rate, channels, topology,
|
||||||
fdai->perf_mode, bits_per_sample,
|
fdai->perf_mode, bits_per_sample,
|
||||||
|
@ -11050,7 +11080,6 @@ static int msm_pcm_routing_prepare(struct snd_pcm_substream *substream)
|
||||||
int i, path_type, session_type, topology;
|
int i, path_type, session_type, topology;
|
||||||
struct msm_pcm_routing_bdai_data *bedai;
|
struct msm_pcm_routing_bdai_data *bedai;
|
||||||
u32 channels, sample_rate;
|
u32 channels, sample_rate;
|
||||||
bool playback, capture;
|
|
||||||
uint16_t bits_per_sample = 16, voc_path_type;
|
uint16_t bits_per_sample = 16, voc_path_type;
|
||||||
struct msm_pcm_routing_fdai_data *fdai;
|
struct msm_pcm_routing_fdai_data *fdai;
|
||||||
u32 session_id;
|
u32 session_id;
|
||||||
|
@ -11086,8 +11115,6 @@ static int msm_pcm_routing_prepare(struct snd_pcm_substream *substream)
|
||||||
* is started.
|
* is started.
|
||||||
*/
|
*/
|
||||||
bedai->active = 1;
|
bedai->active = 1;
|
||||||
playback = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
|
|
||||||
capture = substream->stream == SNDRV_PCM_STREAM_CAPTURE;
|
|
||||||
|
|
||||||
for_each_set_bit(i, &bedai->fe_sessions, MSM_FRONTEND_DAI_MM_SIZE) {
|
for_each_set_bit(i, &bedai->fe_sessions, MSM_FRONTEND_DAI_MM_SIZE) {
|
||||||
fdai = &fe_dai_map[i][session_type];
|
fdai = &fe_dai_map[i][session_type];
|
||||||
|
@ -11109,13 +11136,14 @@ static int msm_pcm_routing_prepare(struct snd_pcm_substream *substream)
|
||||||
bits_per_sample = msm_routing_get_bit_width(
|
bits_per_sample = msm_routing_get_bit_width(
|
||||||
bedai->format);
|
bedai->format);
|
||||||
|
|
||||||
app_type = playback ?
|
app_type =
|
||||||
fe_dai_app_type_cfg[i].app_type : 0;
|
fe_dai_app_type_cfg[i][session_type].app_type;
|
||||||
if (app_type) {
|
if (app_type) {
|
||||||
app_type_idx =
|
app_type_idx =
|
||||||
msm_pcm_routing_get_app_type_idx(app_type);
|
msm_pcm_routing_get_app_type_idx(app_type);
|
||||||
sample_rate =
|
sample_rate =
|
||||||
fe_dai_app_type_cfg[i].sample_rate;
|
fe_dai_app_type_cfg[i][session_type].
|
||||||
|
sample_rate;
|
||||||
bits_per_sample =
|
bits_per_sample =
|
||||||
app_type_cfg[app_type_idx].bit_width;
|
app_type_cfg[app_type_idx].bit_width;
|
||||||
} else
|
} else
|
||||||
|
@ -11128,8 +11156,10 @@ static int msm_pcm_routing_prepare(struct snd_pcm_substream *substream)
|
||||||
channels = bedai->channel;
|
channels = bedai->channel;
|
||||||
else
|
else
|
||||||
channels = bedai->adm_override_ch;
|
channels = bedai->adm_override_ch;
|
||||||
acdb_dev_id = fe_dai_app_type_cfg[i].acdb_dev_id;
|
acdb_dev_id =
|
||||||
topology = msm_routing_get_adm_topology(path_type, i);
|
fe_dai_app_type_cfg[i][session_type].acdb_dev_id;
|
||||||
|
topology = msm_routing_get_adm_topology(path_type, i,
|
||||||
|
session_type);
|
||||||
copp_idx = adm_open(bedai->port_id, path_type,
|
copp_idx = adm_open(bedai->port_id, path_type,
|
||||||
sample_rate, channels, topology,
|
sample_rate, channels, topology,
|
||||||
fdai->perf_mode, bits_per_sample,
|
fdai->perf_mode, bits_per_sample,
|
||||||
|
|
|
@ -461,7 +461,7 @@ void msm_pcm_routing_acquire_lock(void);
|
||||||
void msm_pcm_routing_release_lock(void);
|
void msm_pcm_routing_release_lock(void);
|
||||||
|
|
||||||
void msm_pcm_routing_reg_stream_app_type_cfg(int fedai_id, int app_type,
|
void msm_pcm_routing_reg_stream_app_type_cfg(int fedai_id, int app_type,
|
||||||
int acdb_dev_id, int sample_rate);
|
int acdb_dev_id, int sample_rate, int session_type);
|
||||||
int msm_pcm_routing_get_stream_app_type_cfg(int fedai_id, int *app_type,
|
int msm_pcm_routing_get_stream_app_type_cfg(int fedai_id, int session_type,
|
||||||
int *acdb_dev_id, int *sample_rate);
|
int *app_type, int *acdb_dev_id, int *sample_rate);
|
||||||
#endif /*_MSM_PCM_H*/
|
#endif /*_MSM_PCM_H*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue