clear-pkgs-linux-iot-lts2018/0397-ASoC-Intel-Skylake-Ret...

67 lines
2.3 KiB
Diff

From 31748c674fe3d7f0d694da5ffae155a8ea59c4c7 Mon Sep 17 00:00:00 2001
From: Kareem Shaik <kareem.m.shaik@intel.com>
Date: Tue, 31 Oct 2017 15:44:52 +0530
Subject: [PATCH 397/743] 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 <kareem.m.shaik@intel.com>
Reviewed-on:
Reviewed-by: B, Jayachandran <jayachandran.b@intel.com>
Reviewed-by: Kesapragada, Pardha Saradhi <pardha.saradhi.kesapragada@intel.com>
Reviewed-by: Tewani, Pradeep D <pradeep.d.tewani@intel.com>
Reviewed-by: Koul, Vinod <vinod.koul@intel.com>
Tested-by: Sm, Bhadur A <bhadur.a.sm@intel.com>
---
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 4679bf9f4543..8702f0c3e17e 100644
--- a/sound/soc/intel/skylake/skl-pcm.c
+++ b/sound/soc/intel/skylake/skl-pcm.c
@@ -1412,6 +1412,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,
},
},
{
@@ -1421,6 +1424,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;
}
--
2.19.2