From a7fa141afa94d3181ff280f8c85ba28c6f8ee126 Mon Sep 17 00:00:00 2001 From: Nanxin Qin Date: Sun, 27 Jan 2019 01:21:20 +0800 Subject: [PATCH] tee: add an interface for the teeload with swapping. [1/1] PD#SWPL-2367 Problem: building err and issue of compatibility. Solution: 1. fixed building err without merging media_modules 2. add a new api tee_load_video_fw_swap Verify: p212,u212 Change-Id: Ifeedf2f3fa04b2427dccf2ac3940bad6860362d6 Signed-off-by: Nanxin Qin --- drivers/amlogic/tee/tee.c | 13 ++++++++++++- include/linux/amlogic/tee.h | 3 ++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/amlogic/tee/tee.c b/drivers/amlogic/tee/tee.c index 2e51e184a508..b10634f238b4 100644 --- a/drivers/amlogic/tee/tee.c +++ b/drivers/amlogic/tee/tee.c @@ -162,7 +162,7 @@ static CLASS_ATTR(api_version, 0644, tee_api_version_show, * index: firmware index * vdec: vdec type(0: compatible, 1: legency vdec, 2: HEVC vdec) */ -int tee_load_video_fw(uint32_t index, uint32_t vdec, bool is_swap) +static int tee_load_firmware(uint32_t index, uint32_t vdec, bool is_swap) { struct arm_smccc_res res; long cpu; @@ -184,8 +184,19 @@ int tee_load_video_fw(uint32_t index, uint32_t vdec, bool is_swap) set_cpus_allowed_ptr(current, cpu_all_mask); return res.a0; } + +int tee_load_video_fw(uint32_t index, uint32_t vdec) +{ + return tee_load_firmware(index, vdec, false); +} EXPORT_SYMBOL(tee_load_video_fw); +int tee_load_video_fw_swap(uint32_t index, uint32_t vdec, bool is_swap) +{ + return tee_load_firmware(index, vdec, is_swap); +} +EXPORT_SYMBOL(tee_load_video_fw_swap); + bool tee_enabled(void) { struct arm_smccc_res res; diff --git a/include/linux/amlogic/tee.h b/include/linux/amlogic/tee.h index 0c620489d15a..224dde5cb3ee 100644 --- a/include/linux/amlogic/tee.h +++ b/include/linux/amlogic/tee.h @@ -20,6 +20,7 @@ extern bool tee_enabled(void); extern int is_secload_get(void); -extern int tee_load_video_fw(uint32_t index, uint32_t vdec, bool is_swap); +extern int tee_load_video_fw(uint32_t index, uint32_t vdec); +extern int tee_load_video_fw_swap(uint32_t index, uint32_t vdec, bool is_swap); #endif /* __TEE_H__ */