[alsa-devel] [PATCH v2 01/29] ASoC: Intel: skl-pcm: disable skl_get_time_info

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Fri Jul 26 06:49:17 CEST 2019


From: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>

Each ALSA SoC sound driver need to setup its own
snd_soc_component_driver, and it is including struct snd_pcm_ops *ops.
This ops itself is needed for ALSA system, but is not directly used
in ALSA SoC.

When ALSA SoC sound driver was registered, soc_new_pcm() will be
called. In that timing, it setups rtd->ops (= snd_pcm_ops),
and it is really used as ALSA system.

	if (rtd->dai_link->dynamic) {
		rtd->ops.open		= dpcm_fe_dai_open;
		...
	} else {
		rtd->ops.open		= soc_pcm_open;
		...
	}
	...

	if (playback)
=>		snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &rtd->ops);

	if (capture)
=>		snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &rtd->ops);

For example .open case, rtd->ops.open will be set as soc_pcm_open
(in case of non-DPCM).
soc_pcm_open() calls each DAI's ops's .startup,
dai_link's .startup, and component's .open

Now, ALSA SoC doesn't setup rtd->ops.get_time_info.
This means it never used in ALSA SoC even if
sound driver had .get_time_info.

This patch disable .get_time_info from skl-pcm.c.
Because we might be going to support it in the future,
it uses #if 0.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
---
v1 -> v2

	- new file

 sound/soc/intel/skylake/skl-pcm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c
index 760bbcf..929b1f6 100644
--- a/sound/soc/intel/skylake/skl-pcm.c
+++ b/sound/soc/intel/skylake/skl-pcm.c
@@ -1226,6 +1226,7 @@ static snd_pcm_uframes_t skl_platform_pcm_pointer
 	return bytes_to_frames(substream->runtime, pos);
 }
 
+#if 0
 static u64 skl_adjust_codec_delay(struct snd_pcm_substream *substream,
 				u64 nsec)
 {
@@ -1277,13 +1278,13 @@ static int skl_get_time_info(struct snd_pcm_substream *substream,
 
 	return 0;
 }
+#endif
 
 static const struct snd_pcm_ops skl_platform_ops = {
 	.open = skl_platform_open,
 	.ioctl = snd_pcm_lib_ioctl,
 	.trigger = skl_platform_pcm_trigger,
 	.pointer = skl_platform_pcm_pointer,
-	.get_time_info =  skl_get_time_info,
 	.mmap = snd_pcm_lib_default_mmap,
 	.page = snd_pcm_sgbuf_ops_page,
 };
-- 
2.7.4



More information about the Alsa-devel mailing list