Lines Matching refs:bcm

68 static void bcm_aggregate(struct qcom_icc_bcm *bcm)  in bcm_aggregate()  argument
77 for (i = 0; i < bcm->num_nodes; i++) { in bcm_aggregate()
78 node = bcm->nodes[i]; in bcm_aggregate()
79 temp = bcm_div(node->sum_avg[bucket] * bcm->aux_data.width, in bcm_aggregate()
83 temp = bcm_div(node->max_peak[bucket] * bcm->aux_data.width, in bcm_aggregate()
88 temp = agg_avg[bucket] * bcm->vote_scale; in bcm_aggregate()
89 bcm->vote_x[bucket] = bcm_div(temp, bcm->aux_data.unit); in bcm_aggregate()
91 temp = agg_peak[bucket] * bcm->vote_scale; in bcm_aggregate()
92 bcm->vote_y[bucket] = bcm_div(temp, bcm->aux_data.unit); in bcm_aggregate()
95 if (bcm->keepalive && bcm->vote_x[QCOM_ICC_BUCKET_AMC] == 0 && in bcm_aggregate()
96 bcm->vote_y[QCOM_ICC_BUCKET_AMC] == 0) { in bcm_aggregate()
97 bcm->vote_x[QCOM_ICC_BUCKET_AMC] = 1; in bcm_aggregate()
98 bcm->vote_x[QCOM_ICC_BUCKET_WAKE] = 1; in bcm_aggregate()
99 bcm->vote_y[QCOM_ICC_BUCKET_AMC] = 1; in bcm_aggregate()
100 bcm->vote_y[QCOM_ICC_BUCKET_WAKE] = 1; in bcm_aggregate()
138 struct qcom_icc_bcm *bcm; in tcs_list_gen() local
144 list_for_each_entry(bcm, bcm_list, list) { in tcs_list_gen()
147 if ((list_is_last(&bcm->list, bcm_list)) || in tcs_list_gen()
148 bcm->aux_data.vcd != list_next_entry(bcm, list)->aux_data.vcd) { in tcs_list_gen()
155 tcs_cmd_gen(&tcs_list[idx], bcm->vote_x[bucket], in tcs_list_gen()
156 bcm->vote_y[bucket], bcm->addr, commit, wait); in tcs_list_gen()
224 void qcom_icc_bcm_voter_add(struct bcm_voter *voter, struct qcom_icc_bcm *bcm) in qcom_icc_bcm_voter_add() argument
230 if (list_empty(&bcm->list)) in qcom_icc_bcm_voter_add()
231 list_add_tail(&bcm->list, &voter->commit_list); in qcom_icc_bcm_voter_add()
233 if (list_empty(&bcm->ws_list)) in qcom_icc_bcm_voter_add()
234 list_add_tail(&bcm->ws_list, &voter->ws_list); in qcom_icc_bcm_voter_add()
254 struct qcom_icc_bcm *bcm; in qcom_icc_bcm_voter_commit() local
264 list_for_each_entry(bcm, &voter->commit_list, list) in qcom_icc_bcm_voter_commit()
265 bcm_aggregate(bcm); in qcom_icc_bcm_voter_commit()
294 list_for_each_entry_safe(bcm, bcm_tmp, &voter->commit_list, list) in qcom_icc_bcm_voter_commit()
295 list_del_init(&bcm->list); in qcom_icc_bcm_voter_commit()
297 list_for_each_entry_safe(bcm, bcm_tmp, &voter->ws_list, ws_list) { in qcom_icc_bcm_voter_commit()
303 if (bcm->vote_x[QCOM_ICC_BUCKET_WAKE] != in qcom_icc_bcm_voter_commit()
304 bcm->vote_x[QCOM_ICC_BUCKET_SLEEP] || in qcom_icc_bcm_voter_commit()
305 bcm->vote_y[QCOM_ICC_BUCKET_WAKE] != in qcom_icc_bcm_voter_commit()
306 bcm->vote_y[QCOM_ICC_BUCKET_SLEEP]) in qcom_icc_bcm_voter_commit()
307 list_add_tail(&bcm->list, &voter->commit_list); in qcom_icc_bcm_voter_commit()
309 list_del_init(&bcm->ws_list); in qcom_icc_bcm_voter_commit()
334 list_for_each_entry_safe(bcm, bcm_tmp, &voter->commit_list, list) in qcom_icc_bcm_voter_commit()
335 list_del_init(&bcm->list); in qcom_icc_bcm_voter_commit()