Lines Matching +full:bcm +full:- +full:voter

1 // SPDX-License-Identifier: GPL-2.0
7 #include <linux/interconnect-provider.h>
12 #include "bcm-voter.h"
13 #include "icc-rpmh.h"
16 * qcom_icc_pre_aggregate - cleans up stale values from prior icc_set
24 qn = node->data; in qcom_icc_pre_aggregate()
27 qn->sum_avg[i] = 0; in qcom_icc_pre_aggregate()
28 qn->max_peak[i] = 0; in qcom_icc_pre_aggregate()
34 * qcom_icc_aggregate - aggregate bw for buckets indicated by tag
49 qn = node->data; in qcom_icc_aggregate()
50 qp = to_qcom_provider(node->provider); in qcom_icc_aggregate()
57 qn->sum_avg[i] += avg_bw; in qcom_icc_aggregate()
58 qn->max_peak[i] = max_t(u32, qn->max_peak[i], peak_bw); in qcom_icc_aggregate()
65 for (i = 0; i < qn->num_bcms; i++) in qcom_icc_aggregate()
66 qcom_icc_bcm_voter_add(qp->voter, qn->bcms[i]); in qcom_icc_aggregate()
73 * qcom_icc_set - set the constraints based on path
90 qp = to_qcom_provider(node->provider); in qcom_icc_set()
91 qn = node->data; in qcom_icc_set()
93 qn->sum_avg[QCOM_ICC_BUCKET_AMC] = max_t(u64, qn->sum_avg[QCOM_ICC_BUCKET_AMC], in qcom_icc_set()
94 node->avg_bw); in qcom_icc_set()
95 qn->max_peak[QCOM_ICC_BUCKET_AMC] = max_t(u64, qn->max_peak[QCOM_ICC_BUCKET_AMC], in qcom_icc_set()
96 node->peak_bw); in qcom_icc_set()
98 qcom_icc_bcm_voter_commit(qp->voter); in qcom_icc_set()
115 return ERR_PTR(-ENOMEM); in qcom_icc_xlate_extended()
117 ndata->node = node; in qcom_icc_xlate_extended()
119 if (spec->args_count == 2) in qcom_icc_xlate_extended()
120 ndata->tag = spec->args[1]; in qcom_icc_xlate_extended()
122 if (spec->args_count > 2) in qcom_icc_xlate_extended()
123 pr_warn("%pOF: Too many arguments, path tag is not parsed\n", spec->np); in qcom_icc_xlate_extended()
130 * qcom_icc_bcm_init - populates bcm aux data and connect qnodes
131 * @bcm: bcm to be initialized
136 int qcom_icc_bcm_init(struct qcom_icc_bcm *bcm, struct device *dev) in qcom_icc_bcm_init() argument
143 /* BCM is already initialised*/ in qcom_icc_bcm_init()
144 if (bcm->addr) in qcom_icc_bcm_init()
147 bcm->addr = cmd_db_read_addr(bcm->name); in qcom_icc_bcm_init()
148 if (!bcm->addr) { in qcom_icc_bcm_init()
150 bcm->name); in qcom_icc_bcm_init()
151 return -EINVAL; in qcom_icc_bcm_init()
154 data = cmd_db_read_aux_data(bcm->name, &data_count); in qcom_icc_bcm_init()
157 bcm->name, PTR_ERR(data)); in qcom_icc_bcm_init()
162 bcm->name); in qcom_icc_bcm_init()
163 return -EINVAL; in qcom_icc_bcm_init()
166 bcm->aux_data.unit = le32_to_cpu(data->unit); in qcom_icc_bcm_init()
167 bcm->aux_data.width = le16_to_cpu(data->width); in qcom_icc_bcm_init()
168 bcm->aux_data.vcd = data->vcd; in qcom_icc_bcm_init()
169 bcm->aux_data.reserved = data->reserved; in qcom_icc_bcm_init()
170 INIT_LIST_HEAD(&bcm->list); in qcom_icc_bcm_init()
171 INIT_LIST_HEAD(&bcm->ws_list); in qcom_icc_bcm_init()
173 if (!bcm->vote_scale) in qcom_icc_bcm_init()
174 bcm->vote_scale = 1000; in qcom_icc_bcm_init()
177 for (i = 0; i < bcm->num_nodes; i++) { in qcom_icc_bcm_init()
178 qn = bcm->nodes[i]; in qcom_icc_bcm_init()
179 qn->bcms[qn->num_bcms] = bcm; in qcom_icc_bcm_init()
180 qn->num_bcms++; in qcom_icc_bcm_init()