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.
921 lines
24 KiB
921 lines
24 KiB
/*
|
|
* Copyright (c) Hisilicon Technologies Co., Ltd.. 2020-2020. All rights reserved.
|
|
* Description: baseparam database operation function
|
|
* Author: huanglong
|
|
* Create: 2020-4-6
|
|
*/
|
|
|
|
#include "securec.h"
|
|
#include "mpi_pdm_ext.h"
|
|
#include "uapi_pdm.h"
|
|
#include "db_ext.h"
|
|
|
|
static td_s32 pdm_convert_drv_to_iapi_pmoc_flag(const ext_pdm_pmoc_memory_flag drv_pmoc_flag,
|
|
uapi_pdm_pmoc_memory_flag *iapi_pmoc_flag)
|
|
{
|
|
switch (drv_pmoc_flag) {
|
|
case EXT_PDM_PMOC_MEMORY_FLAG_RUN:
|
|
*iapi_pmoc_flag = UAPI_PDM_PMOC_MEMORY_FLAG_RUN;
|
|
break;
|
|
|
|
case EXT_PDM_PMOC_MEMORY_FLAG_SUSPEND:
|
|
*iapi_pmoc_flag = UAPI_PDM_PMOC_MEMORY_FLAG_SUSPEND;
|
|
break;
|
|
|
|
default:
|
|
soc_log_err("not support this pmoc_flag[%d]\n", drv_pmoc_flag);
|
|
return SOC_ERR_PDM_PARAM_INVALID;
|
|
}
|
|
|
|
soc_log_dbg("convert %d to %d\n", drv_pmoc_flag, *iapi_pmoc_flag);
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
static td_s32 pdm_convert_iapi_to_drv_pmoc_flag(const uapi_pdm_pmoc_memory_flag iapi_pmoc_flag,
|
|
ext_pdm_pmoc_memory_flag *drv_pmoc_flag)
|
|
{
|
|
switch (iapi_pmoc_flag) {
|
|
case UAPI_PDM_PMOC_MEMORY_FLAG_RUN:
|
|
*drv_pmoc_flag = EXT_PDM_PMOC_MEMORY_FLAG_RUN;
|
|
break;
|
|
|
|
case UAPI_PDM_PMOC_MEMORY_FLAG_SUSPEND:
|
|
*drv_pmoc_flag = EXT_PDM_PMOC_MEMORY_FLAG_SUSPEND;
|
|
break;
|
|
|
|
default:
|
|
soc_log_err("not support this pmoc_flag[%d]\n", iapi_pmoc_flag);
|
|
return SOC_ERR_PDM_PARAM_INVALID;
|
|
}
|
|
|
|
soc_log_dbg("convert %d to %d\n", iapi_pmoc_flag, *drv_pmoc_flag);
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
static td_void pdm_convert_drv_to_iapi_amp_info(const ext_pdm_amp_info drv_amp_info,
|
|
uapi_pdm_amp_info *iapi_amp_info)
|
|
{
|
|
iapi_amp_info->device_type = drv_amp_info.device_type;
|
|
iapi_amp_info->device_addr = drv_amp_info.device_addr;
|
|
iapi_amp_info->gpio_output_polarity = drv_amp_info.gpio_output_polarity;
|
|
iapi_amp_info->reset_gpio_num = drv_amp_info.reset_gpio_num;
|
|
iapi_amp_info->hw_mute_gpio_num = drv_amp_info.hw_mute_gpio_num;
|
|
iapi_amp_info->reset_polarity = drv_amp_info.reset_polarity;
|
|
iapi_amp_info->hw_mute_polarity = drv_amp_info.hw_mute_polarity;
|
|
iapi_amp_info->i2c_num = drv_amp_info.i2c_num;
|
|
}
|
|
|
|
static td_void pdm_convert_iapi_to_drv_amp_info(const uapi_pdm_amp_info iapi_amp_info,
|
|
ext_pdm_amp_info *drv_amp_info)
|
|
{
|
|
drv_amp_info->device_type = iapi_amp_info.device_type;
|
|
drv_amp_info->device_addr = iapi_amp_info.device_addr;
|
|
drv_amp_info->gpio_output_polarity = iapi_amp_info.gpio_output_polarity;
|
|
drv_amp_info->reset_gpio_num = iapi_amp_info.reset_gpio_num;
|
|
drv_amp_info->hw_mute_gpio_num = iapi_amp_info.hw_mute_gpio_num;
|
|
drv_amp_info->reset_polarity = iapi_amp_info.reset_polarity;
|
|
drv_amp_info->hw_mute_polarity = iapi_amp_info.hw_mute_polarity;
|
|
drv_amp_info->i2c_num = iapi_amp_info.i2c_num;
|
|
}
|
|
|
|
static td_s32 pdm_convert_drv_to_iapi_cfg_info(const ext_pdm_config_info *drv_cfg_info,
|
|
uapi_pdm_config_info *iapi_cfg_info)
|
|
{
|
|
td_s32 ret;
|
|
td_u32 i;
|
|
|
|
if (drv_cfg_info == TD_NULL || iapi_cfg_info == TD_NULL) {
|
|
soc_log_err("ptr is null!\n");
|
|
return SOC_ERR_PDM_PTR_NULL;
|
|
}
|
|
|
|
ret = memcpy_s(iapi_cfg_info->mac_addr, UAPI_PDM_MAC_ADDR_LEN, drv_cfg_info->mac_addr, EXT_PDM_MAC_ADDR_LEN);
|
|
if (ret != EOK) {
|
|
soc_log_err("mac_addr memcpy_s fail!\n");
|
|
return TD_FAILURE;
|
|
}
|
|
|
|
iapi_cfg_info->mem_size = drv_cfg_info->mem_size;
|
|
iapi_cfg_info->flash_size = drv_cfg_info->flash_size;
|
|
iapi_cfg_info->uart_enable = drv_cfg_info->uart_enable;
|
|
iapi_cfg_info->wol_mode = drv_cfg_info->wol_mode;
|
|
|
|
ret = pdm_convert_drv_to_iapi_pmoc_flag(drv_cfg_info->pmoc_flag, &iapi_cfg_info->pmoc_flag);
|
|
if (ret != TD_SUCCESS) {
|
|
return ret;
|
|
}
|
|
|
|
iapi_cfg_info->boot_log_level = drv_cfg_info->boot_log_level;
|
|
iapi_cfg_info->panel_abnormal_count = drv_cfg_info->panel_abnormal_count;
|
|
pdm_convert_drv_to_iapi_amp_info(drv_cfg_info->amp_info, &iapi_cfg_info->amp_info);
|
|
|
|
for (i = 0; i < EXT_PDM_HDMITX_ID_MAX; i++) {
|
|
iapi_cfg_info->hdmi_cfg_info[i].hdcp_enable = drv_cfg_info->hdmi_cfg_info[i].hdcp_enable;
|
|
iapi_cfg_info->hdmi_cfg_info[i].hdcp_mode = drv_cfg_info->hdmi_cfg_info[i].hdcp_mode;
|
|
iapi_cfg_info->hdmi_cfg_info[i].cec_enable = drv_cfg_info->hdmi_cfg_info[i].cec_enable;
|
|
iapi_cfg_info->hdmi_cfg_info[i].cec_mode = drv_cfg_info->hdmi_cfg_info[i].cec_mode;
|
|
}
|
|
|
|
iapi_cfg_info->hdmirx_cfg.cec_enable = drv_cfg_info->hdmirx_cfg.cec_enable;
|
|
iapi_cfg_info->hdmirx_cfg.cec_wakeup_enable = drv_cfg_info->hdmirx_cfg.cec_wakeup_enable;
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
static td_s32 pdm_convert_iapi_to_drv_cfg_info(const uapi_pdm_config_info *iapi_cfg_info,
|
|
ext_pdm_config_info *drv_cfg_info)
|
|
{
|
|
td_s32 ret;
|
|
td_u32 i;
|
|
|
|
if (iapi_cfg_info == TD_NULL || drv_cfg_info == TD_NULL) {
|
|
soc_log_err("ptr is null!\n");
|
|
return SOC_ERR_PDM_PTR_NULL;
|
|
}
|
|
|
|
ret = memcpy_s(drv_cfg_info->mac_addr, UAPI_PDM_MAC_ADDR_LEN, iapi_cfg_info->mac_addr, EXT_PDM_MAC_ADDR_LEN);
|
|
if (ret != EOK) {
|
|
soc_log_err("mac_addr memcpy_s fail!\n");
|
|
return TD_FAILURE;
|
|
}
|
|
|
|
drv_cfg_info->mem_size = iapi_cfg_info->mem_size;
|
|
drv_cfg_info->flash_size = iapi_cfg_info->flash_size;
|
|
drv_cfg_info->uart_enable = iapi_cfg_info->uart_enable;
|
|
drv_cfg_info->wol_mode = iapi_cfg_info->wol_mode;
|
|
|
|
ret = pdm_convert_iapi_to_drv_pmoc_flag(iapi_cfg_info->pmoc_flag, &drv_cfg_info->pmoc_flag);
|
|
if (ret != TD_SUCCESS) {
|
|
return ret;
|
|
}
|
|
|
|
drv_cfg_info->boot_log_level = iapi_cfg_info->boot_log_level;
|
|
drv_cfg_info->panel_abnormal_count = iapi_cfg_info->panel_abnormal_count;
|
|
pdm_convert_iapi_to_drv_amp_info(iapi_cfg_info->amp_info, &drv_cfg_info->amp_info);
|
|
|
|
for (i = 0; i < UAPI_PDM_HDMI_ID_MAX; i++) {
|
|
drv_cfg_info->hdmi_cfg_info[i].hdcp_enable = iapi_cfg_info->hdmi_cfg_info[i].hdcp_enable;
|
|
drv_cfg_info->hdmi_cfg_info[i].hdcp_mode = iapi_cfg_info->hdmi_cfg_info[i].hdcp_mode;
|
|
drv_cfg_info->hdmi_cfg_info[i].cec_enable = iapi_cfg_info->hdmi_cfg_info[i].cec_enable;
|
|
drv_cfg_info->hdmi_cfg_info[i].cec_mode = iapi_cfg_info->hdmi_cfg_info[i].cec_mode;
|
|
}
|
|
|
|
drv_cfg_info->hdmirx_cfg.cec_enable = iapi_cfg_info->hdmirx_cfg.cec_enable;
|
|
drv_cfg_info->hdmirx_cfg.cec_wakeup_enable = iapi_cfg_info->hdmirx_cfg.cec_wakeup_enable;
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_get_logo_total_index(td_u32 *total_index)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_get_logo_total_index(total_index);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_get_logo_total_index fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_get_cfg_info(uapi_pdm_config_info *cfg_info)
|
|
{
|
|
td_s32 ret;
|
|
ext_pdm_config_info drv_cfg_info;
|
|
|
|
soc_info_func_enter();
|
|
|
|
memset_s(&drv_cfg_info, sizeof(drv_cfg_info), 0, sizeof(drv_cfg_info));
|
|
|
|
ret = ext_mpi_pdm_get_cfg_info(&drv_cfg_info);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_get_cfg_info fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
ret = pdm_convert_drv_to_iapi_cfg_info(&drv_cfg_info, cfg_info);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("pdm_convert_drv_to_iapi_cfg_info fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_update_cfg_info(uapi_pdm_config_info *cfg_info)
|
|
{
|
|
td_s32 ret;
|
|
ext_pdm_config_info drv_cfg_info;
|
|
|
|
soc_info_func_enter();
|
|
|
|
memset_s(&drv_cfg_info, sizeof(drv_cfg_info), 0, sizeof(drv_cfg_info));
|
|
|
|
ret = pdm_convert_iapi_to_drv_cfg_info(cfg_info, &drv_cfg_info);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("pdm_convert_iapi_to_drv_cfg_info fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
ret = ext_mpi_pdm_update_cfg_info(&drv_cfg_info);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_update_cfg_info fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_get_hdcp_info(uapi_pdm_hdcp_info *hdcp_info)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_get_hdcp_info((ext_pdm_hdcp_info *)hdcp_info);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_get_hdcp_info fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_update_hdcp_info(uapi_pdm_hdcp_info *hdcp_info)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_update_hdcp_info((ext_pdm_hdcp_info *)hdcp_info);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_update_hdcp_info fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_get_basic_info(uapi_pdm_basic_info *basic_info)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_get_basic_info((ext_pdm_basic_info *)basic_info);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_get_basic_info fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_update_basic_info(uapi_pdm_basic_info *basic_info)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_update_basic_info((ext_pdm_basic_info *)basic_info);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_update_basic_info fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_get_hdcp_key(const uapi_pdm_hdcp_key_id id, td_u32 buf_len, td_u8 *key, td_s32 *read_len)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_get_hdcp_key((ext_pdm_hdcp_key_id)id, buf_len, key, read_len);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_get_hdcp_key fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_update_hdcp_key(uapi_pdm_hdcp_key_id id, td_u8 *key, td_s32 len)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_update_hdcp_key((ext_pdm_hdcp_key_id)id, key, len);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_update_hdcp_key fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_get_disp_param(uapi_disp disp_index, uapi_pdm_disp_param *param_data)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_get_disp_param((ext_drv_display)disp_index, (ext_disp_param *)param_data);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_get_disp_param fail! ret:0x%x, disp_index:%d\n", ret, disp_index);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_update_disp_param(uapi_disp disp_index, uapi_pdm_disp_param *param_data)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_update_disp_param((ext_drv_display)disp_index, (ext_disp_param *)param_data);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_update_disp_param fail! ret:0x%x, disp_index:%d\n", ret, disp_index);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_get_extend_total_size(td_u32 *total_size)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_get_extend_total_size(total_size);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_get_extend_total_size fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_get_extend_data(td_u32 addr, td_void *buf, td_u32 buf_size, td_u32 *read_size)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_get_extend_data(addr, buf, buf_size, read_size);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_get_extend_data fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_set_extend_data(td_u32 addr, const td_void *buf, td_u32 buf_size)
|
|
{
|
|
td_s32 ret;
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_set_extend_data(addr, buf, buf_size);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("uapi_pdm_set_extend_data fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_get_pmoc_param(uapi_pdm_pmoc_param *param_data)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_get_pmoc_param((ext_pdm_pmoc_param *)param_data);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_get_pmoc_param fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_update_pmoc_param(uapi_pdm_pmoc_param *param_data)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_update_pmoc_param((ext_pdm_pmoc_param *)param_data);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_update_pmoc_param fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_get_logo_content(td_u32 index, td_u8 *content, td_u32 buf_size, td_u32 *read_len)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_get_logo_content(index, content, buf_size, read_len);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_get_logo_content fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_update_logo_content(td_u32 logo_index, td_u8 *content, td_u32 logo_size)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_update_logo_content(logo_index, content, logo_size);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_update_logo_content fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_get_reserve_mem_data(const td_char *name, td_void *buf_pointer, td_u32 size)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_get_reserve_mem_data(name, buf_pointer, size);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_get_reserve_mem_data fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_set_feature_license(td_u8 *src, td_u32 src_len)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_set_feature_license(src, src_len);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_set_feature_license fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_get_feature_license(td_u8 *dst, td_u32 dst_len, td_u32 *read_len)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_get_feature_license(dst, dst_len, read_len);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_get_feature_license fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_get_panel_info(td_u32 index, uapi_panel_info *panel_parm)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_get_panel_info(index, (ext_drv_panel_info *)panel_parm);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_get_panel_info fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_set_panel_info(td_u32 index, uapi_panel_info *panel_parm)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_set_panel_info(index, (ext_drv_panel_info *)panel_parm);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_set_panel_info fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_get_panel_pq_path(td_u32 index, td_u32 len_in, td_u32 *len_out, td_s8 *pc_pq_path)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_get_panel_pq_path(index, len_in, len_out, pc_pq_path);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_get_panel_pq_path fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_get_panel_bl_level(td_u32 index, td_u32 *bl_pwm)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_get_panel_bl_level(index, bl_pwm);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_get_panel_bl_level fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_set_panel_bl_level(td_u32 index, td_u32 bl_pwm)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_set_panel_bl_level(index, bl_pwm);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_set_panel_bl_level fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_get_panel_bl_level_range(td_u32 index, td_u32 *bl_pwm_user_min, td_u32 *bl_pwm_user_max)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_get_panel_bl_level_range(index, bl_pwm_user_min, bl_pwm_user_max);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_get_panel_bl_level_range fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_set_panel_bl_level_range(td_u32 index, td_u32 bl_pwm_user_min, td_u32 bl_pwm_user_max)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_set_panel_bl_level_range(index, bl_pwm_user_min, bl_pwm_user_max);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_set_panel_bl_level_range fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_get_tcon_total_index(td_u32 *total_num)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_get_tcon_total_index(total_num);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_get_tcon_total_index fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_get_tcon_bin_info(td_u32 tcon_index, uapi_pdm_iapi_pdm_tcon_info *tcon_info)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_get_tcon_bin_info(tcon_index, (ext_pdm_tcon_info *)tcon_info);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_get_tcon_bin_info fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_get_silence_flag(td_bool *silence)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_get_silence_flag(silence);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_get_silence_flag fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_set_silence_flag(td_bool silence)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_set_silence_flag(silence);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_set_silence_flag fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_get_bootmusic_content(td_u32 index, td_u8 *content, td_u32 buf_size, td_u32 *read_len)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_get_bootmusic_content(index, content, buf_size, read_len);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_get_bootmusic_content fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_update_bootmusic_content(td_u32 bm_index, td_u8 *content, td_u32 bm_size)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_update_bootmusic_content(bm_index, content, bm_size);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_update_bootmusic_content fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_get_bootmusic_total_index(td_u32 *total_index)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_get_bootmusic_total_index(total_index);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_get_bootmusic_total_index fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_get_bootmusic_index(td_u32 *snd_index)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_get_bootmusic_index(snd_index);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_get_bootmusic_index fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_set_bootmusic_index(td_u32 snd_index)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
soc_log_info("bm_index:%d\n", snd_index);
|
|
|
|
ret = ext_mpi_pdm_set_bootmusic_index(snd_index);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("fail! snd_index : %d, ret is 0x%x\n", snd_index, ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_get_bootmusic_volume(td_u32 *volume)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_get_bootmusic_volume(volume);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_get_bootmusic_volume fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_set_bootmusic_volume(td_u32 volume)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_set_bootmusic_volume(volume);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_set_bootmusic_volume fail! volume : %d, ret is 0x%x\n", volume, ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_get_bootmusic_enable(td_bool *enable)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_get_bootmusic_enable(enable);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_get_bootmusic_enable fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_set_bootmusic_enable(td_bool enable)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
soc_log_info("enable:%d\n", enable);
|
|
|
|
ret = ext_mpi_pdm_set_bootmusic_enable(enable);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_set_bootmusic_enable fail! enable : %d, ret is 0x%x\n", enable, ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_get_ta_revoked_list(td_void *buf, td_u32 buf_size, td_u32 *read_size)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_get_ta_revoked_list(buf, buf_size, read_size);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_get_ta_revoked_list fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 uapi_pdm_set_ta_revoked_list(const td_void *buf, td_u32 buf_size)
|
|
{
|
|
td_s32 ret;
|
|
|
|
soc_info_func_enter();
|
|
|
|
ret = ext_mpi_pdm_set_ta_revoked_list(buf, buf_size);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("ext_mpi_pdm_set_ta_revoked_list fail! ret is 0x%x\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
soc_info_func_exit();
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|