You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
2.9 KiB

/*
* Copyright (c) Hisilicon Technologies Co., Ltd. 2019-2019. All rights reserved.
* Description: aflt device and driver include files
* Author: audio
* Create: 2019-05-30
*/
#ifndef __HAL_AFLT_H__
#define __HAL_AFLT_H__
#include "audsp_aflt_ext.h"
#include "drv_ioctl_aflt.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
typedef struct {
td_u64 phys_addr;
td_u64 virt_addr;
td_u32 size;
} hal_aflt_msgpool_attr;
typedef struct {
td_u64 phys_addr;
td_u64 virt_addr;
td_u32 size;
td_u32 write;
td_u32 read;
td_u32 stream_read_pos; /* pts read pos */
td_u32 pts_boundary; /* pts read pointers wrap point */
td_u32 buf_flag;
td_bool eos;
} hal_aflt_inbuf_attr;
typedef struct {
td_u64 phys_addr;
td_u64 virt_addr;
td_u32 size;
td_u32 write;
td_u32 write_wrap;
td_u32 read;
td_u32 read_wrap;
td_u32 period_number;
td_u32 period_buf_size;
td_u32 unit_head_size;
} hal_aflt_outbuf_attr;
td_void aflt_hal_init(td_u8 *reg_base, td_bool sw_aflt);
td_void aflt_hal_deinit(td_void);
td_s32 aflt_hal_create(td_u32 aflt_id, const aflt_create_attr *attr);
td_s32 aflt_hal_destroy(td_u32 aflt_id);
td_s32 aflt_hal_start(td_u32 aflt_id);
td_s32 aflt_hal_stop(td_u32 aflt_id);
td_s32 aflt_hal_set_param(td_u32 aflt_id, const aflt_param *param);
td_s32 aflt_hal_get_param(td_u32 aflt_id, aflt_param *param);
td_s32 aflt_hal_set_config(td_u32 aflt_id, const aflt_config *cfg);
td_s32 aflt_hal_get_config(td_u32 aflt_id, aflt_config *cfg);
td_s32 aflt_hal_store_setting(td_u32 aflt_id);
td_s32 aflt_hal_restore_setting(td_u32 aflt_id);
td_void aflt_hal_set_msg_pool_attr(td_u32 aflt_id, hal_aflt_msgpool_attr *attr);
td_s32 aflt_hal_init_inbuf(td_u32 aflt_id, hal_aflt_inbuf_attr *attr);
td_s32 aflt_hal_deinit_inbuf(td_u32 aflt_id);
td_s32 aflt_hal_deinit_outbuf(td_u32 aflt_id);
td_s32 aflt_hal_init_outbuf(td_u32 aflt_id, hal_aflt_outbuf_attr *attr);
td_void aflt_hal_get_inbuf_write_pos(td_u32 aflt_id, td_u32 *write_pos);
td_void aflt_hal_get_inbuf_read_pos(td_u32 aflt_id, td_u32 *read_pos);
td_void aflt_hal_get_inbuf_stream_read_pos(td_u32 aflt_id, td_u32 *stream_read_pos);
td_void aflt_hal_set_inbuf_write_pos(td_u32 aflt_id, td_u32 write_pos);
td_void aflt_hal_get_outbuf_write_idx_and_wrap(td_u32 aflt_id, td_u32 *write_idx, td_u32 *write_wrap);
td_void aflt_hal_get_outbuf_read_idx_and_wrap(td_u32 aflt_id, td_u32 *read_idx, td_u32 *read_wrap);
td_void aflt_hal_get_exe_frame_statistics_info(td_u32 aflt_id, td_u32 *try_exe_cnt, td_u32 *frame_cnt,
td_u32 *err_frame_cnt);
td_void aflt_hal_get_time_out_statistics_info(td_u32 aflt_id, td_u32 *sche_time_out_cnt,
td_u32 *exe_time_out_cnt);
td_void aflt_hal_set_out_buf_rptr_and_wrap(td_u32 aflt_id, td_u32 read_idx);
td_void aflt_hal_set_eos_flag(td_u32 aflt_id, td_bool eos);
td_void aflt_hal_get_end_of_frame(td_u32 aflt_id, td_bool *end_of_frame);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __HAL_AFLT_H__ */