Lines Matching refs:bcm
16 #include "bcm-voter.h"
25 * @np: reference to the device node to match bcm voters
29 * @voter_node: list of bcm voters
68 static void bcm_aggregate(struct qcom_icc_bcm *bcm)
77 for (i = 0; i < bcm->num_nodes; i++) {
78 node = bcm->nodes[i];
79 temp = bcm_div(node->sum_avg[bucket] * bcm->aux_data.width,
83 temp = bcm_div(node->max_peak[bucket] * bcm->aux_data.width,
88 temp = agg_avg[bucket] * bcm->vote_scale;
89 bcm->vote_x[bucket] = bcm_div(temp, bcm->aux_data.unit);
91 temp = agg_peak[bucket] * bcm->vote_scale;
92 bcm->vote_y[bucket] = bcm_div(temp, bcm->aux_data.unit);
94 if (bcm->enable_mask && (bcm->vote_x[bucket] || bcm->vote_y[bucket])) {
95 bcm->vote_x[bucket] = 0;
96 bcm->vote_y[bucket] = bcm->enable_mask;
100 if (bcm->keepalive && bcm->vote_x[QCOM_ICC_BUCKET_AMC] == 0 &&
101 bcm->vote_y[QCOM_ICC_BUCKET_AMC] == 0) {
102 bcm->vote_x[QCOM_ICC_BUCKET_AMC] = 1;
103 bcm->vote_x[QCOM_ICC_BUCKET_WAKE] = 1;
104 bcm->vote_y[QCOM_ICC_BUCKET_AMC] = 1;
105 bcm->vote_y[QCOM_ICC_BUCKET_WAKE] = 1;
143 struct qcom_icc_bcm *bcm;
149 list_for_each_entry(bcm, bcm_list, list) {
152 if ((list_is_last(&bcm->list, bcm_list)) ||
153 bcm->aux_data.vcd != list_next_entry(bcm, list)->aux_data.vcd) {
160 tcs_cmd_gen(&tcs_list[idx], bcm->vote_x[bucket],
161 bcm->vote_y[bucket], bcm->addr, commit, wait);
181 * of_bcm_voter_get - gets a bcm voter handle from DT node
183 * @name: name for the bcm voter device
189 * when matching bcm voter is yet to be found.
204 idx = of_property_match_string(np, "qcom,bcm-voter-names", name);
209 node = of_parse_phandle(np, "qcom,bcm-voters", idx);
226 * qcom_icc_bcm_voter_add - queues up the bcm nodes that require updates
228 * @bcm: bcm to add to the commit and wake sleep list
230 void qcom_icc_bcm_voter_add(struct bcm_voter *voter, struct qcom_icc_bcm *bcm)
236 if (list_empty(&bcm->list))
237 list_add_tail(&bcm->list, &voter->commit_list);
239 if (list_empty(&bcm->ws_list))
240 list_add_tail(&bcm->ws_list, &voter->ws_list);
253 * through multiple commit requests and bcm nodes are removed only when the
260 struct qcom_icc_bcm *bcm;
270 list_for_each_entry(bcm, &voter->commit_list, list)
271 bcm_aggregate(bcm);
300 list_for_each_entry_safe(bcm, bcm_tmp, &voter->commit_list, list)
301 list_del_init(&bcm->list);
303 list_for_each_entry_safe(bcm, bcm_tmp, &voter->ws_list, ws_list) {
309 if (bcm->vote_x[QCOM_ICC_BUCKET_WAKE] !=
310 bcm->vote_x[QCOM_ICC_BUCKET_SLEEP] ||
311 bcm->vote_y[QCOM_ICC_BUCKET_WAKE] !=
312 bcm->vote_y[QCOM_ICC_BUCKET_SLEEP])
313 list_add_tail(&bcm->list, &voter->commit_list);
315 list_del_init(&bcm->ws_list);
340 list_for_each_entry_safe(bcm, bcm_tmp, &voter->commit_list, list)
341 list_del_init(&bcm->list);
375 { .compatible = "qcom,bcm-voter" },