Skip to content

Commit 691a018

Browse files
committed
Merge tag 'qcom-clk-for-6.11-2' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into clk-qcom
Pull more qcom clk driver updates from Bjorn Andersson: - Introduces helper logic to expose clock controllers as simple interconnect providers - Use the interconnect helper above on Qualcomm ipq9574 - Add CLK_SET_RATE_PARENT to the remaining USB pipe clocks on Qualcomm X1Elite. - Improve error handling in Qualcomm kpss-xcc driver - Mark Qualcomm SC8280XP LPASS clock controller regmap_config const * tag 'qcom-clk-for-6.11-2' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: clk: qcom: ipq9574: Use icc-clk for enabling NoC related clocks clk: qcom: common: Add interconnect clocks support interconnect: icc-clk: Add devm_icc_clk_register interconnect: icc-clk: Specify master/slave ids dt-bindings: clock: qcom: Add AHB clock for SM8150 clk: qcom: gcc-x1e80100: Set parent rate for USB3 sec and tert PHY pipe clks dt-bindings: interconnect: Add Qualcomm IPQ9574 support clk: qcom: kpss-xcc: Return of_clk_add_hw_provider to transfer the error clk: qcom: lpasscc-sc8280xp: Constify struct regmap_config
2 parents 01a0a6c + 23711ca commit 691a018

File tree

13 files changed

+192
-11
lines changed

13 files changed

+192
-11
lines changed

Documentation/devicetree/bindings/clock/qcom,ipq9574-gcc.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ properties:
3535

3636
'#power-domain-cells': false
3737

38+
'#interconnect-cells':
39+
const: 1
40+
3841
required:
3942
- compatible
4043
- clocks

Documentation/devicetree/bindings/clock/qcom,videocc.yaml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ allOf:
6262
enum:
6363
- qcom,sc7180-videocc
6464
- qcom,sdm845-videocc
65-
- qcom,sm8150-videocc
6665
then:
6766
properties:
6867
clocks:
@@ -88,6 +87,22 @@ allOf:
8887
- const: bi_tcxo
8988
- const: bi_tcxo_ao
9089

90+
- if:
91+
properties:
92+
compatible:
93+
enum:
94+
- qcom,sm8150-videocc
95+
then:
96+
properties:
97+
clocks:
98+
items:
99+
- description: AHB
100+
- description: Board XO source
101+
clock-names:
102+
items:
103+
- const: iface
104+
- const: bi_tcxo
105+
91106
- if:
92107
properties:
93108
compatible:

drivers/clk/qcom/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ menuconfig COMMON_CLK_QCOM
1414
select RATIONAL
1515
select REGMAP_MMIO
1616
select RESET_CONTROLLER
17+
select INTERCONNECT
18+
select INTERCONNECT_CLK
1719

1820
if COMMON_CLK_QCOM
1921

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/clk/qcom/common.c

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <linux/regmap.h>
99
#include <linux/platform_device.h>
1010
#include <linux/clk-provider.h>
11+
#include <linux/interconnect-clk.h>
1112
#include <linux/reset-controller.h>
1213
#include <linux/of.h>
1314

@@ -252,6 +253,38 @@ static struct clk_hw *qcom_cc_clk_hw_get(struct of_phandle_args *clkspec,
252253
return cc->rclks[idx] ? &cc->rclks[idx]->hw : NULL;
253254
}
254255

