Lines Matching refs:qrc

75 static int rc_wait_for_update(struct qcom_ramp_controller *qrc)  in rc_wait_for_update()  argument
77 const struct qcom_ramp_controller_desc *d = qrc->desc; in rc_wait_for_update()
78 struct regmap *r = qrc->regmap; in rc_wait_for_update()
97 static int rc_set_cfg_update(struct qcom_ramp_controller *qrc, u8 ce) in rc_set_cfg_update() argument
99 const struct qcom_ramp_controller_desc *d = qrc->desc; in rc_set_cfg_update()
100 struct regmap *r = qrc->regmap; in rc_set_cfg_update()
148 static int rc_write_cfg(struct qcom_ramp_controller *qrc, in rc_write_cfg() argument
156 ret = rc_wait_for_update(qrc); in rc_write_cfg()
161 ret = regmap_multi_reg_write(qrc->regmap, seq, nsids); in rc_write_cfg()
167 ret = rc_set_cfg_update(qrc, (u8)ce - i); in rc_write_cfg()
181 static int rc_ramp_ctrl_enable(struct qcom_ramp_controller *qrc) in rc_ramp_ctrl_enable() argument
183 const struct qcom_ramp_controller_desc *d = qrc->desc; in rc_ramp_ctrl_enable()
187 ret = rc_write_cfg(qrc, &d->cfg_ramp_en[i], RC_DCVS_CFG_SID, 1); in rc_ramp_ctrl_enable()
205 static int qcom_ramp_controller_start(struct qcom_ramp_controller *qrc) in qcom_ramp_controller_start() argument
207 const struct qcom_ramp_controller_desc *d = qrc->desc; in qcom_ramp_controller_start()
211 ret = rc_write_cfg(qrc, d->cfg_lmh_sid, RC_LMH_SID, d->num_lmh_sids); in qcom_ramp_controller_start()
215 ret = rc_write_cfg(qrc, d->cfg_dfs_sid, RC_DFS_SID, d->num_dfs_sids); in qcom_ramp_controller_start()
219 ret = rc_write_cfg(qrc, d->cfg_link_sid, RC_LINK_SID, d->num_link_sids); in qcom_ramp_controller_start()
224 return rc_ramp_ctrl_enable(qrc); in qcom_ramp_controller_start()
286 struct qcom_ramp_controller *qrc; in qcom_ramp_controller_probe() local
293 qrc = devm_kmalloc(&pdev->dev, sizeof(*qrc), GFP_KERNEL); in qcom_ramp_controller_probe()
294 if (!qrc) in qcom_ramp_controller_probe()
297 qrc->desc = device_get_match_data(&pdev->dev); in qcom_ramp_controller_probe()
298 if (!qrc->desc) in qcom_ramp_controller_probe()
301 qrc->regmap = devm_regmap_init_mmio(&pdev->dev, base, &qrc_regmap_config); in qcom_ramp_controller_probe()
302 if (IS_ERR(qrc->regmap)) in qcom_ramp_controller_probe()
303 return PTR_ERR(qrc->regmap); in qcom_ramp_controller_probe()
305 platform_set_drvdata(pdev, qrc); in qcom_ramp_controller_probe()
307 return qcom_ramp_controller_start(qrc); in qcom_ramp_controller_probe()
312 struct qcom_ramp_controller *qrc = platform_get_drvdata(pdev); in qcom_ramp_controller_remove() local
315 ret = rc_write_cfg(qrc, qrc->desc->cfg_ramp_dis, in qcom_ramp_controller_remove()
316 RC_DCVS_CFG_SID, qrc->desc->num_ramp_dis); in qcom_ramp_controller_remove()