diff mbox series

[v2,01/29] ASoC: Intel: skl-pcm: disable skl_get_time_info

Message ID 87o91h5rp5.wl-kuninori.morimoto.gx@renesas.com (mailing list archive)
State New, archived
Headers show
Series ASoC: add soc-component.c | expand

Commit Message

Kuninori Morimoto July 26, 2019, 4:49 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@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@renesas.com>
---
v1 -> v2

	- new file

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

Comments

Mark Brown Aug. 5, 2019, 3:45 p.m. UTC | #1
On Fri, Jul 26, 2019 at 01:49:17PM +0900, Kuninori Morimoto wrote:

> 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.

The #if 0 here isn't exactly nice...  it'd be better to just implement
get_time_info().
Pierre-Louis Bossart Aug. 5, 2019, 4:06 p.m. UTC | #2
On 8/5/19 10:45 AM, Mark Brown wrote:
> On Fri, Jul 26, 2019 at 01:49:17PM +0900, Kuninori Morimoto wrote:
> 
>> 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.
> 
> The #if 0 here isn't exactly nice...  it'd be better to just implement
> get_time_info().

IIRC Cezary's team had a patch reviewed internally at Intel to add the 
missing pieces, so this will be supported soonish (likely after the 
Summer break).
Kuninori Morimoto Aug. 6, 2019, midnight UTC | #3
Hi Mark, Pierre-Louis

> >> 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.
> > 
> > The #if 0 here isn't exactly nice...  it'd be better to just implement
> > get_time_info().
> 
> IIRC Cezary's team had a patch reviewed internally at Intel to add the
> missing pieces, so this will be supported soonish (likely after the
> Summer break).

Thanks !! Nice to know.
Now we can just ignore this patch


Thank you for your help !!
Best regards
---
Kuninori Morimoto
diff mbox series

Patch

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,
 };