clk: qcom: rcg2: Add support for hardware control mode

Add a flag to indicate to support and enable hardware control mode
of an RCG.

Change-Id: I21194a463441ea13b7575a4174b1f96504b42b1e
Signed-off-by: Taniya Das <tdas@codeaurora.org>
This commit is contained in:
Taniya Das 2018-12-14 12:36:24 +05:30 committed by Mike Tipton
parent 256df2bfba
commit 21f18e9e49
2 changed files with 4 additions and 0 deletions

View File

@ -158,6 +158,7 @@ struct clk_rcg2 {
u8 cfg_off;
u8 flags;
#define FORCE_ENABLE_RCG BIT(0)
#define HW_CLK_CTRL_MODE BIT(1)
};
#define to_clk_rcg2(_hw) container_of(to_clk_regmap(_hw), struct clk_rcg2, clkr)

View File

@ -419,6 +419,9 @@ static int __clk_rcg2_configure(struct clk_rcg2 *rcg, const struct freq_tbl *f)
cfg |= rcg->parent_map[index].cfg << CFG_SRC_SEL_SHIFT;
if (rcg->mnd_width && f->n && (f->m != f->n))
cfg |= CFG_MODE_DUAL_EDGE;
if (rcg->flags & HW_CLK_CTRL_MODE)
cfg |= CFG_HW_CLK_CTRL_MASK;
return regmap_update_bits(rcg->clkr.regmap, RCG_CFG_OFFSET(rcg),
mask, cfg);
}