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.
98 lines
3.1 KiB
98 lines
3.1 KiB
/*
|
|
* Copyright (c) Hisilicon Technologies Co., Ltd.. 2020-2020. All rights reserved.
|
|
* Description: pdm driver implement
|
|
* Author: Hisilicon
|
|
* Create: 2020-4-13
|
|
*/
|
|
|
|
#ifndef __DRV_PDM_H__
|
|
#define __DRV_PDM_H__
|
|
|
|
#include "soc_log.h"
|
|
#include "drv_pdm_ext.h"
|
|
#include "osal_ext.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#undef LOG_MODULE_ID
|
|
#define LOG_MODULE_ID SOC_ID_PDM
|
|
|
|
#define PDM_MAX_BUF_NUM 32
|
|
#define PDM_PATH_NAME_LEN_MAX 64
|
|
|
|
typedef struct {
|
|
td_char buf_name[PDM_MAX_BUF_NUM];
|
|
td_bool release;
|
|
td_u32 lenth;
|
|
td_u8 *phy_addr;
|
|
td_u8 *vir_addr;
|
|
} pdm_buf_info;
|
|
|
|
typedef struct {
|
|
pdm_buf_info buf_info[PDM_MAX_BUF_NUM];
|
|
td_u32 buf_num;
|
|
osal_semaphore pdm_mutex;
|
|
} pdm_global;
|
|
|
|
typedef struct {
|
|
ext_pdm_set_silence_callback_func fn;
|
|
td_void *private_data;
|
|
struct osal_list_head list;
|
|
} silence_call_back_node;
|
|
|
|
typedef struct {
|
|
td_u32 module_id;
|
|
struct osal_list_head list_head;
|
|
} pdm_silence_cfg_info;
|
|
|
|
extern pdm_global g_pdm_global;
|
|
|
|
td_s32 drv_pdm_release_reserve_mem(const td_char *buf_name);
|
|
td_s32 drv_pdm_get_data(const td_char *buf_name, td_u8 **data_addr, td_u32 *data_len);
|
|
td_s32 pdm_get_vir_addr_by_name(const td_char *buf_name, td_u8 **vir_addr, td_u32 *len);
|
|
td_s32 pdm_get_buf_by_name(const td_char *buf_name, td_u8 **base_phy_addr, td_u32 *len);
|
|
td_s32 pdm_set_vir_addr_by_name(const td_char *buf_name, td_u8 *vir_addr);
|
|
/*
|
|
* Ex interface for compatibility, there is no volume in old baseparam image,
|
|
* pbVolumeExistInBase can distinguish a image is an old baseparam or a new baseparam;
|
|
* and there are volume in both old and new fastplay image, fastplay will select using
|
|
* volume in baseparam first, if baseparam is old image, fastplay will using volume in fastplay image
|
|
*/
|
|
|
|
td_s32 ext_drv_pdm_release_reserve_mem(const td_char *buf_name);
|
|
|
|
td_s32 ext_drv_pdm_get_reserve_mem(const td_char *buf_name, td_u64 *resever_addr, td_u32 *resever_buf_size);
|
|
|
|
td_s32 ext_drv_pdm_get_data(const td_char *buf_name, td_u8 **data_addr, td_u32 *data_len);
|
|
|
|
td_s32 ext_drv_pdm_set_license_data(td_u64 lic_handle, td_u32 lic_len);
|
|
|
|
td_s32 ext_drv_pdm_get_tcon_param(td_u32 panel_index, td_u32 offset, td_u32 size, td_void *tcon_param,
|
|
td_u32 tcon_param_len);
|
|
|
|
td_s32 ext_drv_pdm_get_tcon_module_param(td_u32 panel_index, td_u32 mod_id, td_void *data_ptr, td_u32 data_len);
|
|
|
|
td_s32 ext_drv_pdm_is_tcon_module_exist(td_u32 panel_index, td_bool *exist, td_u32 mod_id, td_u32 *len);
|
|
|
|
td_s32 ext_drv_pdm_get_tcon_head(td_void *tcon_head, td_u32 tcon_head_len);
|
|
|
|
td_s32 ext_drv_pdm_get_silence_flag(td_bool *silence);
|
|
|
|
td_s32 ext_drv_pdm_set_silence_flag(td_bool silence);
|
|
|
|
td_s32 ext_drv_pdm_register_callback(td_u32 module_id, ext_pdm_set_silence_callback_func fn, td_void *private_data);
|
|
|
|
td_s32 ext_drv_pdm_resume_handler(td_void);
|
|
|
|
td_s32 ext_drv_pdm_get_ta_revoked_list(td_void *buf, td_u32 buf_size, td_u32 *read_size);
|
|
|
|
td_s32 ext_drv_pdm_db_get_data(const ext_pdm_partion_info *data, td_void *addr, td_u32 size);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|