mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
interconnect: qcom: icc-rpmh: Get parent's regmap for nested NoCs
Since commit 57eb14779d ("interconnect: qcom: icc-rpmh: Support child
NoC device probe") the icc-rpmh driver supports initializing child NoCs,
but those child NoCs also need to be able to get the parent's regmap in
order to enable QoS.
Change the driver to support that and support programming QoS register.
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20251114-sm6350-icc-qos-v2-2-6af348cb9c69@fairphone.com
Signed-off-by: Georgi Djakov <djakov@kernel.org>
This commit is contained in:
committed by
Georgi Djakov
parent
dfb1717308
commit
b56fb8aa66
@@ -308,14 +308,19 @@ int qcom_icc_rpmh_probe(struct platform_device *pdev)
|
||||
struct resource *res;
|
||||
void __iomem *base;
|
||||
|
||||
base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
|
||||
if (IS_ERR(base))
|
||||
goto skip_qos_config;
|
||||
/* Try parent's regmap first */
|
||||
qp->regmap = dev_get_regmap(dev->parent, NULL);
|
||||
if (!qp->regmap) {
|
||||
base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
|
||||
if (IS_ERR(base))
|
||||
goto skip_qos_config;
|
||||
|
||||
qp->regmap = devm_regmap_init_mmio(dev, base, desc->config);
|
||||
if (IS_ERR(qp->regmap)) {
|
||||
dev_info(dev, "Skipping QoS, regmap failed; %ld\n", PTR_ERR(qp->regmap));
|
||||
goto skip_qos_config;
|
||||
qp->regmap = devm_regmap_init_mmio(dev, base, desc->config);
|
||||
if (IS_ERR(qp->regmap)) {
|
||||
dev_info(dev, "Skipping QoS, regmap failed; %ld\n",
|
||||
PTR_ERR(qp->regmap));
|
||||
goto skip_qos_config;
|
||||
}
|
||||
}
|
||||
|
||||
qp->num_clks = devm_clk_bulk_get_all(qp->dev, &qp->clks);
|
||||
|
||||
Reference in New Issue
Block a user