Line data Source code
1 1 : /*
2 : * Copyright (c) 2022 Intel Corporation
3 : *
4 : * SPDX-License-Identifier: Apache-2.0
5 : */
6 :
7 : /**
8 : * @file
9 : * @brief Header file for the Intel ADSP HDA log backend API
10 : * @ingroup log_backend_adsp_hda
11 : */
12 :
13 : #ifndef ZEPHYR_LOG_BACKEND_ADSP_HDA_H_
14 : #define ZEPHYR_LOG_BACKEND_ADSP_HDA_H_
15 :
16 : /**
17 : * @brief Intel ADSP HDA log backend API
18 : * @defgroup log_backend_adsp_hda Intel ADSP HDA log backend API
19 : * @ingroup log_backend
20 : * @{
21 : */
22 :
23 : #include <stdint.h>
24 :
25 : /**
26 : *@brief HDA logger requires a hook for IPC messages
27 : *
28 : * When the log is flushed and written with DMA an IPC message should
29 : * be sent to inform the host. This hook function pointer allows for that
30 : */
31 1 : typedef void(*adsp_hda_log_hook_t)(uint32_t written);
32 :
33 : /**
34 : * @brief Initialize the Intel ADSP HDA logger
35 : *
36 : * @param hook Function is called after each HDA flush in order to
37 : * inform the Host of DMA log data. This hook may be called
38 : * from multiple CPUs and multiple calling contexts concurrently.
39 : * It is up to the author of the hook to serialize if needed.
40 : * It is guaranteed to be called once for every flush.
41 : * @param channel HDA stream (DMA Channel) to use for logging
42 : */
43 1 : void adsp_hda_log_init(adsp_hda_log_hook_t hook, uint32_t channel);
44 :
45 : /** @} */
46 :
47 : #endif /* ZEPHYR_LOG_BACKEND_ADSP_HDA_H_ */
|