static void prcmu_clk_disable(struct clk *clk) { if (prcmu_request_clock(clk->cg_sel, false)) { pr_err("clock: %s failed to disable %s.\n", __func__, clk->name); } }
static int clk_prcmu_opp_prepare(struct clk_hw *hw) { int err; struct clk_prcmu *clk = to_clk_prcmu(hw); if (!clk->opp_requested) { err = prcmu_qos_add_requirement(PRCMU_QOS_APE_OPP, (char *)__clk_get_name(hw->clk), 100); if (err) { pr_err("clk_prcmu: %s fail req APE OPP for %s.\n", __func__, __clk_get_name(hw->clk)); return err; } clk->opp_requested = 1; } err = prcmu_request_clock(clk->cg_sel, true); if (err) { prcmu_qos_remove_requirement(PRCMU_QOS_APE_OPP, (char *)__clk_get_name(hw->clk)); clk->opp_requested = 0; return err; } clk->is_prepared = 1; return 0; }
static int clk_prcmu_opp_volt_prepare(struct clk_hw *hw) { int err; struct clk_prcmu *clk = to_clk_prcmu(hw); if (!clk->opp_requested) { err = prcmu_request_ape_opp_100_voltage(true); if (err) { pr_err("clk_prcmu: %s fail req APE OPP VOLT for %s.\n", __func__, __clk_get_name(hw->clk)); return err; } clk->opp_requested = 1; } err = prcmu_request_clock(clk->cg_sel, true); if (err) { prcmu_request_ape_opp_100_voltage(false); clk->opp_requested = 0; return err; } clk->is_prepared = 1; return 0; }
static int request_sysclk(bool enable) { static int requests; if ((enable && (requests++ == 0)) || (!enable && (--requests == 0))) return prcmu_request_clock(PRCMU_SYSCLK, enable); return 0; }
static void clk_prcmu_unprepare(struct clk_hw *hw) { struct clk_prcmu *clk = to_clk_prcmu(hw); if (prcmu_request_clock(clk->cg_sel, false)) pr_err("clk_prcmu: %s failed to disable %s.\n", __func__, __clk_get_name(hw->clk)); else clk->is_prepared = 0; }
static int clk_prcmu_prepare(struct clk_hw *hw) { int ret; struct clk_prcmu *clk = to_clk_prcmu(hw); ret = prcmu_request_clock(clk->cg_sel, true); if (!ret) clk->is_prepared = 1; return ret; }
static void prcmu_opp100_clk_disable(struct clk *clk) { if (prcmu_request_clock(clk->cg_sel, false)) goto out_error; if (request_ape_opp100(false)) goto out_error; return; out_error: pr_err("clock: %s failed to disable %s.\n", __func__, clk->name); }
static int prcmu_opp100_clk_enable(struct clk *clk) { int r; r = request_ape_opp100(true); if (r) { pr_err("clock: %s failed to request APE OPP 100%% for %s.\n", __func__, clk->name); return r; } return prcmu_request_clock(clk->cg_sel, true); }
static void clk_prcmu_opp_volt_unprepare(struct clk_hw *hw) { struct clk_prcmu *clk = to_clk_prcmu(hw); if (prcmu_request_clock(clk->cg_sel, false)) { pr_err("clk_prcmu: %s failed to disable %s.\n", __func__, __clk_get_name(hw->clk)); return; } if (clk->opp_requested) { prcmu_request_ape_opp_100_voltage(false); clk->opp_requested = 0; } clk->is_prepared = 0; }
static void clk_prcmu_opp_unprepare(struct clk_hw *hw) { struct clk_prcmu *clk = to_clk_prcmu(hw); if (prcmu_request_clock(clk->cg_sel, false)) { pr_err("clk_prcmu: %s failed to disable %s.\n", __func__, __clk_get_name(hw->clk)); return; } if (clk->opp_requested) { prcmu_qos_remove_requirement(PRCMU_QOS_APE_OPP, (char *)__clk_get_name(hw->clk)); clk->opp_requested = 0; } clk->is_prepared = 0; }
static int prcmu_clk_enable(struct clk *clk) { return prcmu_request_clock(clk->cg_sel, true); }