video-driver: Abstract platform resources

Move clocks, gdsc, bandwidth resources out of venus_hfi and
use the ops in variant and venus_hfi code.

Change-Id: I1be77c9d384f4eef2cb8085b75c39dc3fd3eeb86
Signed-off-by: Stanimir Varbanov <quic_c_svarba@quicinc.com>
This commit is contained in:
Stanimir Varbanov
2022-06-15 02:55:42 -07:00
committed by Gerrit - the friendly Code Review server
parent a558b04808
commit 8b003fb153
10 changed files with 1301 additions and 1338 deletions

View File

@@ -0,0 +1,35 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2020-2022, The Linux Foundation. All rights reserved.
*/
#ifndef _MSM_VIDC_RESOURCES_H_
#define _MSM_VIDC_RESOURCES_H_
struct msm_vidc_core;
struct msm_vidc_resources_ops {
int (*get)(struct msm_vidc_core *core);
void (*put)(struct msm_vidc_core *core);
int (*reset_bridge)(struct msm_vidc_core *core);
int (*gdsc_on)(struct msm_vidc_core *core, const char *name);
int (*gdsc_off)(struct msm_vidc_core *core, const char *name);
int (*gdsc_hw_ctrl)(struct msm_vidc_core *core);
int (*gdsc_sw_ctrl)(struct msm_vidc_core *core);
int (*llcc)(struct msm_vidc_core *core, bool enable);
int (*set_bw)(struct msm_vidc_core *core, unsigned long bw_ddr,
unsigned long bw_llcc);
int (*set_clks)(struct msm_vidc_core *core, u64 rate);
int (*clk_disable)(struct msm_vidc_core *core, const char *name);
int (*clk_enable)(struct msm_vidc_core *core, const char *name);
int (*set_regs)(struct msm_vidc_core *core);
};
const struct msm_vidc_resources_ops *get_resources_ops(void);
#endif