Skip to content

Commit 6caa307

Browse files
author
Georgi Djakov
committed
interconnect: qcom: Implement xlate_extended() to parse tags
Implement a function to parse the arguments of the "interconnects" DT property and populate the interconnect path tags if this information is available. Tested-by: Sibi Sankar <sibis@codeaurora.org> Reviewed-by: Sibi Sankar <sibis@codeaurora.org> Link: https://lore.kernel.org/r/20200903133134.17201-4-georgi.djakov@linaro.org Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
1 parent 9a34e7a commit 6caa307

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

drivers/interconnect/qcom/icc-rpmh.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#include <linux/interconnect.h>
77
#include <linux/interconnect-provider.h>
88
#include <linux/module.h>
9+
#include <linux/of.h>
10+
#include <linux/slab.h>
911

1012
#include "bcm-voter.h"
1113
#include "icc-rpmh.h"
@@ -92,6 +94,31 @@ int qcom_icc_set(struct icc_node *src, struct icc_node *dst)
9294
}
9395
EXPORT_SYMBOL_GPL(qcom_icc_set);
9496

97+
struct icc_node_data *qcom_icc_xlate_extended(struct of_phandle_args *spec, void *data)
98+
{
99+
struct icc_node_data *ndata;
100+
struct icc_node *node;
101+
102+
node = of_icc_xlate_onecell(spec, data);
103+
if (IS_ERR(node))
104+
return ERR_CAST(node);
105+
106+
ndata = kzalloc(sizeof(*ndata), GFP_KERNEL);
107+
if (!ndata)
108+
return ERR_PTR(-ENOMEM);
109+
110+
ndata->node = node;
111+
112+
if (spec->args_count == 2)
113+
ndata->tag = spec->args[1];
114+
115+
if (spec->args_count > 2)
116+
pr_warn("%pOF: Too many arguments, path tag is not parsed\n", spec->np);
117+
118+
return ndata;
119+
}
120+
EXPORT_SYMBOL_GPL(qcom_icc_xlate_extended);
121+
95122
/**
96123
* qcom_icc_bcm_init - populates bcm aux data and connect qnodes
97124
* @bcm: bcm to be initialized

drivers/interconnect/qcom/icc-rpmh.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ struct qcom_icc_desc {
131131
int qcom_icc_aggregate(struct icc_node *node, u32 tag, u32 avg_bw,
132132
u32 peak_bw, u32 *agg_avg, u32 *agg_peak);
133133
int qcom_icc_set(struct icc_node *src, struct icc_node *dst);
134+
struct icc_node_data *qcom_icc_xlate_extended(struct of_phandle_args *spec, void *data);
134135
int qcom_icc_bcm_init(struct qcom_icc_bcm *bcm, struct device *dev);
135136
void qcom_icc_pre_aggregate(struct icc_node *node);
136137

0 commit comments

Comments
 (0)