// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
/*
 * Copyright (c) 2023 MediaTek Inc.
 */

#include <common.h>
#include <command.h>
#include <debug_impl.h>
#include <mtk_bootmusic.h>
#include <smp/thread_info.h>
#include <smp/thread.h>

extern thread_t *music_init_thread_id;
void *boot_music_init_thread_entry(void *args)
{
    int ret = -1;

    ret = run_command("bootmusic init", 0);
    if (ret < 0)
    {
        UBOOT_ERROR("bootmusic init command task execute failure.\n");
    }

    return NULL;
}

void *boot_music_play_thread_entry(void *args)
{
    int ret = -1;
    if (music_init_thread_id)
    {
        thread_join(music_init_thread_id, NULL);
    }

    ret = run_command("bootmusic play", 0);
    if (ret < 0)
    {
        UBOOT_ERROR("bootmusic play command task execute failure.\n");
    }

    return NULL;
}
