drivers/interconnect/qcom/icc-rpmh.c
Source file repositories/reference/linux-study-clean/drivers/interconnect/qcom/icc-rpmh.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/interconnect/qcom/icc-rpmh.c- Extension
.c- Size
- 9073 bytes
- Lines
- 376
- Domain
- Driver Families
- Bucket
- drivers/interconnect
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bitfield.hlinux/clk.hlinux/interconnect.hlinux/interconnect-provider.hlinux/module.hlinux/of.hlinux/of_platform.hlinux/slab.hbcm-voter.hicc-common.hicc-rpmh.h
Detected Declarations
function Copyrightfunction qcom_icc_pre_aggregatefunction qcom_icc_aggregatefunction qcom_icc_setfunction qcom_icc_bcm_initfunction qcom_icc_rpmh_configure_qosfunction qcom_icc_rpmh_probefunction qcom_icc_rpmh_removeexport qcom_icc_pre_aggregateexport qcom_icc_aggregateexport qcom_icc_setexport qcom_icc_bcm_initexport qcom_icc_rpmh_probeexport qcom_icc_rpmh_remove
Annotated Snippet
if (tag & BIT(i)) {
qn->sum_avg[i] += avg_bw;
qn->max_peak[i] = max_t(u32, qn->max_peak[i], peak_bw);
}
if (node->init_avg || node->init_peak) {
qn->sum_avg[i] = max_t(u64, qn->sum_avg[i], node->init_avg);
qn->max_peak[i] = max_t(u64, qn->max_peak[i], node->init_peak);
}
}
*agg_avg += avg_bw;
*agg_peak = max_t(u32, *agg_peak, peak_bw);
return 0;
}
EXPORT_SYMBOL_GPL(qcom_icc_aggregate);
/**
* qcom_icc_set - set the constraints based on path
* @src: source node for the path to set constraints on
* @dst: destination node for the path to set constraints on
*
* Return: 0 on success, or an error code otherwise
*/
int qcom_icc_set(struct icc_node *src, struct icc_node *dst)
{
struct qcom_icc_provider *qp;
struct icc_node *node;
if (!src)
node = dst;
else
node = src;
qp = to_qcom_provider(node->provider);
qcom_icc_bcm_voter_commit(qp->voter);
return 0;
}
EXPORT_SYMBOL_GPL(qcom_icc_set);
/**
* qcom_icc_bcm_init - populates bcm aux data and connect qnodes
* @bcm: bcm to be initialized
* @dev: associated provider device
*
* Return: 0 on success, or an error code otherwise
*/
int qcom_icc_bcm_init(struct qcom_icc_bcm *bcm, struct device *dev)
{
struct qcom_icc_node *qn;
const struct bcm_db *data;
size_t data_count;
int i;
/* BCM is already initialised*/
if (bcm->addr)
return 0;
bcm->addr = cmd_db_read_addr(bcm->name);
if (!bcm->addr) {
dev_err(dev, "%s could not find RPMh address\n",
bcm->name);
return -EINVAL;
}
data = cmd_db_read_aux_data(bcm->name, &data_count);
if (IS_ERR(data)) {
dev_err(dev, "%s command db read error (%ld)\n",
bcm->name, PTR_ERR(data));
return PTR_ERR(data);
}
if (!data_count) {
dev_err(dev, "%s command db missing or partial aux data\n",
bcm->name);
return -EINVAL;
}
bcm->aux_data.unit = le32_to_cpu(data->unit);
bcm->aux_data.width = le16_to_cpu(data->width);
bcm->aux_data.vcd = data->vcd;
bcm->aux_data.reserved = data->reserved;
INIT_LIST_HEAD(&bcm->list);
INIT_LIST_HEAD(&bcm->ws_list);
if (!bcm->vote_scale)
bcm->vote_scale = 1000;
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/clk.h`, `linux/interconnect.h`, `linux/interconnect-provider.h`, `linux/module.h`, `linux/of.h`, `linux/of_platform.h`, `linux/slab.h`.
- Detected declarations: `function Copyright`, `function qcom_icc_pre_aggregate`, `function qcom_icc_aggregate`, `function qcom_icc_set`, `function qcom_icc_bcm_init`, `function qcom_icc_rpmh_configure_qos`, `function qcom_icc_rpmh_probe`, `function qcom_icc_rpmh_remove`, `export qcom_icc_pre_aggregate`, `export qcom_icc_aggregate`.
- Atlas domain: Driver Families / drivers/interconnect.
- Implementation status: integration implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.