Skip to content

Commit 9e6b984

Browse files
committed
ASoC: SOF: imx: Enable SOF client version of dma-trace
i.MX is using dma-trace currently, make sure that the move to SOF client is not going to cause regression regarding to trace functionality. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1 parent 39459f7 commit 9e6b984

5 files changed

Lines changed: 30 additions & 0 deletions

File tree

sound/soc/sof/imx/imx-common.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <linux/module.h>
88
#include <sound/sof/xtensa.h>
99
#include "../ops.h"
10+
#include "../sof-client-dma-trace.h"
1011

1112
#include "imx-common.h"
1213

@@ -74,4 +75,17 @@ void imx8_dump(struct snd_sof_dev *sdev, u32 flags)
7475
}
7576
EXPORT_SYMBOL(imx8_dump);
7677

78+
int imx8_dma_trace_register(struct snd_sof_dev *sdev)
79+
{
80+
return sof_client_dev_register(sdev, "imx8-dma-trace", 0, NULL, 0);
81+
}
82+
EXPORT_SYMBOL(imx8_dma_trace_register);
83+
84+
void imx8_dma_trace_unregister(struct snd_sof_dev *sdev)
85+
{
86+
sof_client_dev_unregister(sdev, "imx8-dma-trace", 0);
87+
}
88+
EXPORT_SYMBOL(imx8_dma_trace_unregister);
89+
90+
MODULE_IMPORT_NS(SND_SOC_SOF_CLIENT);
7791
MODULE_LICENSE("Dual BSD/GPL");

sound/soc/sof/imx/imx-common.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,7 @@ void imx8_get_registers(struct snd_sof_dev *sdev,
1313

1414
void imx8_dump(struct snd_sof_dev *sdev, u32 flags);
1515

16+
int imx8_dma_trace_register(struct snd_sof_dev *sdev);
17+
void imx8_dma_trace_unregister(struct snd_sof_dev *sdev);
18+
1619
#endif

sound/soc/sof/imx/imx8.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,10 @@ struct snd_sof_dsp_ops sof_imx8_ops = {
433433
/* firmware loading */
434434
.load_firmware = snd_sof_load_firmware_memcpy,
435435

436+
/* client ops */
437+
.register_ipc_clients = imx8_dma_trace_register,
438+
.unregister_ipc_clients = imx8_dma_trace_unregister,
439+
436440
/* Debug information */
437441
.dbg_dump = imx8_dump,
438442
.debugfs_add_region_item = snd_sof_debugfs_add_region_item_iomem,
@@ -488,6 +492,10 @@ struct snd_sof_dsp_ops sof_imx8x_ops = {
488492
/* firmware loading */
489493
.load_firmware = snd_sof_load_firmware_memcpy,
490494

495+
/* client ops */
496+
.register_ipc_clients = imx8_dma_trace_register,
497+
.unregister_ipc_clients = imx8_dma_trace_unregister,
498+
491499
/* Debug information */
492500
.dbg_dump = imx8_dump,
493501
.debugfs_add_region_item = snd_sof_debugfs_add_region_item_iomem,

sound/soc/sof/imx/imx8m.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,10 @@ struct snd_sof_dsp_ops sof_imx8m_ops = {
296296
/* firmware loading */
297297
.load_firmware = snd_sof_load_firmware_memcpy,
298298

299+
/* client ops */
300+
.register_ipc_clients = imx8_dma_trace_register,
301+
.unregister_ipc_clients = imx8_dma_trace_unregister,
302+
299303
/* Debug information */
300304
.dbg_dump = imx8_dump,
301305
.debugfs_add_region_item = snd_sof_debugfs_add_region_item_iomem,

sound/soc/sof/sof-client-dma-trace.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,7 @@ static const struct auxiliary_device_id sof_dtrace_client_id_table[] = {
626626
{ .name = "snd_sof.atom-dma-trace", },
627627
{ .name = "snd_sof.bdw-dma-trace", },
628628
{ .name = "snd_sof.hda-dma-trace", },
629+
{ .name = "snd_sof.imx8-dma-trace", },
629630
{},
630631
};
631632
MODULE_DEVICE_TABLE(auxiliary, sof_dtrace_client_id_table);

0 commit comments

Comments
 (0)