0001
0002
0003
0004
0005 #include "sof-priv.h"
0006
0007 int sof_fw_trace_init(struct snd_sof_dev *sdev)
0008 {
0009 if (!sdev->ipc->ops->fw_tracing) {
0010 dev_info(sdev->dev, "Firmware tracing is not available\n");
0011 sdev->fw_trace_is_supported = false;
0012
0013 return 0;
0014 }
0015
0016 return sdev->ipc->ops->fw_tracing->init(sdev);
0017 }
0018
0019 void sof_fw_trace_free(struct snd_sof_dev *sdev)
0020 {
0021 if (!sdev->fw_trace_is_supported || !sdev->ipc->ops->fw_tracing)
0022 return;
0023
0024 if (sdev->ipc->ops->fw_tracing->free)
0025 sdev->ipc->ops->fw_tracing->free(sdev);
0026 }
0027
0028 void sof_fw_trace_fw_crashed(struct snd_sof_dev *sdev)
0029 {
0030 if (!sdev->fw_trace_is_supported)
0031 return;
0032
0033 if (sdev->ipc->ops->fw_tracing->fw_crashed)
0034 sdev->ipc->ops->fw_tracing->fw_crashed(sdev);
0035 }
0036
0037 void sof_fw_trace_suspend(struct snd_sof_dev *sdev, pm_message_t pm_state)
0038 {
0039 if (!sdev->fw_trace_is_supported)
0040 return;
0041
0042 sdev->ipc->ops->fw_tracing->suspend(sdev, pm_state);
0043 }
0044
0045 int sof_fw_trace_resume(struct snd_sof_dev *sdev)
0046 {
0047 if (!sdev->fw_trace_is_supported)
0048 return 0;
0049
0050 return sdev->ipc->ops->fw_tracing->resume(sdev);
0051 }