256+
static int qcom_cc_icc_register(struct device *dev,
257+
const struct qcom_cc_desc *desc)
258+
{
259+
struct icc_clk_data *icd;
260+
struct clk_hw *hws;
261+
int i;
262+
263+
if (!IS_ENABLED(CONFIG_INTERCONNECT_CLK))
264+
return 0;
265+
266+
if (!desc->icc_hws)
267+
return 0;
268+
269+
icd = devm_kcalloc(dev, desc->num_icc_hws, sizeof(*icd), GFP_KERNEL);
270+
if (!icd)
271+
return -ENOMEM;
272+
273+
for (i = 0; i < desc->num_icc_hws; i++) {
274+
icd[i].master_id = desc->icc_hws[i].master_id;
275+
icd[i].slave_id = desc->icc_hws[i].slave_id;
276+
hws = &desc->clks[desc->icc_hws[i].clk_id]->hw;
277+
icd[i].clk = devm_clk_hw_get_clk(dev, hws, "icc");
278+
if (!icd[i].clk)
279+
return dev_err_probe(dev, -ENOENT,
280+
"(%d) clock entry is null\n", i);
281+
icd[i].name = clk_hw_get_name(hws);
282+
}
283+
284+
return devm_icc_clk_register(dev, desc->icc_first_node_id,
285+
desc->num_icc_hws, icd);
286+
}
287+
255288
int qcom_cc_really_probe(struct device *dev,
256289
const struct qcom_cc_desc *desc, struct regmap *regmap)
257290
{
@@ -320,7 +353,7 @@ int qcom_cc_really_probe(struct device *dev,
320353
if (ret)
321354
return ret;
322355

323-
return 0;
356+
return qcom_cc_icc_register(dev, desc);
324357
}
325358
EXPORT_SYMBOL_GPL(qcom_cc_really_probe);
326359

drivers/clk/qcom/common.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ struct clk_hw;
1919
#define PLL_VOTE_FSM_ENA BIT(20)
2020
#define PLL_VOTE_FSM_RESET BIT(21)
2121

22+
struct qcom_icc_hws_data {
23+
int master_id;
24+
int slave_id;
25+
int clk_id;
26+
};
27+
2228
struct qcom_cc_desc {
2329
const struct regmap_config *config;
2430
struct clk_regmap **clks;
@@ -29,6 +35,9 @@ struct qcom_cc_desc {
2935
size_t num_gdscs;
3036
struct clk_hw **clk_hws;
3137
size_t num_clk_hws;
38+
struct qcom_icc_hws_data *icc_hws;
39+
size_t num_icc_hws;
40+
unsigned int icc_first_node_id;
3241
};
3342

3443
/**

drivers/clk/qcom/gcc-ipq9574.c

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
*/
55

66
#include <linux/clk-provider.h>
7+
#include <linux/interconnect-clk.h>
8+
#include <linux/interconnect-provider.h>
79
#include <linux/kernel.h>
810
#include <linux/module.h>
911
#include <linux/of.h>
@@ -12,6 +14,7 @@
1214

1315
#include <dt-bindings/clock/qcom,ipq9574-gcc.h>
1416
#include <dt-bindings/reset/qcom,ipq9574-gcc.h>
17+
#include <dt-bindings/interconnect/qcom,ipq9574.h>
1518

1619
#include "clk-alpha-pll.h"
1720
#include "clk-branch.h"
@@ -4377,6 +4380,32 @@ static const struct qcom_reset_map gcc_ipq9574_resets[] = {
43774380
[GCC_WCSS_Q6_TBU_BCR] = { 0x12054, 0 },
43784381
};
43794382

4383+
#define IPQ_APPS_ID 9574 /* some unique value */
4384+
4385+
static struct qcom_icc_hws_data icc_ipq9574_hws[] = {
4386+
{ MASTER_ANOC_PCIE0, SLAVE_ANOC_PCIE0, GCC_ANOC_PCIE0_1LANE_M_CLK },
4387+
{ MASTER_SNOC_PCIE0, SLAVE_SNOC_PCIE0, GCC_SNOC_PCIE0_1LANE_S_CLK },
4388+
{ MASTER_ANOC_PCIE1, SLAVE_ANOC_PCIE1, GCC_ANOC_PCIE1_1LANE_M_CLK },
4389+
{ MASTER_SNOC_PCIE1, SLAVE_SNOC_PCIE1, GCC_SNOC_PCIE1_1LANE_S_CLK },
4390+
{ MASTER_ANOC_PCIE2, SLAVE_ANOC_PCIE2, GCC_ANOC_PCIE2_2LANE_M_CLK },
4391+
{ MASTER_SNOC_PCIE2, SLAVE_SNOC_PCIE2, GCC_SNOC_PCIE2_2LANE_S_CLK },
4392+
{ MASTER_ANOC_PCIE3, SLAVE_ANOC_PCIE3, GCC_ANOC_PCIE3_2LANE_M_CLK },
4393+
{ MASTER_SNOC_PCIE3, SLAVE_SNOC_PCIE3, GCC_SNOC_PCIE3_2LANE_S_CLK },
4394+
{ MASTER_USB, SLAVE_USB, GCC_SNOC_USB_CLK },
4395+
{ MASTER_USB_AXI, SLAVE_USB_AXI, GCC_ANOC_USB_AXI_CLK },
4396+
{ MASTER_NSSNOC_NSSCC, SLAVE_NSSNOC_NSSCC, GCC_NSSNOC_NSSCC_CLK },
4397+
{ MASTER_NSSNOC_SNOC_0, SLAVE_NSSNOC_SNOC_0, GCC_NSSNOC_SNOC_CLK },
4398+
{ MASTER_NSSNOC_SNOC_1, SLAVE_NSSNOC_SNOC_1, GCC_NSSNOC_SNOC_1_CLK },
4399+
{ MASTER_NSSNOC_PCNOC_1, SLAVE_NSSNOC_PCNOC_1, GCC_NSSNOC_PCNOC_1_CLK },
4400+
{ MASTER_NSSNOC_QOSGEN_REF, SLAVE_NSSNOC_QOSGEN_REF, GCC_NSSNOC_QOSGEN_REF_CLK },
4401+
{ MASTER_NSSNOC_TIMEOUT_REF, SLAVE_NSSNOC_TIMEOUT_REF, GCC_NSSNOC_TIMEOUT_REF_CLK },
4402+
{ MASTER_NSSNOC_XO_DCD, SLAVE_NSSNOC_XO_DCD, GCC_NSSNOC_XO_DCD_CLK },
4403+
{ MASTER_NSSNOC_ATB, SLAVE_NSSNOC_ATB, GCC_NSSNOC_ATB_CLK },
4404+
{ MASTER_MEM_NOC_NSSNOC, SLAVE_MEM_NOC_NSSNOC, GCC_MEM_NOC_NSSNOC_CLK },
4405+
{ MASTER_NSSNOC_MEMNOC, SLAVE_NSSNOC_MEMNOC, GCC_NSSNOC_MEMNOC_CLK },
4406+
{ MASTER_NSSNOC_MEM_NOC_1, SLAVE_NSSNOC_MEM_NOC_1, GCC_NSSNOC_MEM_NOC_1_CLK },
4407+
};
4408+
43804409
static const struct of_device_id gcc_ipq9574_match_table[] = {
43814410
{ .compatible = "qcom,ipq9574-gcc" },
43824411
{ }
@@ -4399,6 +4428,9 @@ static const struct qcom_cc_desc gcc_ipq9574_desc = {
43994428
.num_resets = ARRAY_SIZE(gcc_ipq9574_resets),
44004429
.clk_hws = gcc_ipq9574_hws,
44014430
.num_clk_hws = ARRAY_SIZE(gcc_ipq9574_hws),
4431+
.icc_hws = icc_ipq9574_hws,
4432+
.num_icc_hws = ARRAY_SIZE(icc_ipq9574_hws),
4433+
.icc_first_node_id = IPQ_APPS_ID,
44024434
};
44034435

44044436
static int gcc_ipq9574_probe(struct platform_device *pdev)
@@ -4411,6 +4443,7 @@ static struct platform_driver gcc_ipq9574_driver = {
44114443
.driver = {
44124444
.name = "qcom,gcc-ipq9574",
44134445
.of_match_table = gcc_ipq9574_match_table,
4446+
.sync_state = icc_sync_state,
44144447
},
44154448
};
44164449

drivers/clk/qcom/gcc-x1e80100.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5269,6 +5269,7 @@ static struct clk_branch gcc_usb3_sec_phy_pipe_clk = {
52695269
&gcc_usb3_sec_phy_pipe_clk_src.clkr.hw,
52705270
},
52715271
.num_parents = 1,
5272+
.flags = CLK_SET_RATE_PARENT,
52725273
.ops = &clk_branch2_ops,
52735274
},
52745275
},
@@ -5339,6 +5340,7 @@ static struct clk_branch gcc_usb3_tert_phy_pipe_clk = {
53395340
&gcc_usb3_tert_phy_pipe_clk_src.clkr.hw,
53405341
},
53415342
.num_parents = 1,
5343+
.flags = CLK_SET_RATE_PARENT,
53425344
.ops = &clk_branch2_ops,
53435345
},
53445346
},

