Skip to content

Commit 05cc560

Browse files
Shawn Guobebarino
authored andcommitted
clk: qcom: a53pll/mux: Use unique clock name
Different from MSM8916 which has only one a53pll/mux clock, MSM8939 gets three for Cluster0 (little cores), Cluster1 (big cores) and CCI (Cache Coherent Interconnect). That said, a53pll/mux clock needs to be named uniquely. Append @unit-address of device node to the clock name, so that a53pll/mux will be named like below on MSM8939. a53pll@b016000 a53pll@b116000 a53pll@b1d0000 a53mux@b1d1000 a53mux@b011000 a53mux@b111000 Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Link: https://lore.kernel.org/r/20210704024032.11559-3-shawn.guo@linaro.org Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent 0dfe9bf commit 05cc560

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

drivers/clk/qcom/a53-pll.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ static const struct regmap_config a53pll_regmap_config = {
3737
static int qcom_a53pll_probe(struct platform_device *pdev)
3838
{
3939
struct device *dev = &pdev->dev;
40+
struct device_node *np = dev->of_node;
4041
struct regmap *regmap;
4142
struct resource *res;
4243
struct clk_pll *pll;
@@ -66,7 +67,12 @@ static int qcom_a53pll_probe(struct platform_device *pdev)
6667
pll->status_bit = 16;
6768
pll->freq_tbl = a53pll_freq;
6869

69-
init.name = "a53pll";
70+
/* Use an unique name by appending @unit-address */
71+
init.name = devm_kasprintf(dev, GFP_KERNEL, "a53pll%s",
72+
strchrnul(np->full_name, '@'));
73+
if (!init.name)
74+
return -ENOMEM;
75+
7076
init.parent_names = (const char *[]){ "xo" };
7177
init.num_parents = 1;
7278
init.ops = &clk_pll_sr2_ops;

drivers/clk/qcom/apcs-msm8916.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ static int qcom_apcs_msm8916_clk_probe(struct platform_device *pdev)
4646
{
4747
struct device *dev = &pdev->dev;
4848
struct device *parent = dev->parent;
49+
struct device_node *np = parent->of_node;
4950
struct clk_regmap_mux_div *a53cc;
5051
struct regmap *regmap;
5152
struct clk_init_data init = { };
@@ -61,7 +62,12 @@ static int qcom_apcs_msm8916_clk_probe(struct platform_device *pdev)
6162
if (!a53cc)
6263
return -ENOMEM;
6364

64-
init.name = "a53mux";
65+
/* Use an unique name by appending parent's @unit-address */
66+
init.name = devm_kasprintf(dev, GFP_KERNEL, "a53mux%s",
67+
strchrnul(np->full_name, '@'));
68+
if (!init.name)
69+
return -ENOMEM;
70+
6571
init.parent_data = pdata;
6672
init.num_parents = ARRAY_SIZE(pdata);
6773
init.ops = &clk_regmap_mux_div_ops;

0 commit comments

Comments
 (0)