ASoC: msm: qdspv2: Add mixer controls for drift query
Add mixer control to query drift avtimer vs device(speaker, headset, BT) drift. CRs-Fixed: 2036899 Change-Id: I1cd8d2faf278faabaa9861953027ceb38eda4d25 Signed-off-by: Manish Dewangan <manish@codeaurora.org>
This commit is contained in:
parent
0c775d66f1
commit
c6911c81c2
2 changed files with 76 additions and 2 deletions
|
@ -174,7 +174,7 @@ static const struct snd_kcontrol_new hdmi_config_controls[] = {
|
||||||
{
|
{
|
||||||
.access = SNDRV_CTL_ELEM_ACCESS_READ,
|
.access = SNDRV_CTL_ELEM_ACCESS_READ,
|
||||||
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
|
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
|
||||||
.name = "HDMI RX Drift",
|
.name = "HDMI Drift",
|
||||||
.info = msm_dai_q6_ext_disp_drift_info,
|
.info = msm_dai_q6_ext_disp_drift_info,
|
||||||
.get = msm_dai_q6_ext_disp_drift_get,
|
.get = msm_dai_q6_ext_disp_drift_get,
|
||||||
},
|
},
|
||||||
|
@ -191,7 +191,7 @@ static const struct snd_kcontrol_new display_port_config_controls[] = {
|
||||||
{
|
{
|
||||||
.access = SNDRV_CTL_ELEM_ACCESS_READ,
|
.access = SNDRV_CTL_ELEM_ACCESS_READ,
|
||||||
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
|
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
|
||||||
.name = "DISPLAY Port RX Drift",
|
.name = "DISPLAY_PORT Drift",
|
||||||
.info = msm_dai_q6_ext_disp_drift_info,
|
.info = msm_dai_q6_ext_disp_drift_info,
|
||||||
.get = msm_dai_q6_ext_disp_drift_get,
|
.get = msm_dai_q6_ext_disp_drift_get,
|
||||||
},
|
},
|
||||||
|
|
|
@ -2321,6 +2321,44 @@ static const struct snd_kcontrol_new afe_enc_config_controls[] = {
|
||||||
msm_dai_q6_afe_input_bit_format_put),
|
msm_dai_q6_afe_input_bit_format_put),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static int msm_dai_q6_slim_rx_drift_info(struct snd_kcontrol *kcontrol,
|
||||||
|
struct snd_ctl_elem_info *uinfo)
|
||||||
|
{
|
||||||
|
uinfo->type = SNDRV_CTL_ELEM_TYPE_BYTES;
|
||||||
|
uinfo->count = sizeof(struct afe_param_id_dev_timing_stats);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int msm_dai_q6_slim_rx_drift_get(struct snd_kcontrol *kcontrol,
|
||||||
|
struct snd_ctl_elem_value *ucontrol)
|
||||||
|
{
|
||||||
|
int ret = -EINVAL;
|
||||||
|
struct afe_param_id_dev_timing_stats timing_stats;
|
||||||
|
struct snd_soc_dai *dai = kcontrol->private_data;
|
||||||
|
struct msm_dai_q6_dai_data *dai_data = dev_get_drvdata(dai->dev);
|
||||||
|
|
||||||
|
if (!test_bit(STATUS_PORT_STARTED, dai_data->status_mask)) {
|
||||||
|
pr_err("%s: afe port not started. dai_data->status_mask = %ld\n",
|
||||||
|
__func__, *dai_data->status_mask);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
memset(&timing_stats, 0, sizeof(struct afe_param_id_dev_timing_stats));
|
||||||
|
ret = afe_get_av_dev_drift(&timing_stats, dai->id);
|
||||||
|
if (ret) {
|
||||||
|
pr_err("%s: Error getting AFE Drift for port %d, err=%d\n",
|
||||||
|
__func__, dai->id, ret);
|
||||||
|
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
memcpy(ucontrol->value.bytes.data, (void *)&timing_stats,
|
||||||
|
sizeof(struct afe_param_id_dev_timing_stats));
|
||||||
|
done:
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
static const char * const afe_cal_mode_text[] = {
|
static const char * const afe_cal_mode_text[] = {
|
||||||
"CAL_MODE_DEFAULT", "CAL_MODE_NONE"
|
"CAL_MODE_DEFAULT", "CAL_MODE_NONE"
|
||||||
};
|
};
|
||||||
|
@ -2373,6 +2411,29 @@ static const struct snd_kcontrol_new usb_audio_cfg_controls[] = {
|
||||||
msm_dai_q6_usb_audio_endian_cfg_put),
|
msm_dai_q6_usb_audio_endian_cfg_put),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const struct snd_kcontrol_new avd_drift_config_controls[] = {
|
||||||
|
{
|
||||||
|
.access = SNDRV_CTL_ELEM_ACCESS_READ,
|
||||||
|
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
|
||||||
|
.name = "SLIMBUS_0_RX DRIFT",
|
||||||
|
.info = msm_dai_q6_slim_rx_drift_info,
|
||||||
|
.get = msm_dai_q6_slim_rx_drift_get,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.access = SNDRV_CTL_ELEM_ACCESS_READ,
|
||||||
|
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
|
||||||
|
.name = "SLIMBUS_6_RX DRIFT",
|
||||||
|
.info = msm_dai_q6_slim_rx_drift_info,
|
||||||
|
.get = msm_dai_q6_slim_rx_drift_get,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.access = SNDRV_CTL_ELEM_ACCESS_READ,
|
||||||
|
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
|
||||||
|
.name = "SLIMBUS_7_RX DRIFT",
|
||||||
|
.info = msm_dai_q6_slim_rx_drift_info,
|
||||||
|
.get = msm_dai_q6_slim_rx_drift_get,
|
||||||
|
},
|
||||||
|
};
|
||||||
static int msm_dai_q6_dai_probe(struct snd_soc_dai *dai)
|
static int msm_dai_q6_dai_probe(struct snd_soc_dai *dai)
|
||||||
{
|
{
|
||||||
struct msm_dai_q6_dai_data *dai_data;
|
struct msm_dai_q6_dai_data *dai_data;
|
||||||
|
@ -2422,6 +2483,9 @@ static int msm_dai_q6_dai_probe(struct snd_soc_dai *dai)
|
||||||
rc = snd_ctl_add(dai->component->card->snd_card,
|
rc = snd_ctl_add(dai->component->card->snd_card,
|
||||||
snd_ctl_new1(&afe_enc_config_controls[2],
|
snd_ctl_new1(&afe_enc_config_controls[2],
|
||||||
dai_data));
|
dai_data));
|
||||||
|
rc = snd_ctl_add(dai->component->card->snd_card,
|
||||||
|
snd_ctl_new1(&avd_drift_config_controls[2],
|
||||||
|
dai));
|
||||||
break;
|
break;
|
||||||
case RT_PROXY_DAI_001_RX:
|
case RT_PROXY_DAI_001_RX:
|
||||||
rc = snd_ctl_add(dai->component->card->snd_card,
|
rc = snd_ctl_add(dai->component->card->snd_card,
|
||||||
|
@ -2449,6 +2513,16 @@ static int msm_dai_q6_dai_probe(struct snd_soc_dai *dai)
|
||||||
snd_ctl_new1(&usb_audio_cfg_controls[3],
|
snd_ctl_new1(&usb_audio_cfg_controls[3],
|
||||||
dai_data));
|
dai_data));
|
||||||
break;
|
break;
|
||||||
|
case SLIMBUS_0_RX:
|
||||||
|
rc = snd_ctl_add(dai->component->card->snd_card,
|
||||||
|
snd_ctl_new1(&avd_drift_config_controls[0],
|
||||||
|
dai));
|
||||||
|
break;
|
||||||
|
case SLIMBUS_6_RX:
|
||||||
|
rc = snd_ctl_add(dai->component->card->snd_card,
|
||||||
|
snd_ctl_new1(&avd_drift_config_controls[1],
|
||||||
|
dai));
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (IS_ERR_VALUE(rc))
|
if (IS_ERR_VALUE(rc))
|
||||||
dev_err(dai->dev, "%s: err add config ctl, DAI = %s\n",
|
dev_err(dai->dev, "%s: err add config ctl, DAI = %s\n",
|
||||||
|
|
Loading…
Add table
Reference in a new issue