Skip to content

Commit a5a61f7

Browse files
committed
ASoC: SOF: Introduce new firmware state: SOF_FW_BOOT_READY_OK
The SOF_FW_BOOT_READY_OK fw_state indicates that the boot ready message has been received and there were no errors found. The SOF_FW_BOOT_COMPLETE state will be reached after the snd_sof_dsp_post_fw_run() completes without error. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1 parent f1537b4 commit a5a61f7

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

include/sound/sof.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ enum snd_sof_fw_state {
3333
SOF_FW_BOOT_IN_PROGRESS,
3434
SOF_FW_BOOT_FAILED,
3535
SOF_FW_BOOT_READY_FAILED,
36+
SOF_FW_BOOT_READY_OK,
3637
SOF_FW_BOOT_COMPLETE,
3738
SOF_FW_CRASHED,
3839
};

sound/soc/sof/ipc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ void snd_sof_ipc_msgs_rx(struct snd_sof_dev *sdev)
454454
if (err < 0)
455455
sof_set_fw_state(sdev, SOF_FW_BOOT_READY_FAILED);
456456
else
457-
sof_set_fw_state(sdev, SOF_FW_BOOT_COMPLETE);
457+
sof_set_fw_state(sdev, SOF_FW_BOOT_READY_OK);
458458

459459
/* wake up firmware loader */
460460
wake_up(&sdev->boot_wait);

sound/soc/sof/loader.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -843,9 +843,7 @@ int snd_sof_run_firmware(struct snd_sof_dev *sdev)
843843
return -EIO;
844844
}
845845

846-
if (sdev->fw_state == SOF_FW_BOOT_COMPLETE)
847-
dev_dbg(sdev->dev, "firmware boot complete\n");
848-
else
846+
if (sdev->fw_state == SOF_FW_BOOT_READY_FAILED)
849847
return -EIO; /* FW boots but fw_ready op failed */
850848

851849
/* perform post fw run operations */
@@ -855,6 +853,9 @@ int snd_sof_run_firmware(struct snd_sof_dev *sdev)
855853
return ret;
856854
}
857855

856+
dev_dbg(sdev->dev, "firmware boot complete\n");
857+
sof_set_fw_state(sdev, SOF_FW_BOOT_COMPLETE);
858+
858859
return 0;
859860
}
860861
EXPORT_SYMBOL(snd_sof_run_firmware);

0 commit comments

Comments
 (0)