Skip to content

Commit 32ca17f

Browse files
committed
ipc: ipc4: make native Zephyr drivers mandatory for IPC4
Remove old code to support IPC4 use with non-Zephyr DAI and DMA drivers. This code was used to transition to Zephyr, but now all active users of IPC4 have moved to native Zephyr drivers, so there are no users for this code left. Add a Kconfig dependency to native driver support. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
1 parent 2c10bc0 commit 32ca17f

2 files changed

Lines changed: 1 addition & 61 deletions

File tree

src/ipc/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ config IPC_MAJOR_3
1414

1515
config IPC_MAJOR_4
1616
bool "IPC Major Version 4"
17+
depends on ZEPHYR_NATIVE_DRIVERS
1718
help
1819
This is an IPC version used by certain middleware on some IOT
1920
Intel devices. Not for general use.

src/ipc/ipc4/dai.c

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,7 @@ int ipc_dai_data_config(struct dai_data *dd, struct comp_dev *dev)
143143
{
144144
struct ipc_config_dai *dai = &dd->ipc_config;
145145
struct ipc4_copier_module_cfg *copier_cfg = dd->dai_spec_config;
146-
#ifdef CONFIG_ZEPHYR_NATIVE_DRIVERS
147146
struct dai *dai_p = dd->dai;
148-
#endif
149147

150148
if (!dai) {
151149
comp_err(dev, "no dai!\n");
@@ -174,12 +172,7 @@ int ipc_dai_data_config(struct dai_data *dd, struct comp_dev *dev)
174172
case SOF_DAI_INTEL_HDA:
175173
break;
176174
case SOF_DAI_INTEL_ALH:
177-
#ifdef CONFIG_ZEPHYR_NATIVE_DRIVERS
178175
dd->stream_id = dai_get_stream_id(dai_p, dai->direction);
179-
#else
180-
/* only native Zephyr driver supported */
181-
return -EINVAL;
182-
#endif
183176
/* SDW HW FIFO always requires 32bit MSB aligned sample data for
184177
* all formats, such as 8/16/24/32 bits.
185178
*/
@@ -243,15 +236,10 @@ void dai_dma_release(struct dai_data *dd, struct comp_dev *dev)
243236
* pause to stop.
244237
* TODO: refine power management when stream is paused
245238
*/
246-
#if CONFIG_ZEPHYR_NATIVE_DRIVERS
247239
/* if reset is after pause dma has already been stopped */
248240
dma_stop(dd->chan->dma->z_dev, dd->chan->index);
249241

250242
dma_release_channel(dd->chan->dma->z_dev, dd->chan->index);
251-
#else
252-
dma_stop_legacy(dd->chan);
253-
dma_channel_put_legacy(dd->chan);
254-
#endif
255243
dd->chan->dev_data = NULL;
256244
dd->chan = NULL;
257245
}
@@ -425,7 +413,6 @@ __cold int dai_config(struct dai_data *dd, struct comp_dev *dev,
425413
copier_cfg->gtw_cfg.config_data, size);
426414
}
427415

428-
#if CONFIG_ZEPHYR_NATIVE_DRIVERS
429416
int dai_common_position(struct dai_data *dd, struct comp_dev *dev,
430417
struct sof_ipc_stream_posn *posn)
431418
{
@@ -477,51 +464,3 @@ void dai_dma_position_update(struct dai_data *dd, struct comp_dev *dev)
477464

478465
mailbox_sw_regs_write(dd->slot_info.reg_offset, &slot, sizeof(slot));
479466
}
480-
#else
481-
int dai_common_position(struct dai_data *dd, struct comp_dev *dev,
482-
struct sof_ipc_stream_posn *posn)
483-
{
484-
struct dma_chan_status status;
485-
486-
/* total processed bytes count */
487-
posn->dai_posn = dd->total_data_processed;
488-
489-
platform_dai_wallclock(dev, &dd->wallclock);
490-
posn->wallclock = dd->wallclock;
491-
492-
status.ipc_posn_data = &posn->comp_posn;
493-
dma_status_legacy(dd->chan, &status, dev->direction);
494-
495-
return 0;
496-
}
497-
498-
int dai_position(struct comp_dev *dev, struct sof_ipc_stream_posn *posn)
499-
{
500-
struct dai_data *dd = comp_get_drvdata(dev);
501-
502-
return dai_common_position(dd, dev, posn);
503-
}
504-
505-
void dai_dma_position_update(struct dai_data *dd, struct comp_dev *dev)
506-
{
507-
struct ipc4_llp_reading_slot slot;
508-
struct dma_chan_status status;
509-
uint32_t llp_data[2];
510-
511-
if (!dd->slot_info.node_id)
512-
return;
513-
514-
status.ipc_posn_data = llp_data;
515-
dma_status_legacy(dd->chan, &status, dev->direction);
516-
517-
platform_dai_wallclock(dev, &dd->wallclock);
518-
519-
slot.node_id = dd->slot_info.node_id;
520-
slot.reading.llp_l = llp_data[0];
521-
slot.reading.llp_u = llp_data[1];
522-
slot.reading.wclk_l = (uint32_t)dd->wallclock;
523-
slot.reading.wclk_u = (uint32_t)(dd->wallclock >> 32);
524-
525-
mailbox_sw_regs_write(dd->slot_info.reg_offset, &slot, sizeof(slot));
526-
}
527-
#endif

0 commit comments

Comments
 (0)