Skip to content

Commit e82b06a

Browse files
committed
zephyr: lib/dma.h: Fix build error in dma-legacy.h
Reinstate 'struct dma' data type for platforms compiled with CONFIG_ZEPHYR_NATIVE_DRIVERS undefined. Signed-off-by: Andrew Perepech <andrew.perepech@mediatek.com>
1 parent ed44faf commit e82b06a

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

  • zephyr/include/sof/lib

zephyr/include/sof/lib/dma.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,11 @@ enum sof_dma_cb_status {
122122
/* Attributes have been ported to Zephyr. This condition is necessary until full support of
123123
* CONFIG_SOF_ZEPHYR_STRICT_HEADERS.
124124
*/
125+
#ifdef CONFIG_ZEPHYR_NATIVE_DRIVERS
125126
struct sof_dma;
127+
#else
128+
struct dma;
129+
#endif
126130

127131
/**
128132
* \brief Element of SG list (as array item).
@@ -194,7 +198,11 @@ struct dma_plat_data {
194198
uint32_t period_count;
195199
};
196200

201+
#ifdef CONFIG_ZEPHYR_NATIVE_DRIVERS
197202
struct sof_dma {
203+
#else
204+
struct dma {
205+
#endif
198206
struct dma_plat_data plat_data;
199207
struct k_spinlock lock; /**< locking mechanism */
200208
int sref; /**< simple ref counter, guarded by lock */
@@ -206,7 +214,11 @@ struct sof_dma {
206214
};
207215

208216
struct dma_chan_data {
217+
#ifdef CONFIG_ZEPHYR_NATIVE_DRIVERS
209218
struct sof_dma *dma;
219+
#else
220+
struct dma *dma;
221+
#endif
210222

211223
uint32_t status;
212224
uint32_t direction;
@@ -224,14 +236,22 @@ struct dma_chan_data {
224236
};
225237

226238
struct dma_info {
239+
#ifdef CONFIG_ZEPHYR_NATIVE_DRIVERS
227240
struct sof_dma *dma_array;
241+
#else
242+
struct dma *dma_array;
243+
#endif
228244
size_t num_dmas;
229245
};
230246

231247
/* generic DMA DSP <-> Host copier */
232248
struct dma_copy {
233249
struct dma_chan_data *chan;
250+
#ifdef CONFIG_ZEPHYR_NATIVE_DRIVERS
234251
struct sof_dma *dmac;
252+
#else
253+
struct dma *dmac;
254+
#endif
235255
};
236256

237257
struct audio_stream;

0 commit comments

Comments
 (0)