video: driver: Move clk/qcom.h to external reseource file
Move qcom.h header file from resources.h to resources_ext file. Change-Id: I81735461f093fe724a51d66538be1cc562fc0e24 Signed-off-by: Vedang Nagar <quic_vnagar@quicinc.com>
This commit is contained in:
@@ -432,11 +432,11 @@ static int __power_off_iris33_controller(struct msm_vidc_core *core)
|
|||||||
d_vpr_e("%s: assert video_axi_reset failed\n", __func__);
|
d_vpr_e("%s: assert video_axi_reset failed\n", __func__);
|
||||||
/* set retain mem and peripheral before asset mvs0c reset */
|
/* set retain mem and peripheral before asset mvs0c reset */
|
||||||
rc = call_res_op(core, clk_set_flag, core,
|
rc = call_res_op(core, clk_set_flag, core,
|
||||||
"video_cc_mvs0c_clk", CLKFLAG_RETAIN_MEM);
|
"video_cc_mvs0c_clk", MSM_VIDC_CLKFLAG_RETAIN_MEM);
|
||||||
if (rc)
|
if (rc)
|
||||||
d_vpr_e("%s: set retain mem failed\n", __func__);
|
d_vpr_e("%s: set retain mem failed\n", __func__);
|
||||||
rc = call_res_op(core, clk_set_flag, core,
|
rc = call_res_op(core, clk_set_flag, core,
|
||||||
"video_cc_mvs0c_clk", CLKFLAG_RETAIN_PERIPH);
|
"video_cc_mvs0c_clk", MSM_VIDC_CLKFLAG_RETAIN_PERIPH);
|
||||||
if (rc)
|
if (rc)
|
||||||
d_vpr_e("%s: set retain peripheral failed\n", __func__);
|
d_vpr_e("%s: set retain peripheral failed\n", __func__);
|
||||||
rc = call_res_op(core, reset_control_assert, core, "video_mvs0c_reset");
|
rc = call_res_op(core, reset_control_assert, core, "video_mvs0c_reset");
|
||||||
@@ -534,11 +534,11 @@ skip_video_xo_reset:
|
|||||||
|
|
||||||
/* remove retain mem and retain peripheral */
|
/* remove retain mem and retain peripheral */
|
||||||
rc = call_res_op(core, clk_set_flag, core,
|
rc = call_res_op(core, clk_set_flag, core,
|
||||||
"video_cc_mvs0c_clk", CLKFLAG_NORETAIN_PERIPH);
|
"video_cc_mvs0c_clk", MSM_VIDC_CLKFLAG_NORETAIN_PERIPH);
|
||||||
if (rc)
|
if (rc)
|
||||||
d_vpr_e("%s: set noretain peripheral failed\n", __func__);
|
d_vpr_e("%s: set noretain peripheral failed\n", __func__);
|
||||||
rc = call_res_op(core, clk_set_flag, core,
|
rc = call_res_op(core, clk_set_flag, core,
|
||||||
"video_cc_mvs0c_clk", CLKFLAG_NORETAIN_MEM);
|
"video_cc_mvs0c_clk", MSM_VIDC_CLKFLAG_NORETAIN_MEM);
|
||||||
if (rc)
|
if (rc)
|
||||||
d_vpr_e("%s: set noretain mem failed\n", __func__);
|
d_vpr_e("%s: set noretain mem failed\n", __func__);
|
||||||
|
|
||||||
|
@@ -7,8 +7,6 @@
|
|||||||
#ifndef _MSM_VIDC_RESOURCES_H_
|
#ifndef _MSM_VIDC_RESOURCES_H_
|
||||||
#define _MSM_VIDC_RESOURCES_H_
|
#define _MSM_VIDC_RESOURCES_H_
|
||||||
|
|
||||||
#include <linux/clk/qcom.h>
|
|
||||||
|
|
||||||
struct icc_path;
|
struct icc_path;
|
||||||
struct regulator;
|
struct regulator;
|
||||||
struct clk;
|
struct clk;
|
||||||
@@ -103,6 +101,15 @@ struct msm_vidc_core;
|
|||||||
#define venus_hfi_for_each_device_region(__device, __sinfo) \
|
#define venus_hfi_for_each_device_region(__device, __sinfo) \
|
||||||
venus_hfi_for_each_thing(__device, __sinfo, device_region)
|
venus_hfi_for_each_thing(__device, __sinfo, device_region)
|
||||||
|
|
||||||
|
enum msm_vidc_branch_mem_flags {
|
||||||
|
MSM_VIDC_CLKFLAG_RETAIN_PERIPH,
|
||||||
|
MSM_VIDC_CLKFLAG_NORETAIN_PERIPH,
|
||||||
|
MSM_VIDC_CLKFLAG_RETAIN_MEM,
|
||||||
|
MSM_VIDC_CLKFLAG_NORETAIN_MEM,
|
||||||
|
MSM_VIDC_CLKFLAG_PERIPH_OFF_SET,
|
||||||
|
MSM_VIDC_CLKFLAG_PERIPH_OFF_CLEAR,
|
||||||
|
};
|
||||||
|
|
||||||
struct bus_info {
|
struct bus_info {
|
||||||
struct icc_path *icc;
|
struct icc_path *icc;
|
||||||
const char *name;
|
const char *name;
|
||||||
@@ -274,7 +281,7 @@ struct msm_vidc_resources_ops {
|
|||||||
int (*clk_disable)(struct msm_vidc_core *core, const char *name);
|
int (*clk_disable)(struct msm_vidc_core *core, const char *name);
|
||||||
int (*clk_enable)(struct msm_vidc_core *core, const char *name);
|
int (*clk_enable)(struct msm_vidc_core *core, const char *name);
|
||||||
int (*clk_set_flag)(struct msm_vidc_core *core,
|
int (*clk_set_flag)(struct msm_vidc_core *core,
|
||||||
const char *name, enum branch_mem_flags flag);
|
const char *name, enum msm_vidc_branch_mem_flags flag);
|
||||||
int (*clk_print_residency_stats)(struct msm_vidc_core *core);
|
int (*clk_print_residency_stats)(struct msm_vidc_core *core);
|
||||||
int (*clk_reset_residency_stats)(struct msm_vidc_core *core);
|
int (*clk_reset_residency_stats)(struct msm_vidc_core *core);
|
||||||
};
|
};
|
||||||
|
@@ -5,6 +5,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <linux/clk.h>
|
#include <linux/clk.h>
|
||||||
|
#include <linux/clk/qcom.h>
|
||||||
|
|
||||||
#ifdef CONFIG_MSM_MMRM
|
#ifdef CONFIG_MSM_MMRM
|
||||||
#include <linux/soc/qcom/msm_mmrm.h>
|
#include <linux/soc/qcom/msm_mmrm.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -499,19 +501,54 @@ static int __set_clocks_ext(struct msm_vidc_core *core, u64 freq)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __clock_set_flag_ext(struct msm_vidc_core *core,
|
static int qcom_clk_get_branch_flag(enum msm_vidc_branch_mem_flags vidc_flag,
|
||||||
const char *name, enum branch_mem_flags flag)
|
enum branch_mem_flags *clk_flag)
|
||||||
{
|
{
|
||||||
struct clock_info *cinfo = NULL;
|
switch (vidc_flag) {
|
||||||
bool found = false;
|
case MSM_VIDC_CLKFLAG_RETAIN_PERIPH:
|
||||||
|
*clk_flag = CLKFLAG_RETAIN_PERIPH;
|
||||||
|
break;
|
||||||
|
case MSM_VIDC_CLKFLAG_NORETAIN_PERIPH:
|
||||||
|
*clk_flag = CLKFLAG_NORETAIN_PERIPH;
|
||||||
|
break;
|
||||||
|
case MSM_VIDC_CLKFLAG_RETAIN_MEM:
|
||||||
|
*clk_flag = CLKFLAG_RETAIN_MEM;
|
||||||
|
break;
|
||||||
|
case MSM_VIDC_CLKFLAG_NORETAIN_MEM:
|
||||||
|
*clk_flag = CLKFLAG_NORETAIN_MEM;
|
||||||
|
break;
|
||||||
|
case MSM_VIDC_CLKFLAG_PERIPH_OFF_SET:
|
||||||
|
*clk_flag = CLKFLAG_PERIPH_OFF_SET;
|
||||||
|
break;
|
||||||
|
case MSM_VIDC_CLKFLAG_PERIPH_OFF_CLEAR:
|
||||||
|
*clk_flag = CLKFLAG_PERIPH_OFF_CLEAR;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
d_vpr_e("%s: invalid clk flag: %d\n", __func__, vidc_flag);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* get clock handle */
|
static int __clock_set_flag_ext(struct msm_vidc_core *core,
|
||||||
venus_hfi_for_each_clock(core, cinfo) {
|
const char *name, enum msm_vidc_branch_mem_flags flag)
|
||||||
|
{
|
||||||
|
int rc = 0;
|
||||||
|
struct clock_info *cinfo = NULL;
|
||||||
|
bool found = false;
|
||||||
|
enum branch_mem_flags mem_flag;
|
||||||
|
|
||||||
|
/* get clock handle */
|
||||||
|
venus_hfi_for_each_clock(core, cinfo) {
|
||||||
if (strcmp(cinfo->name, name))
|
if (strcmp(cinfo->name, name))
|
||||||
continue;
|
continue;
|
||||||
found = true;
|
found = true;
|
||||||
qcom_clk_set_flags(cinfo->clk, flag);
|
rc = qcom_clk_get_branch_flag(flag, &mem_flag);
|
||||||
d_vpr_h("%s: set flag %d on clock %s\n", __func__, flag, name);
|
if (rc)
|
||||||
|
return rc;
|
||||||
|
|
||||||
|
qcom_clk_set_flags(cinfo->clk, mem_flag);
|
||||||
|
d_vpr_h("%s: set flag %d on clock %s\n", __func__, mem_flag, name);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!found) {
|
if (!found) {
|
||||||
|
Reference in New Issue
Block a user