From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Kareem Shaik Date: Tue, 31 Oct 2017 15:44:52 +0530 Subject: [PATCH] ASoC: Intel: Skylake: Return default sampling rate for Probe compress devices. Defining sampling rate for getting Probe data from probe compress devices. As user space expects a valid sample rate but existing API compress_get_hpointer returns an error if sampling rate is 0. Change-Id: I0482c96fea4583a93b952d7484a4234388d6a6f0 Signed-off-by: Kareem Shaik Reviewed-on: Reviewed-by: B, Jayachandran Reviewed-by: Kesapragada, Pardha Saradhi Reviewed-by: Tewani, Pradeep D Reviewed-by: Koul, Vinod Tested-by: Sm, Bhadur A --- sound/soc/intel/skylake/skl-pcm.c | 6 ++++++ sound/soc/intel/skylake/skl-probe.c | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c index 9172492d0b1f..4d68c6a7e114 100644 --- a/sound/soc/intel/skylake/skl-pcm.c +++ b/sound/soc/intel/skylake/skl-pcm.c @@ -1421,6 +1421,9 @@ static struct snd_soc_dai_driver skl_platform_dai[] = { .playback = { .stream_name = "Probe Playback", .channels_min = HDA_MONO, + .rates = SNDRV_PCM_RATE_48000, + .rate_min = 48000, + .rate_max = 48000, }, }, { @@ -1430,6 +1433,9 @@ static struct snd_soc_dai_driver skl_platform_dai[] = { .capture = { .stream_name = "Probe Capture", .channels_min = HDA_MONO, + .rates = SNDRV_PCM_RATE_48000, + .rate_min = 48000, + .rate_max = 48000, }, }, }; diff --git a/sound/soc/intel/skylake/skl-probe.c b/sound/soc/intel/skylake/skl-probe.c index 0716bf62f92e..4a22c75c552b 100644 --- a/sound/soc/intel/skylake/skl-probe.c +++ b/sound/soc/intel/skylake/skl-probe.c @@ -323,6 +323,11 @@ int skl_probe_compr_tstamp(struct snd_compr_stream *stream, tstamp->copied_total = hstream->hstream.curr_pos; + if (stream->direction == SND_COMPRESS_PLAYBACK) + tstamp->sampling_rate = snd_pcm_rate_bit_to_rate(dai->driver->playback.rates); + else + tstamp->sampling_rate = snd_pcm_rate_bit_to_rate(dai->driver->capture.rates); + return 0; } -- https://clearlinux.org