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 ;
@@ -964,7 +941,7 @@ static int sof_ipc4_pcm_setup(struct snd_sof_dev *sdev, struct snd_sof_pcm *spcm
964941 return 0 ;
965942}
966943
967- static void sof_ipc4_build_time_info (struct snd_sof_dev * sdev , struct snd_sof_pcm_stream * sps )
944+ void sof_ipc4_build_time_info (struct snd_sof_dev * sdev , struct snd_sof_pcm_stream * sps )
968945{
969946 struct sof_ipc4_copier * host_copier = NULL ;
970947 struct sof_ipc4_copier * dai_copier = NULL ;
@@ -1062,7 +1039,7 @@ static int sof_ipc4_pcm_hw_params(struct snd_soc_component *component,
10621039 return 0 ;
10631040}
10641041
1065- static u64 sof_ipc4_frames_dai_to_host (struct sof_ipc4_timestamp_info * time_info , u64 value )
1042+ u64 sof_ipc4_frames_dai_to_host (struct sof_ipc4_timestamp_info * time_info , u64 value )
10661043{
10671044 u64 dai_rate , host_rate ;
10681045
@@ -1091,10 +1068,10 @@ static u64 sof_ipc4_frames_dai_to_host(struct sof_ipc4_timestamp_info *time_info
10911068 return value ;
10921069}
10931070
1094- static int sof_ipc4_get_stream_start_offset (struct snd_sof_dev * sdev ,
1095- struct snd_pcm_substream * substream ,
1096- struct snd_sof_pcm_stream * sps ,
1097- struct sof_ipc4_timestamp_info * time_info )
1071+ int sof_ipc4_get_stream_start_offset (struct snd_sof_dev * sdev ,
1072+ struct snd_pcm_substream * substream ,
1073+ struct snd_sof_pcm_stream * sps ,
1074+ struct sof_ipc4_timestamp_info * time_info )
10981075{
10991076 struct sof_ipc4_copier * host_copier = time_info -> host_copier ;
11001077 struct sof_ipc4_copier * dai_copier = time_info -> dai_copier ;
@@ -1108,7 +1085,8 @@ static int sof_ipc4_get_stream_start_offset(struct snd_sof_dev *sdev,
11081085
11091086 if (host_copier -> data .gtw_cfg .node_id == SOF_IPC4_INVALID_NODE_ID ) {
11101087 return - EINVAL ;
1111- } else if (host_copier -> data .gtw_cfg .node_id == SOF_IPC4_CHAIN_DMA_NODE_ID ) {
1088+ } else if (substream &&
1089+ host_copier -> data .gtw_cfg .node_id == SOF_IPC4_CHAIN_DMA_NODE_ID ) {
11121090 /*
11131091 * While the firmware does not support time_info reporting for
11141092 * streams using ChainDMA, it is granted that ChainDMA can only
0 commit comments