mirror of
https://github.com/torvalds/linux.git
synced 2026-07-31 03:27:03 +02:00
interconnect: qcom: icc-rpmh: Implement stub handling
Skip bcm init and implement stubs for icc apis when stub property is defined. Change-Id: Ic56a75578b6fa4fe35bebaf103d41205e444efed Signed-off-by: Vivek Aknurwar <viveka@codeaurora.org>
This commit is contained in:
parent
bdebb74665
commit
bc2e1198cc
|
|
@ -263,6 +263,8 @@ int qcom_icc_rpmh_probe(struct platform_device *pdev)
|
|||
if (!data)
|
||||
return -ENOMEM;
|
||||
|
||||
qp->stub = of_property_read_bool(pdev->dev.of_node, "qcom,stub");
|
||||
|
||||
provider = &qp->provider;
|
||||
provider->dev = dev;
|
||||
provider->set = qcom_icc_set_stub;
|
||||
|
|
@ -275,19 +277,22 @@ int qcom_icc_rpmh_probe(struct platform_device *pdev)
|
|||
|
||||
qp->dev = dev;
|
||||
qp->bcms = desc->bcms;
|
||||
qp->num_bcms = desc->num_bcms;
|
||||
|
||||
qp->num_voters = desc->num_voters;
|
||||
qp->voters = devm_kcalloc(&pdev->dev, qp->num_voters,
|
||||
sizeof(*qp->voters), GFP_KERNEL);
|
||||
if (!qp->stub) {
|
||||
qp->num_bcms = desc->num_bcms;
|
||||
qp->num_voters = desc->num_voters;
|
||||
|
||||
if (!qp->voters)
|
||||
return -ENOMEM;
|
||||
qp->voters = devm_kcalloc(&pdev->dev, qp->num_voters,
|
||||
sizeof(*qp->voters), GFP_KERNEL);
|
||||
|
||||
for (i = 0; i < qp->num_voters; i++) {
|
||||
qp->voters[i] = of_bcm_voter_get(qp->dev, desc->voters[i]);
|
||||
if (IS_ERR(qp->voters[i]))
|
||||
return PTR_ERR(qp->voters[i]);
|
||||
if (!qp->voters)
|
||||
return -ENOMEM;
|
||||
|
||||
for (i = 0; i < qp->num_voters; i++) {
|
||||
qp->voters[i] = of_bcm_voter_get(qp->dev, desc->voters[i]);
|
||||
if (IS_ERR(qp->voters[i]))
|
||||
return PTR_ERR(qp->voters[i]);
|
||||
}
|
||||
}
|
||||
|
||||
qp->regmap = qcom_icc_rpmh_map(pdev, desc);
|
||||
|
|
@ -340,8 +345,10 @@ int qcom_icc_rpmh_probe(struct platform_device *pdev)
|
|||
data->num_nodes = num_nodes;
|
||||
platform_set_drvdata(pdev, qp);
|
||||
|
||||
provider->set = qcom_icc_set;
|
||||
provider->aggregate = qcom_icc_aggregate;
|
||||
if (!qp->stub) {
|
||||
provider->set = qcom_icc_set;
|
||||
provider->aggregate = qcom_icc_aggregate;
|
||||
}
|
||||
|
||||
qcom_icc_debug_register(provider);
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ struct qcom_icc_provider {
|
|||
int num_clks;
|
||||
struct bcm_voter **voters;
|
||||
size_t num_voters;
|
||||
bool stub;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user