From 0e2cda8fabffef51f066d3ff774275cecae6e2c5 Mon Sep 17 00:00:00 2001 From: Faiz Nabi Kuchay Date: Tue, 28 May 2019 10:59:24 +0530 Subject: [PATCH] asoc: Enable digital_mute to support excursion logging Enable digital_mute for SLIMBUS_0_RX to support excursion logging feature. Change-Id: Icc64f5fdf245c4239683872ff65a1f2fa6dc88e2 Signed-off-by: Faiz Nabi Kuchay --- asoc/msm-dai-q6-v2.c | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/asoc/msm-dai-q6-v2.c b/asoc/msm-dai-q6-v2.c index 35ebff4c3152..2b77c8437e4e 100644 --- a/asoc/msm-dai-q6-v2.c +++ b/asoc/msm-dai-q6-v2.c @@ -2717,6 +2717,18 @@ static int msm_dai_q6_set_channel_map(struct snd_soc_dai *dai, return rc; } +/* all ports with excursion logging requirement can use this digital_mute api */ +static int msm_dai_q6_spk_digital_mute(struct snd_soc_dai *dai, + int mute) +{ + int port_id = dai->id; + + if (mute) + afe_get_sp_xt_logging_data(port_id); + + return 0; +} + static struct snd_soc_dai_ops msm_dai_q6_ops = { .prepare = msm_dai_q6_prepare, .hw_params = msm_dai_q6_hw_params, @@ -2725,6 +2737,15 @@ static struct snd_soc_dai_ops msm_dai_q6_ops = { .set_channel_map = msm_dai_q6_set_channel_map, }; +static struct snd_soc_dai_ops msm_dai_slimbus_0_rx_ops = { + .prepare = msm_dai_q6_prepare, + .hw_params = msm_dai_q6_hw_params, + .shutdown = msm_dai_q6_shutdown, + .set_fmt = msm_dai_q6_set_fmt, + .set_channel_map = msm_dai_q6_set_channel_map, + .digital_mute = msm_dai_q6_spk_digital_mute, +}; + static int msm_dai_q6_cal_info_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { @@ -4445,7 +4466,7 @@ static struct snd_soc_dai_driver msm_dai_q6_slimbus_rx_dai[] = { .rate_min = 8000, .rate_max = 384000, }, - .ops = &msm_dai_q6_ops, + .ops = &msm_dai_slimbus_0_rx_ops, .id = SLIMBUS_0_RX, .probe = msm_dai_q6_dai_probe, .remove = msm_dai_q6_dai_remove, @@ -11263,18 +11284,6 @@ static void msm_dai_q6_cdc_dma_shutdown(struct snd_pcm_substream *substream, clear_bit(STATUS_PORT_STARTED, dai_data->hwfree_status); } -/* all ports with same WSA requirement can use this digital mute API */ -static int msm_dai_q6_spk_digital_mute(struct snd_soc_dai *dai, - int mute) -{ - int port_id = dai->id; - - if (mute) - afe_get_sp_xt_logging_data(port_id); - - return 0; -} - static struct snd_soc_dai_ops msm_dai_q6_cdc_dma_ops = { .prepare = msm_dai_q6_cdc_dma_prepare, .hw_params = msm_dai_q6_cdc_dma_hw_params,