Skip to content

Commit f45b94f

Browse files
quic-varadaandersson
authored andcommitted
interconnect: icc-clk: Specify master/slave ids
Presently, icc-clk driver autogenerates the master and slave ids. However, devices with multiple nodes on the interconnect could have other constraints and may not match with the auto generated node ids. Hence, modify the driver to use the master/slave ids provided by the caller instead of auto generating. Also, update clk-cbf-8996 accordingly. Acked-by: Georgi Djakov <[email protected]> Signed-off-by: Varadarajan Narayanan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
1 parent b3d57c5 commit f45b94f

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

drivers/clk/qcom/clk-cbf-8996.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,12 @@ static int qcom_msm8996_cbf_icc_register(struct platform_device *pdev, struct cl
226226
struct device *dev = &pdev->dev;
227227
struct clk *clk = devm_clk_hw_get_clk(dev, cbf_hw, "cbf");
228228
const struct icc_clk_data data[] = {
229-
{ .clk = clk, .name = "cbf", },
229+
{
230+
.clk = clk,
231+
.name = "cbf",
232+
.master_id = MASTER_CBF_M4M,
233+
.slave_id = SLAVE_CBF_M4M,
234+
},
230235
};
231236
struct icc_provider *provider;
232237

drivers/interconnect/icc-clk.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ struct icc_provider *icc_clk_register(struct device *dev,
108108
for (i = 0, j = 0; i < num_clocks; i++) {
109109
qp->clocks[i].clk = data[i].clk;
110110

111-
node = icc_node_create(first_id + j);
111+
node = icc_node_create(first_id + data[i].master_id);
112112
if (IS_ERR(node)) {
113113
ret = PTR_ERR(node);
114114
goto err;
@@ -118,10 +118,10 @@ struct icc_provider *icc_clk_register(struct device *dev,
118118
node->data = &qp->clocks[i];
119119
icc_node_add(node, provider);
120120
/* link to the next node, slave */
121-
icc_link_create(node, first_id + j + 1);
121+
icc_link_create(node, first_id + data[i].slave_id);
122122
onecell->nodes[j++] = node;
123123

124-
node = icc_node_create(first_id + j);
124+
node = icc_node_create(first_id + data[i].slave_id);
125125
if (IS_ERR(node)) {
126126
ret = PTR_ERR(node);
127127
goto err;

include/linux/interconnect-clk.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ struct device;
1111
struct icc_clk_data {
1212
struct clk *clk;
1313
const char *name;
14+
unsigned int master_id;
15+
unsigned int slave_id;
1416
};
1517

1618
struct icc_provider *icc_clk_register(struct device *dev,

0 commit comments

Comments
 (0)