1515#include "ipc4-topology.h"
1616#include "ipc4-fw-reg.h"
1717
18- /**
19- * struct sof_ipc4_timestamp_info - IPC4 timestamp info
20- * @host_copier: the host copier of the pcm stream
21- * @dai_copier: the dai copier of the pcm stream
22- * @stream_start_offset: reported by fw in memory window (converted to
23- * frames at host_copier sampling rate)
24- * @stream_end_offset: reported by fw in memory window (converted to
25- * frames at host_copier sampling rate)
26- * @llp_offset: llp offset in memory window
27- * @delay: Calculated and stored in pointer callback. The stored value is
28- * returned in the delay callback. Expressed in frames at host copier
29- * sampling rate.
30- */
31- struct sof_ipc4_timestamp_info {
32- struct sof_ipc4_copier * host_copier ;
33- struct sof_ipc4_copier * dai_copier ;
34- u64 stream_start_offset ;
35- u64 stream_end_offset ;
36- u32 llp_offset ;
37-
38- snd_pcm_sframes_t delay ;
39- };
40-
4118/**
4219 * struct sof_ipc4_pcm_stream_priv - IPC4 specific private data
4320 * @time_info: pointer to time info struct if it is supported, otherwise NULL
@@ -61,7 +38,7 @@ struct sof_ipc4_pcm_stream_priv {
6138
6239#define DELAY_MAX (DELAY_BOUNDARY >> 1)
6340
64- static inline struct sof_ipc4_timestamp_info *
41+ struct sof_ipc4_timestamp_info *
6542sof_ipc4_sps_to_time_info (struct snd_sof_pcm_stream * sps )
6643{
6744 struct sof_ipc4_pcm_stream_priv * stream_priv = sps -> private ;
@@ -990,7 +967,7 @@ static int sof_ipc4_pcm_setup(struct snd_sof_dev *sdev, struct snd_sof_pcm *spcm
990967 return 0 ;
991968}
992969
993- static void sof_ipc4_build_time_info (struct snd_sof_dev * sdev , struct snd_sof_pcm_stream * sps )
970+ void sof_ipc4_build_time_info (struct snd_sof_dev * sdev , struct snd_sof_pcm_stream * sps )
994971{
995972 struct sof_ipc4_copier * host_copier = NULL ;
996973 struct sof_ipc4_copier * dai_copier = NULL ;
@@ -1088,7 +1065,7 @@ static int sof_ipc4_pcm_hw_params(struct snd_soc_component *component,
10881065 return 0 ;
10891066}
10901067
1091- static u64 sof_ipc4_frames_dai_to_host (struct sof_ipc4_timestamp_info * time_info , u64 value )
1068+ u64 sof_ipc4_frames_dai_to_host (struct sof_ipc4_timestamp_info * time_info , u64 value )
10921069{
10931070 u64 dai_rate , host_rate ;
10941071
@@ -1117,10 +1094,10 @@ static u64 sof_ipc4_frames_dai_to_host(struct sof_ipc4_timestamp_info *time_info
11171094 return value ;
11181095}
11191096
1120- static int sof_ipc4_get_stream_start_offset (struct snd_sof_dev * sdev ,
1121- struct snd_pcm_substream * substream ,
1122- struct snd_sof_pcm_stream * sps ,
1123- struct sof_ipc4_timestamp_info * time_info )
1097+ int sof_ipc4_get_stream_start_offset (struct snd_sof_dev * sdev ,
1098+ struct snd_pcm_substream * substream ,
1099+ struct snd_sof_pcm_stream * sps ,
1100+ struct sof_ipc4_timestamp_info * time_info )
11241101{
11251102 struct sof_ipc4_copier * host_copier = time_info -> host_copier ;
11261103 struct sof_ipc4_copier * dai_copier = time_info -> dai_copier ;
@@ -1134,7 +1111,8 @@ static int sof_ipc4_get_stream_start_offset(struct snd_sof_dev *sdev,
11341111
11351112 if (host_copier -> data .gtw_cfg .node_id == SOF_IPC4_INVALID_NODE_ID ) {
11361113 return - EINVAL ;
1137- } else if (host_copier -> data .gtw_cfg .node_id == SOF_IPC4_CHAIN_DMA_NODE_ID ) {
1114+ } else if (substream &&
1115+ host_copier -> data .gtw_cfg .node_id == SOF_IPC4_CHAIN_DMA_NODE_ID ) {
11381116 /*
11391117 * While the firmware does not support time_info reporting for
11401118 * streams using ChainDMA, it is granted that ChainDMA can only
0 commit comments