Merge "video: driver: set force mem and pheripheral on flags"
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

commit
9b51939152
@@ -6,6 +6,8 @@
|
||||
#ifndef _MSM_VIDC_RESOURCES_H_
|
||||
#define _MSM_VIDC_RESOURCES_H_
|
||||
|
||||
#include <linux/clk/qcom.h>
|
||||
|
||||
struct icc_path;
|
||||
struct regulator;
|
||||
struct clk;
|
||||
@@ -223,6 +225,8 @@ struct msm_vidc_resources_ops {
|
||||
|
||||
int (*clk_disable)(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,
|
||||
const char *name, enum branch_mem_flags flag);
|
||||
};
|
||||
|
||||
const struct msm_vidc_resources_ops *get_resources_ops(void);
|
||||
|
@@ -346,6 +346,28 @@ static int __init_clocks(struct msm_vidc_core *core)
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int __clock_set_flag(struct msm_vidc_core *core,
|
||||
const char *name, enum branch_mem_flags flag)
|
||||
{
|
||||
struct clock_info *cinfo = NULL;
|
||||
bool found = false;
|
||||
|
||||
/* get clock handle */
|
||||
venus_hfi_for_each_clock(core, cinfo) {
|
||||
if (strcmp(cinfo->name, name))
|
||||
continue;
|
||||
found = true;
|
||||
qcom_clk_set_flags(cinfo->clk, flag);
|
||||
d_vpr_h("%s: set flag %d on clock %s\n", __func__, flag, name);
|
||||
break;
|
||||
}
|
||||
if (!found) {
|
||||
d_vpr_e("%s: failed to find clock: %s\n", __func__, name);
|
||||
return -EINVAL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __init_reset_clocks(struct msm_vidc_core *core)
|
||||
{
|
||||
const struct clk_rst_table *rst_tbl;
|
||||
@@ -1437,6 +1459,7 @@ static const struct msm_vidc_resources_ops res_ops = {
|
||||
.set_clks = __set_clocks,
|
||||
.clk_enable = __prepare_enable_clock,
|
||||
.clk_disable = __disable_unprepare_clock,
|
||||
.clk_set_flag = __clock_set_flag,
|
||||
};
|
||||
|
||||
const struct msm_vidc_resources_ops *get_resources_ops(void)
|
||||
|
Reference in New Issue
Block a user