Lines Matching refs:bcm
61 static void bcm_aggregate(struct qcom_icc_bcm *bcm) in bcm_aggregate() argument
70 for (i = 0; i < bcm->num_nodes; i++) { in bcm_aggregate()
71 node = bcm->nodes[i]; in bcm_aggregate()
72 temp = bcm_div(node->sum_avg[bucket] * bcm->aux_data.width, in bcm_aggregate()
76 temp = bcm_div(node->max_peak[bucket] * bcm->aux_data.width, in bcm_aggregate()
81 temp = agg_avg[bucket] * bcm->vote_scale; in bcm_aggregate()
82 bcm->vote_x[bucket] = bcm_div(temp, bcm->aux_data.unit); in bcm_aggregate()
84 temp = agg_peak[bucket] * bcm->vote_scale; in bcm_aggregate()
85 bcm->vote_y[bucket] = bcm_div(temp, bcm->aux_data.unit); in bcm_aggregate()
88 if (bcm->keepalive && bcm->vote_x[QCOM_ICC_BUCKET_AMC] == 0 && in bcm_aggregate()
89 bcm->vote_y[QCOM_ICC_BUCKET_AMC] == 0) { in bcm_aggregate()
90 bcm->vote_x[QCOM_ICC_BUCKET_AMC] = 1; in bcm_aggregate()
91 bcm->vote_x[QCOM_ICC_BUCKET_WAKE] = 1; in bcm_aggregate()
92 bcm->vote_y[QCOM_ICC_BUCKET_AMC] = 1; in bcm_aggregate()
93 bcm->vote_y[QCOM_ICC_BUCKET_WAKE] = 1; in bcm_aggregate()
131 struct qcom_icc_bcm *bcm; in tcs_list_gen() local
137 list_for_each_entry(bcm, bcm_list, list) { in tcs_list_gen()
140 if ((list_is_last(&bcm->list, bcm_list)) || in tcs_list_gen()
141 bcm->aux_data.vcd != list_next_entry(bcm, list)->aux_data.vcd) { in tcs_list_gen()
148 tcs_cmd_gen(&tcs_list[idx], bcm->vote_x[bucket], in tcs_list_gen()
149 bcm->vote_y[bucket], bcm->addr, commit, wait); in tcs_list_gen()
218 void qcom_icc_bcm_voter_add(struct bcm_voter *voter, struct qcom_icc_bcm *bcm) in qcom_icc_bcm_voter_add() argument
224 if (list_empty(&bcm->list)) in qcom_icc_bcm_voter_add()
225 list_add_tail(&bcm->list, &voter->commit_list); in qcom_icc_bcm_voter_add()
227 if (list_empty(&bcm->ws_list)) in qcom_icc_bcm_voter_add()
228 list_add_tail(&bcm->ws_list, &voter->ws_list); in qcom_icc_bcm_voter_add()
248 struct qcom_icc_bcm *bcm; in qcom_icc_bcm_voter_commit() local
258 list_for_each_entry(bcm, &voter->commit_list, list) in qcom_icc_bcm_voter_commit()
259 bcm_aggregate(bcm); in qcom_icc_bcm_voter_commit()
288 list_for_each_entry_safe(bcm, bcm_tmp, &voter->commit_list, list) in qcom_icc_bcm_voter_commit()
289 list_del_init(&bcm->list); in qcom_icc_bcm_voter_commit()
291 list_for_each_entry_safe(bcm, bcm_tmp, &voter->ws_list, ws_list) { in qcom_icc_bcm_voter_commit()
297 if (bcm->vote_x[QCOM_ICC_BUCKET_WAKE] != in qcom_icc_bcm_voter_commit()
298 bcm->vote_x[QCOM_ICC_BUCKET_SLEEP] || in qcom_icc_bcm_voter_commit()
299 bcm->vote_y[QCOM_ICC_BUCKET_WAKE] != in qcom_icc_bcm_voter_commit()
300 bcm->vote_y[QCOM_ICC_BUCKET_SLEEP]) in qcom_icc_bcm_voter_commit()
301 list_add_tail(&bcm->list, &voter->commit_list); in qcom_icc_bcm_voter_commit()
303 list_del_init(&bcm->ws_list); in qcom_icc_bcm_voter_commit()
328 list_for_each_entry_safe(bcm, bcm_tmp, &voter->commit_list, list) in qcom_icc_bcm_voter_commit()
329 list_del_init(&bcm->list); in qcom_icc_bcm_voter_commit()