drivers/clk/qcom/kpss-xcc.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,7 @@ static int kpss_xcc_driver_probe(struct platform_device *pdev)
5858
if (IS_ERR(hw))
5959
return PTR_ERR(hw);
6060

61-
of_clk_add_hw_provider(dev->of_node, of_clk_hw_simple_get, hw);
62-
63-
return 0;
61+
return of_clk_add_hw_provider(dev->of_node, of_clk_hw_simple_get, hw);
6462
}
6563

6664
static struct platform_driver kpss_xcc_driver = {

drivers/clk/qcom/lpasscc-sc8280xp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ static const struct qcom_reset_map lpass_audiocc_sc8280xp_resets[] = {
2323
[LPASS_AUDIO_SWR_WSA2_CGCR] = { 0xd8, 1 },
2424
};
2525

26-
static struct regmap_config lpass_audiocc_sc8280xp_regmap_config = {
26+
static const struct regmap_config lpass_audiocc_sc8280xp_regmap_config = {
2727
.reg_bits = 32,
2828
.reg_stride = 4,
2929
.val_bits = 32,
@@ -41,7 +41,7 @@ static const struct qcom_reset_map lpasscc_sc8280xp_resets[] = {
4141
[LPASS_AUDIO_SWR_TX_CGCR] = { 0xc010, 1 },
4242
};
4343

44-
static struct regmap_config lpasscc_sc8280xp_regmap_config = {
44+
static const struct regmap_config lpasscc_sc8280xp_regmap_config = {
4545
.reg_bits = 32,
4646
.reg_stride = 4,
4747
.val_bits = 32,

0 commit comments

Comments
 (0)