Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+28
+27
drivers/interconnect/qcom/icc-rpmh.c
··· 6 6 #include <linux/interconnect.h> 7 7 #include <linux/interconnect-provider.h> 8 8 #include <linux/module.h> 9 + #include <linux/of.h> 10 + #include <linux/slab.h> 9 11 10 12 #include "bcm-voter.h" 11 13 #include "icc-rpmh.h" ··· 93 91 return 0; 94 92 } 95 93 EXPORT_SYMBOL_GPL(qcom_icc_set); 94 + 95 + struct icc_node_data *qcom_icc_xlate_extended(struct of_phandle_args *spec, void *data) 96 + { 97 + struct icc_node_data *ndata; 98 + struct icc_node *node; 99 + 100 + node = of_icc_xlate_onecell(spec, data); 101 + if (IS_ERR(node)) 102 + return ERR_CAST(node); 103 + 104 + ndata = kzalloc(sizeof(*ndata), GFP_KERNEL); 105 + if (!ndata) 106 + return ERR_PTR(-ENOMEM); 107 + 108 + ndata->node = node; 109 + 110 + if (spec->args_count == 2) 111 + ndata->tag = spec->args[1]; 112 + 113 + if (spec->args_count > 2) 114 + pr_warn("%pOF: Too many arguments, path tag is not parsed\n", spec->np); 115 + 116 + return ndata; 117 + } 118 + EXPORT_SYMBOL_GPL(qcom_icc_xlate_extended); 96 119 97 120 /** 98 121 * qcom_icc_bcm_init - populates bcm aux data and connect qnodes
+1
drivers/interconnect/qcom/icc-rpmh.h
··· 131 131 int qcom_icc_aggregate(struct icc_node *node, u32 tag, u32 avg_bw, 132 132 u32 peak_bw, u32 *agg_avg, u32 *agg_peak); 133 133 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); 134 135 int qcom_icc_bcm_init(struct qcom_icc_bcm *bcm, struct device *dev); 135 136 void qcom_icc_pre_aggregate(struct icc_node *node); 136 137